[LLVMdev] Build problems on MinGW

Óscar Fuentes ofv at wanadoo.es
Sat Jan 17 14:45:45 PST 2009


Duncan Pierce <duncan at duncanpierce.org> writes:

> I have /lib/libimagehlp.a  and /lib/libpsapi.a
>
> nm --defined-only /lib/libpsapi.a | grep "GetProcessMemoryInfo" -
>
> returns:
>
> 00000000 T _GetProcessMemoryInfo at 12
> 00000000 I __imp__GetProcessMemoryInfo at 12
>
> And llvm-config seems to be asking for them to be picked up:
>
> -I//include  -D_DEBUG  -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -O2
> -fomit-frame-pointer  -Woverloaded-virtual
> -L//lib  -lpsapi -limagehlp -lm
> -lLLVMCore -lLLVMSupport -lLLVMSystem
>
> So I'm still mystified.

Put them at the end of the library list:

-lLLVMCore -lLLVMSupport -lLLVMSystem -limagehlp -lpsapi -lm

Unless recently changed, mingw's ld resolves symbols sequentially on the
library list, it does not look on previously processed libraries, so
order is relevant.

If llvm-config puts psapi and imagehlp at the beginning of the list,
that probably is a bug on llvm-config. But llvm-config's source code
does not mention psapi and/or imagehlp at all.

Are you sure that -lpsapi and -limagehlp are on the output of
llvm-config? They are not on my mingw's LLVM, although it is several
weeks old.

-- 
Oscar




More information about the llvm-dev mailing list