You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
configure sys-devel/clang with an appropriate CLANG_CONFIG_FILE_SYSTEM_DIR. Change clang to a shell script which invokes ${default_triple}-clang. This is because xxx-clang loads xxx.cfg while clang doesn't.
I've actually just hit a need for that because of https://bugs.gentoo.org/870001. Clang does not include <stdc-predefs.h> by default, so it's broken on e.g. musl.
* Set '--gcc-install-dir' for Clang to direct it to the currently
active GCC installation.
* Only write to /etc/clang/gentoo-gcc-install.cfg if it already exists
to allow us to back out the change gracefully (by stopping installation
in sys-devel/clang-common) as there's some concerns wrt sysroot compatibility.
Bug: llvm/llvm-project#57570
Bug: https://bugs.gentoo.org/868639
Signed-off-by: Sam James <sam@gentoo.org>
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.cppIt 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,
--gcc-install-dir=
(https://bugs.gentoo.org/868639)CLANG_CONFIG_FILE_SYSTEM_DIR
. Changeclang
to a shell script which invokes${default_triple}-clang
. This is becausexxx-clang
loadsxxx.cfg
whileclang
doesn't.Generic_GCC::GCCInstallationDetector::ScanGentooGccConfig
The text was updated successfully, but these errors were encountered: