[cfe-dev] Linking ProfileRT when using -nodefaultlibs

Eric Fiselier eric at efcs.ca
Sun Nov 9 22:42:40 PST 2014


> I'm working on making libc++ generate code coverage data. This means that
libclang_rt.profile.x86_64.a is put into the link command before '-lc' and
other dependencies.
>I suspect this change in library order causes the linker errors I see
while running the tests.

I forgot to mention this is because we use -nodefaultlibs when linking
libc++.

Sorry for the spam
/Eric

On Sun, Nov 9, 2014 at 11:39 PM, Eric Fiselier <eric at efcs.ca> wrote:

> Hello,
>
> I'm working on making libc++ generate code coverage data. This means that
> libclang_rt.profile.x86_64.a is put into the link command before '-lc' and
> other dependencies.
> I suspect this change in library order causes the linker errors I see
> while running the tests.
>
> I have a couple of questions:
>   - Should -ftest-coverage be passed when linking libc++?
>   - Is there a way to link libclang_rt.profile.x86_64.a after the given
> linker flags
>
>
> This file shows the ld invocation with and without -nodefaultlibs as well
> as the error produced when
> linking tests w/ -nodefaultlibs
> http://pastebin.com/QWagJpsW
>
> Any help is appreciated
>
> /Eric
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141109/f0240cc0/attachment.html>


More information about the cfe-dev mailing list