[clang] [Clang] Take libstdc++ into account during GCC detection (PR #145056)

Frederik Harwath via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 20 00:39:47 PDT 2025


frederik-h wrote:

> > LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-ubuntu-fast` running on `sie-linux-worker` while building `clang` at step 6 "test-build-unified-tree-check-all".
> > Full details are available at: [lab.llvm.org/buildbot#/builders/144/builds/33199](https://lab.llvm.org/buildbot/#/builders/144/builds/33199)
> > Here is the relevant piece of the build log for the reference
> 
> ```
> ******************** TEST 'Clang :: Driver/gcc-toolchain-libstdcxx.cpp' FAILED ********************
> Exit Code: 1
> Command Output (stderr):
> --
> /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang --gcc-toolchain=/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Driver/Inputs/gcc_toolchain_libstdcxx/gcc10/usr -v 2>&1 |& /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Driver/gcc-toolchain-libstdcxx.cpp --check-prefix=GCC10 # RUN: at line 10
> + /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang --gcc-toolchain=/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Driver/Inputs/gcc_toolchain_libstdcxx/gcc10/usr -v
> + /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Driver/gcc-toolchain-libstdcxx.cpp --check-prefix=GCC10
> /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Driver/gcc-toolchain-libstdcxx.cpp:11:11: error: GCC10: expected string not found in input
> // GCC10: clang: warning: future releases of the clang compiler will prefer GCC installations containing libstdc++ include directories; '[[PREFIX:.*gcc_toolchain_libstdcxx/gcc10/usr/lib/gcc/x86_64-linux-gnu]]/10' would be chosen over '[[PREFIX]]/12' [-Wgcc-install-dir-libstdcxx]
>           ^
> <stdin>:1:1: note: scanning from here
> clang version 22.0.0git (https://github.com/llvm/llvm-project.git 50a3368f226ad954fc26c8d79c0a10e2b644350d)
> ^
> Input file: <stdin>
> Check file: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Driver/gcc-toolchain-libstdcxx.cpp
> ```
> 
> Without an explicit `--target=`, `--gcc-toolchain=` may not be consumed, leading to a warning. `|&` is not a POSIX shell feature and cannot be used in lit test.

Thank you @MaskRay! I must have copied the `|&` from a manual test run invocation :-/. Does the test in https://github.com/llvm/llvm-project/pull/154487 look good to you now?

https://github.com/llvm/llvm-project/pull/145056


More information about the cfe-commits mailing list