llvm-project/lld/lib/ReaderWriter
Tim Northover 77d82202d1 [mach-o]: support -syslibroot and -l options
These behave slightly idiosyncratically in the best of cases, and have
additional hacks layered on top of that for compatibility with badly behaved
build systems (via ld64).

For -lXYZ:
  + If XYZ is actually XY.o then search all library paths for XY.o
  + Otherwise search all library paths, first for libXYZ.dylib, then libXYZ.a
  + By default the library paths are /usr/lib and /usr/local/lib in that order.

For -syslibroot:
  + -syslibroot options apply to absolute paths in the search order.
  + All -syslibroot prefixes that exist are added to the search path *instead*
    of the original.
  + If no -syslibroot prefixed path exists, the original is kept.
  + Hacks^WExceptions:
      + If only 1 -syslibroot is given and doesn't contain /usr/lib or
        /usr/local/lib, that path is dropped entirely. (rdar://problem/6438270).
      + If the last -syslibroot is "/", all of them are ignored entirely.
        (rdar://problem/5829579).

At least, that's my best interpretation of what ld64 does in buildSearchPaths.

llvm-svn: 212706
2014-07-10 11:21:06 +00:00
..
ELF Update for llm api change. 2014-07-05 11:39:02 +00:00
MachO [mach-o]: support -syslibroot and -l options 2014-07-10 11:21:06 +00:00
Native include system_error directly. 2014-06-12 17:15:58 +00:00
PECOFF [PECOFF] Fix .bss section alignment 2014-07-08 23:11:01 +00:00
YAML Update for llvm api change. 2014-06-13 17:20:48 +00:00
CMakeLists.txt [CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to increase opportunity for parallel build. 2014-02-26 06:53:16 +00:00
CoreLinkingContext.cpp Move GOTPass and StubsPass from Core to MachO 2014-07-09 21:04:24 +00:00
FileArchive.cpp Update for llvm api change. 2014-06-24 13:57:13 +00:00
LinkerScript.cpp [LinkerScript] parse OUTPUT_FORMAT : treat quotedStrings as identifier 2014-02-25 17:02:54 +00:00
Makefile Initial set of Makefiles 2014-06-04 09:54:07 +00:00
Reader.cpp [PECOFF] Support COMDAT associative sections. 2014-06-17 16:19:33 +00:00
Writer.cpp [lld][InputGraph] Change the Resolver to use inputGraph 2013-10-07 02:47:09 +00:00