[PATCH] D108286: [clang][Driver][Linux] fix regression issue when define LIBCXX_LIBDIR_SUFFIX=64

lin.sun via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 18 17:16:20 PDT 2021


sunlin added a comment.

In D108286#2952511 <https://reviews.llvm.org/D108286#2952511>, @MaskRay wrote:

> Please provide more information: the platform name and the output of `g++ empty.cc '-###' |& sed -E 's/ "?-[LiIr]/\n&/g'`
>
> Note that there is a FIXME. It's unclear why your platform needs the specific rule.

The root cause is clang13 lost the ".../lib64" in  LIBRARY_PATH conparing to clang12 source code.
This patch is try to add the line back from clang 12 https://github.com/llvm/llvm-project/blob/fed41342a82f5a3a9201819a82bf7a48313e296b/clang/lib/Driver/ToolChains/Linux.cpp#L309.

Anyway, the g++ output are list as below.
$ g++ empty.cc '-###' |& sed -E 's/ "?-[LiIr]/\n&/g'
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
COLLECT_GCC_OPTIONS='-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/4.8.5/cc1plus -quiet -D_GNU_SOURCE empty.cc -quiet -dumpbase empty.cc "-mtune=generic" "-march=x86-64" -auxbase empty -o /tmp/ccaC9lqH.s
COLLECT_GCC_OPTIONS='-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as --64 -o /tmp/cctILs46.o /tmp/ccaC9lqH.s
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/:/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.8.5/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/4.8.5/collect2 --build-id --no-add-needed --eh-frame-hdr "--hash-style=gnu" -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbegin.o
 -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/../../.. /tmp/cctILs46.o "-lstdc++" -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108286



More information about the cfe-commits mailing list