[PATCH] D97993: [Driver] Suppress GCC detection under -B for non-Android

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 5 12:15:00 PST 2021


MaskRay added a comment.

In D97993#2607523 <https://reviews.llvm.org/D97993#2607523>, @manojgupta wrote:

> Another concern is people generally want clang to work out of box without any special arguments.  As a user, after installing clang's distro package or building from source, I expect that basic compilation should work out-of-box which includes gcc detection.
> i.e. "clang foo.cpp -o foo" should just work in most cases.
>
> If a user now needs to pass "-gcc-toolchain" to find gcc libraries when it just used to work, that is most likely not desirable.

There may be some confusion. The regular usage all works fine.

- `clang++ foo.cpp` detects GCC installation.
- `clang++ --gcc-toolchain=Inputs foo.cpp` detects GCC installation under Inputs.
- `clang++ -BInputs foo.cpp` detects GCC installation under Inputs and `/`. With this patch `Inputs` is not used for detection. `Inputs` is still used for finding executables (ld, as)
- `clang++ -BA --gcc-toolchain=B foo.cpp` detects GCC installation under A and B. With this patch, only B is used for detection.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97993



More information about the cfe-commits mailing list