Skip to content

Commit 7fb71d1

Browse files
authored
[SystemZ] Fix handling of target triples on Debian (llvm#95407) (llvm#97546)
Debian's GCC installation has target triple "s390x-linux-gnu". Since, unlike in Ubuntu, there is no /etc/lsb-release, config.guess detects "s390x-ibm-linux". Generic_GCC::GCCInstallationDetector::init() only tries to strip the "unknown" vendor, so GCC installation detection fails. Checking /etc/os-release in addition to /etc/lsb-release fixes this problem. However, LLVM-built sanitizer runtimes still cannot be found: the driver looks for them in lib/clang/19/lib/s390x-linux-gnu, but the build system places them in lib/clang/19/lib/s390x-unknown-linux-gnu. According to @MaskRay, the build system is doing the right thing [1]: on the file system, full arch-vendor-os-environment triples must be used. In order to satisfy both GCCInstallationDetector and this rule, use the "s390x-unknown-linux-gnu" triple. [1] llvm#95407 (comment)
1 parent 4835572 commit 7fb71d1

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

llvm/cmake/config.guess

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,11 +1028,7 @@ EOF
10281028
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10291029
exit ;;
10301030
s390:Linux:*:* | s390x:Linux:*:*)
1031-
if [ "$(grep -Ei 'debian|ubuntu' /etc/lsb-release)" ]; then
1032-
echo ${UNAME_MACHINE}-linux-gnu
1033-
else
1034-
echo ${UNAME_MACHINE}-ibm-linux
1035-
fi
1031+
echo ${UNAME_MACHINE}-unknown-linux-gnu
10361032
exit ;;
10371033
sh64*:Linux:*:*)
10381034
echo ${UNAME_MACHINE}-unknown-linux-gnu

0 commit comments

Comments
 (0)