[all-commits] [llvm/llvm-project] afaefb: [Driver][Linux] Remove D.Dir+"/../lib" from defaul...

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri Mar 25 14:56:30 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: afaefb671fe12e7788d3e8de6b6193b935fbf16c
      https://github.com/llvm/llvm-project/commit/afaefb671fe12e7788d3e8de6b6193b935fbf16c
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-03-25 (Fri, 25 Mar 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/Linux.cpp
    M clang/test/Driver/linux-ld.c

  Log Message:
  -----------
  [Driver][Linux] Remove D.Dir+"/../lib" from default search paths for LLVM_ENABLE_RUNTIMES builds

The rule was added in 2014 to support -stdlib=libc++ and -lc++ without
specifying -L, when D.Dir is not a well-known system library directory like
/usr/lib /usr/lib64. This rule turns out to get in the way with (-m32 for
64-bit clang) or (-m64 for 32-bit clang) for Gentoo :
https://github.com/llvm/llvm-project/issues/54515

Nowadays LLVM_ENABLE_RUNTIMES is the only recommended way building libc++ and
LLVM_ENABLE_PROJECTS=libc++ is deprecated. LLVM_ENABLE_RUNTIMES builds libc++
in D.Dir+"/../lib/${triple}/". The rule is unneeded. Also reverts D108286.

Gentoo uses a modified LLVM_ENABLE_RUNTIMES that installs libc++.so in
well-known paths like /usr/lib64 and /usr/lib which are already covered by
nearby search paths.

Implication: if a downstream package needs something like -lLLVM-15git and uses
libLLVM-15git.so not in a well-known path, it needs to supply -L
D.Dir+"/../lib" explicitly (e.g. via LLVMConfig.cmake), instead of relying on
the previous default search path.

Reviewed By: mgorny

Differential Revision: https://reviews.llvm.org/D122444




More information about the All-commits mailing list