Bug#941817: llvm-toolchain-9: FTBFS on x32
Thorsten Glaser
t.glaser at tarent.de
Mon Oct 28 15:09:45 GMT 2019
retitle 941817 llvm-toolchain-9: FTBFS on x32
reassign 941817 src:llvm-toolchain-9
found 941817 1:9.0.0-2
thanks
OK, let’s try to get this fixed in llvm-toolchain-9 and hope
that we both manage it and can bump the defaults for x32 once
working. Please note that llvm-toolchain-9 uses GCC 8 instead
of the default compiler for building still, which might be a
problem eventually.
The patch rebased is attached; I’m currently building the pak‐
kage locally and don’t know yet whether it is complete.
bye,
//mirabilos
--
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg
**********
Mit der tarent Academy bieten wir auch Trainings und Schulungen in den
Bereichen Softwareentwicklung, Agiles Arbeiten und Zukunftstechnologien an.
Besuchen Sie uns auf www.tarent.de/academy. Wir freuen uns auf Ihren Kontakt.
**********
-------------- next part --------------
diff -Nru llvm-toolchain-9-9.0.0/debian/changelog llvm-toolchain-9-9.0.0/debian/changelog
--- llvm-toolchain-9-9.0.0/debian/changelog 2019-10-20 17:27:50.000000000 +0200
+++ llvm-toolchain-9-9.0.0/debian/changelog 2019-10-28 15:18:43.000000000 +0100
@@ -1,3 +1,11 @@
+llvm-toolchain-9 (1:9.0.0-2+x32.1) unreleased; urgency=high
+
+ * Non-maintainer upload.
+ * Add back cbmuser’s patch to fix include and library paths on x32
+ to fix the build (Closes: #941817)
+
+ -- Thorsten Glaser <tg at mirbsd.de> Mon, 28 Oct 2019 15:18:43 +0100
+
llvm-toolchain-9 (1:9.0.0-2) unstable; urgency=medium
* polly, openmp & lldb aren't enabled for every platform
diff -Nru llvm-toolchain-9-9.0.0/debian/patches/series llvm-toolchain-9-9.0.0/debian/patches/series
--- llvm-toolchain-9-9.0.0/debian/patches/series 2019-10-20 17:27:50.000000000 +0200
+++ llvm-toolchain-9-9.0.0/debian/patches/series 2019-10-28 15:15:40.000000000 +0100
@@ -19,6 +19,7 @@
clang-tidy-run-bin.diff
0001-tools-clang-cmake-resolve-symlinks-in-ClangConfig.cmake.patch
debug-jit-path.diff
+x32-fix-driver-search-paths.diff
# commented because of bug 903709
#force-gcc-header-obj.diff
diff -Nru llvm-toolchain-9-9.0.0/debian/patches/x32-fix-driver-search-paths.diff llvm-toolchain-9-9.0.0/debian/patches/x32-fix-driver-search-paths.diff
--- llvm-toolchain-9-9.0.0/debian/patches/x32-fix-driver-search-paths.diff 1970-01-01 01:00:00.000000000 +0100
+++ llvm-toolchain-9-9.0.0/debian/patches/x32-fix-driver-search-paths.diff 2019-10-28 15:16:35.000000000 +0100
@@ -0,0 +1,80 @@
+Description: Fix missing include and library paths on x32
+Author: John Paul Adrian Glaubitz <glaubitz at physik.fu-berlin.de>
+Forwarded: https://reviews.llvm.org/D52050
+Last-Update: 2019-10-28
+
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -1956,7 +1956,10 @@ void Generic_GCC::GCCInstallationDetecto
+ "x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
+ "x86_64-slackware-linux", "x86_64-unknown-linux",
+ "x86_64-amazon-linux", "x86_64-linux-android"};
+- static const char *const X32LibDirs[] = {"/libx32"};
++ static const char *const X32LibDirs[] = {"/libx32", "/lib"};
++ static const char *const X32Triples[] = {
++ "x86_64-linux-gnux32", "x86_64-unknown-linux-gnux32",
++ "x86_64-pc-linux-gnux32"};
+ static const char *const X86LibDirs[] = {"/lib32", "/lib"};
+ static const char *const X86Triples[] = {
+ "i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu",
+@@ -2173,14 +2176,16 @@ void Generic_GCC::GCCInstallationDetecto
+ TripleAliases.append(begin(AVRTriples), end(AVRTriples));
+ break;
+ case llvm::Triple::x86_64:
+- LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
+- TripleAliases.append(begin(X86_64Triples), end(X86_64Triples));
+ // x32 is always available when x86_64 is available, so adding it as
+ // secondary arch with x86_64 triples
+ if (TargetTriple.getEnvironment() == llvm::Triple::GNUX32) {
+- BiarchLibDirs.append(begin(X32LibDirs), end(X32LibDirs));
++ LibDirs.append(begin(X32LibDirs), end(X32LibDirs));
++ TripleAliases.append(begin(X32Triples), end(X32Triples));
++ BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
+ BiarchTripleAliases.append(begin(X86_64Triples), end(X86_64Triples));
+ } else {
++ LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++ TripleAliases.append(begin(X86_64Triples), end(X86_64Triples));
+ BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
+ BiarchTripleAliases.append(begin(X86Triples), end(X86Triples));
+ }
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -88,10 +88,13 @@ static std::string getMultiarchTriple(co
+ case llvm::Triple::x86_64:
+ if (IsAndroid)
+ return "x86_64-linux-android";
+- // We don't want this for x32, otherwise it will match x86_64 libs
+- if (TargetEnvironment != llvm::Triple::GNUX32 &&
+- D.getVFS().exists(SysRoot + "/lib/x86_64-linux-gnu"))
+- return "x86_64-linux-gnu";
++ if (TargetEnvironment == llvm::Triple::GNUX32) {
++ if (D.getVFS().exists(SysRoot + "/lib/x86_64-linux-gnux32"))
++ return "x86_64-linux-gnux32";
++ } else {
++ if (D.getVFS().exists(SysRoot + "/lib/x86_64-linux-gnu"))
++ return "x86_64-linux-gnu";
++ }
+ break;
+ case llvm::Triple::aarch64:
+ if (IsAndroid)
+@@ -711,6 +714,8 @@ void Linux::AddClangSystemIncludeArgs(co
+ // in use in any released version of Debian, so we should consider
+ // removing them.
+ "/usr/include/i686-linux-gnu/64", "/usr/include/i486-linux-gnu/64"};
++ const StringRef X32MultiarchIncludeDirs[] = {
++ "/usr/include/x86_64-linux-gnux32"};
+ const StringRef X86MultiarchIncludeDirs[] = {
+ "/usr/include/i386-linux-gnu",
+
+@@ -768,7 +773,10 @@ void Linux::AddClangSystemIncludeArgs(co
+ ArrayRef<StringRef> MultiarchIncludeDirs;
+ switch (getTriple().getArch()) {
+ case llvm::Triple::x86_64:
+- MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
++ if (getTriple().getEnvironment() == llvm::Triple::GNUX32)
++ MultiarchIncludeDirs = X32MultiarchIncludeDirs;
++ else
++ MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
+ break;
+ case llvm::Triple::x86:
+ MultiarchIncludeDirs = X86MultiarchIncludeDirs;
More information about the Pkg-llvm-team
mailing list