[cfe-dev] Clang for ARM

Renato Golin renato.golin at linaro.org
Thu Oct 3 12:13:53 PDT 2013


On 3 October 2013 18:37, Anton Smirnov <dev at antonsmirnov.name> wrote:

>
>> http://stackoverflow.com/questions/12993460/why-am-i-getting-undefined-reference-to-dladdr-even-with-ldl-for-this-simpl
>>
>> So i wonder what should i do and is it bug or my dev env issue?
>>
>
> > Did you try the solution in that question?
>
> I did not actually catch what should i do.
> Should i just run `llvm-config --libs core` `llvm-config --ldflags`before "make"?
>

No, that's what's going to get the Makefile in the right order. If you run
it manually, you won't change anything.

What's the answer is trying to say is that llvm-config is getting -ldl in
the wrong order, so the line that generates the LDFLAGS should call
llvm-config twice (in that order), instead of once, as it's probably doing
it now.

To make sure this is, indeed, a solution, I recommend you to look into the
Makefile/Ninja rules, to see what is the generated order of libraries, and
if -ldl appears before or after LLVMSupport. If you change the Make/Ninja
file and it works, means the call to llvm-config is bad, and this needs to
be fixed in llvm-config itself, at least for the Android case.

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131003/ac69b138/attachment.html>


More information about the cfe-dev mailing list