[PATCH] D39412: [Driver] Give LIBRARY_PATH precedence over native toolchains

Zhihao Yuan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 29 23:53:35 PDT 2017


lichray created this revision.
Herald added subscribers: aheejin, jgravelle-google, sbc100, nhaehnle, dschuff, jfb, emaste.

`LIBRARY_PATH` expansion should happen before expanding native toolchains' linker arguments, if any, to allow overriding the default standard libraries to link.  GCC supports this practice as well.

Factor the code expanding `LIBRARY_PATH` out of `AddLinkerInputs` into `AddLibraryPaths` add let the platform-specific code decide the appropriate order for these flags.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=16786


https://reviews.llvm.org/D39412

Files:
  lib/Driver/ToolChains/AMDGPU.cpp
  lib/Driver/ToolChains/AVR.cpp
  lib/Driver/ToolChains/Ananas.cpp
  lib/Driver/ToolChains/BareMetal.cpp
  lib/Driver/ToolChains/CloudABI.cpp
  lib/Driver/ToolChains/CommonArgs.cpp
  lib/Driver/ToolChains/CommonArgs.h
  lib/Driver/ToolChains/CrossWindows.cpp
  lib/Driver/ToolChains/Darwin.cpp
  lib/Driver/ToolChains/DragonFly.cpp
  lib/Driver/ToolChains/FreeBSD.cpp
  lib/Driver/ToolChains/Fuchsia.cpp
  lib/Driver/ToolChains/Gnu.cpp
  lib/Driver/ToolChains/Hexagon.cpp
  lib/Driver/ToolChains/MinGW.cpp
  lib/Driver/ToolChains/Minix.cpp
  lib/Driver/ToolChains/Myriad.cpp
  lib/Driver/ToolChains/NaCl.cpp
  lib/Driver/ToolChains/NetBSD.cpp
  lib/Driver/ToolChains/OpenBSD.cpp
  lib/Driver/ToolChains/PS4CPU.cpp
  lib/Driver/ToolChains/Solaris.cpp
  lib/Driver/ToolChains/WebAssembly.cpp
  lib/Driver/ToolChains/XCore.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39412.120772.patch
Type: text/x-patch
Size: 12529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171030/f9ab6447/attachment-0001.bin>


More information about the cfe-commits mailing list