llvm-project/lld/lib/ReaderWriter/MachO
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
..
Atoms.h [mach-o] Add parsing of arm/thumb relocations 2014-07-04 00:11:09 +00:00
CMakeLists.txt Move GOTPass and StubsPass from Core to MachO 2014-07-09 21:04:24 +00:00
ExecutableAtoms.hpp MachO: rename _outputFileType to avoid shadowing parent field. 2014-06-20 15:59:00 +00:00
File.h [mach-o] Add parsing of arm/thumb relocations 2014-07-04 00:11:09 +00:00
GOTPass.cpp Move GOTPass and StubsPass from Core to MachO 2014-07-09 21:04:24 +00:00
GOTPass.hpp Move GOTPass and StubsPass from Core to MachO 2014-07-09 21:04:24 +00:00
MachOLinkingContext.cpp [mach-o]: support -syslibroot and -l options 2014-07-10 11:21:06 +00:00
MachONormalizedFile.h [mach-o] improve errors when mixing architectures 2014-06-30 22:57:33 +00:00
MachONormalizedFileBinaryReader.cpp [mach-o] add representation for LC_ID_DYLIB to MachONormalizedFile 2014-07-01 08:15:41 +00:00
MachONormalizedFileBinaryUtils.h [mach-o] add parsing of x86 relocations 2014-07-02 23:52:22 +00:00
MachONormalizedFileBinaryWriter.cpp [mach-o] add representation for LC_ID_DYLIB to MachONormalizedFile 2014-07-01 08:15:41 +00:00
MachONormalizedFileFromAtoms.cpp [mach-o] add x86 test case to build hello world. Fix bugs it uncovered. 2014-07-03 02:01:21 +00:00
MachONormalizedFileToAtoms.cpp [mach-o] Add parsing of arm/thumb relocations 2014-07-04 00:11:09 +00:00
MachONormalizedFileYAML.cpp [mach-o] add representation for LC_ID_DYLIB to MachONormalizedFile 2014-07-01 08:15:41 +00:00
MachOPasses.h Move GOTPass and StubsPass from Core to MachO 2014-07-09 21:04:24 +00:00
Makefile Initial set of Makefiles 2014-06-04 09:54:07 +00:00
ReferenceKinds.cpp [mach-o] Add parsing of arm/thumb relocations 2014-07-04 00:11:09 +00:00
ReferenceKinds.h [mach-o] Add parsing of arm/thumb relocations 2014-07-04 00:11:09 +00:00
StubAtoms.hpp Move Simple.h and Alias.h to include/Core. 2014-06-11 21:47:51 +00:00
StubAtoms_x86.hpp [mach-o] add x86 test case to build hello world. Fix bugs it uncovered. 2014-07-03 02:01:21 +00:00
StubAtoms_x86_64.hpp [mach-o] refactor x86_64 relocation handling. 2014-06-27 18:25:01 +00:00
StubsPass.cpp Move GOTPass and StubsPass from Core to MachO 2014-07-09 21:04:24 +00:00
StubsPass.hpp Move GOTPass and StubsPass from Core to MachO 2014-07-09 21:04:24 +00:00
WriterMachO.cpp MachO: rename _outputFileType to avoid shadowing parent field. 2014-06-20 15:59:00 +00:00