[PATCH] D65880: [Driver] Move LIBRARY_PATH before user inputs

Joachim Protze via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 06:51:44 PDT 2020


protze.joachim added a comment.

I still see some clang-specific and system link directories listed in the linker line before the directories from `LIBRARY_PATH`:

  $ LIBRARY_PATH=test1 /usr/local/clang/bin/clang -Ltest2 -v hello.c
   "/usr/bin/ld" .../crtbegin.o -Ltest2 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.. -L/usr/local/clang/bin/../lib -L/lib -L/usr/lib -Ltest1

I think they are inserted by `ToolChain.AddFilePathLibArgs` in Gnu.cpp. Is this the intended ordering? My expectation would be

  $ LIBRARY_PATH=test1 /usr/local/clang/bin/clang -Ltest2 -v hello.c
   "/usr/bin/ld" .../crtbegin.o -Ltest2 -Ltest1 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.. -L/usr/local/clang/bin/../lib -L/lib -L/usr/lib

@hfinkel any opinion?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65880/new/

https://reviews.llvm.org/D65880



More information about the llvm-commits mailing list