Dlang LLVM ERROR: Program used external function which could not be resolved

BARRE KEVIN via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Jun 15 09:06:07 PDT 2017


On Thursday, 15 June 2017 at 14:59:48 UTC, David Nadlinger wrote:
> On 15 Jun 2017, at 15:50, BARRE KEVIN via digitalmars-d-ldc 
> wrote:
>> LLVM ERROR: Program used external function '__start___minfo' 
>> which could not be resolved!
>
> lli's error message is slightly misleading; __start___minfo is 
> not a function, but a special symbol usually "created" by the 
> linker while producing the main executable. It is used to 
> register the D modules from your executable with druntime, so 
> that static constructors, etc. can be invoked.
>
> You'd need to disable all the functionality requiring runtime 
> support to make D code work within lli, for example using 
> `-betterC` or `pragma(LDC_no_moduleinfo)`/…. Still not sure why 
> you would want to use `lli` with LDC-compiled code in the first 
> place, though.
>
>  — David

ldc2 -output-ll -betterC main.d
lli -load /usr/lib/libphobos2-ldc.so.72 main.ll

output -> Hello World !!!

Thanks David

You are ninja


More information about the digitalmars-d-ldc mailing list