This is an archive of the discontinued LLVM Phabricator instance.

builtins: use -fPIC if supported
AbandonedPublic

Authored by brian on Apr 28 2016, 12:47 PM.

Details

Summary

Otherwise, I get complaints from the linker when trying to create shared objects
which use certain functions from libclang_rt.builtins-arm.a (__aeabi_l2d is the specific
one I found).

As of r146499, it looks like the Makefiles are already doing this.

Diff Detail

Event Timeline

brian updated this revision to Diff 55461.Apr 28 2016, 12:47 PM
brian retitled this revision from to builtins: use -fPIC if supported.
brian updated this object.

I'm not completely sure how this works, but I think this comment will show up on the mailing list. Can somebody please review this?

I can't review it for you, but you can use either 'git blame' or 'arc cover' to try to figure out who a good reviewer might be and add them. If they aren't the right person, hopefully they will add or suggest someone more appropriate.

Good luck...

compnerd accepted this revision.Jun 25 2016, 12:04 PM
compnerd added a reviewer: compnerd.
compnerd added a subscriber: compnerd.
compnerd added inline comments.
lib/builtins/CMakeLists.txt
378

This needs to be more target specific. Not all targets may support this flag.

This revision is now accepted and ready to land.Jun 25 2016, 12:04 PM

@compnerd: It looks like you're a committer, so you can you commit this?

Thanks!

lib/builtins/CMakeLists.txt
378

I think cmake/builtin-config-ix.cmake checks if the target supports the flag when setting COMPILER_RT_HAS_FPIC_FLAG. Also, it's set the same way COMPILER_RT_HAS_STD_C99_FLAG is, which I doubt all targets support either. Is there something wrong with that approach?

Looks like patch was not committed, but it should be rebased from trunk.

brian abandoned this revision.Sep 25 2016, 7:52 AM

Actually, when I went to rebase, I noticed that D23729 already added -fPIC and some other flags, so this isn't necessary any more.