-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Open
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'
Description
On Gentoo Linux, Clang Driver tries to pick the GCC installation as selected by gcc-config.
It reads $sysroot/etc/env.d/gcc/config-$CandidateTriple}
, does some parsing, and selects the desired GCC installation.
See Generic_GCC::GCCInstallationDetector::ScanGentooGccConfig
in https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Gnu.cpp
It tries to be permissive with --target=
by detecting several aliases. I think these aliases detection should be removed.
GentooTestTriples.push_back(TargetTriple.str());
// Check rest of triples.
GentooTestTriples.append(ExtraTripleAliases.begin(),
ExtraTripleAliases.end());
GentooTestTriples.append(CandidateTripleAliases.begin(),
CandidateTripleAliases.end());
The code parses CURRENT=
, LDPATH=
, etc, which does not look very pretty. I am considering adding --gcc-install-dir=
(https://reviews.llvm.org/D133329).
With the option,
- make gcc-config provide a configuration file specifying
--gcc-install-dir=
(https://bugs.gentoo.org/868639) - configure sys-devel/clang with an appropriate
CLANG_CONFIG_FILE_SYSTEM_DIR
. Changeclang
to a shell script which invokes${default_triple}-clang
. This is becausexxx-clang
loadsxxx.cfg
whileclang
doesn't. - Remove
Generic_GCC::GCCInstallationDetector::ScanGentooGccConfig
Metadata
Metadata
Assignees
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'