[PATCH] D51440: [ToolChains] Link to compiler-rt with -L + -l when possible

Steven Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 5 15:47:10 PDT 2018


steven_wu added a comment.

I do prefer the current approach especially on Darwin. Some concerns of switching to use "-L + -l" are:

1. clang and compiler-rt are rev-locked. Inferring the compiler-rt from resource-dir and passing to linker with the full path can prevent mistakes of mixing them up.
2. This change does change linker semantics on Darwin. ld64 treats the inputs from command line with highest priority. Currently ld64 will use compiler-rt symbols before any other libraries passed in with -l flag. If clang decide to pass compiler-rt with -l flag, any other libraries (static or dynamic) that passed with -l flag will takes the priority over compiler-rt. This can lead to unexpected behavior.


Repository:
  rC Clang

https://reviews.llvm.org/D51440





More information about the cfe-commits mailing list