[PATCH] [lld] [mach-o] Support -l and -syslibroot options

Tim Northover t.p.northover at gmail.com
Wed Jul 9 05:12:44 PDT 2014


I think this new version emulates the ld64 behaviour, certainly with much greater fidelity than before:
- multiple -syslibroot options are accepted.
- They apply to absolute paths (not visible yet because no -L).
- Various quirks around single or special -syslibroot args.

I've also added a variant of the testing mode Nick suggested (in addition to the actual linking test), with a couple of modifications. 
- I decided that printing each queried path as it happened was too algorithm-dependent, when what we're really interested in is the outcome, so the actual behaviour is closer to ld64's "-v" option and prints out the final search paths.
- I also decided that all pathExists calls failing was too inflexible and wouldn't allow us to actually test the algorithm's behaviour in most cases, so I also added a -path_exists override.

There's still no -L support, that'll be coming later (though it should be fairly simple). I think I've addressed the other comments though.

So how does this version look?

Cheers.

Tim.

http://reviews.llvm.org/D4409

Files:
  include/lld/ReaderWriter/MachOLinkingContext.h
  lib/Driver/DarwinLdDriver.cpp
  lib/Driver/DarwinLdOptions.td
  lib/ReaderWriter/MachO/MachOLinkingContext.cpp
  test/mach-o/Inputs/lib-search-paths/usr/lib/libmyshared.dylib
  test/mach-o/Inputs/lib-search-paths/usr/lib/libmystatic.a
  test/mach-o/Inputs/lib-search-paths/usr/local/lib/file.o
  test/mach-o/lib-search-paths.yaml
  test/mach-o/libresolve-bizarre-root-override.yaml
  test/mach-o/libresolve-multiple-syslibroots.yaml
  test/mach-o/libresolve-one-syslibroot.yaml
  test/mach-o/libresolve-simple.yaml
  test/mach-o/libresolve-syslibroot.yaml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4409.11189.patch
Type: text/x-patch
Size: 16692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140709/4abce564/attachment.bin>


More information about the llvm-commits mailing list