Bug#941817: Updated debdiff, still not working
Thorsten Glaser
t.glaser at tarent.de
Tue Jul 21 20:38:40 BST 2020
Hi *,
I’m attaching the latest updated debdiff so it doesn’t get lost.
It still doesn’t make LLVM work on x32 though ☹
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.1/debian/changelog llvm-toolchain-9-9.0.1/debian/changelog
--- llvm-toolchain-9-9.0.1/debian/changelog 2020-04-01 17:23:55.000000000 +0200
+++ llvm-toolchain-9-9.0.1/debian/changelog 2020-05-11 15:08:11.000000000 +0200
@@ -1,3 +1,12 @@
+llvm-toolchain-9 (1:9.0.1-12+x32.1) unreleased; urgency=medium
+
+ * Non-maintainer upload. (Advances: #941817)
+ * Add back cbmuser’s patch to fix include and library paths on x32
+ to fix the build (d/p/x32-fix-driver-search-paths.diff)
+ * d/p/x86-triarch.diff: Fix x32→amd64 cross “ld -r” call
+
+ -- Thorsten Glaser <tg at mirbsd.de> Mon, 11 May 2020 15:08:11 +0200
+
llvm-toolchain-9 (1:9.0.1-12) unstable; urgency=medium
[ Jessica Clarke ]
diff -Nru llvm-toolchain-9-9.0.1/debian/patches/series llvm-toolchain-9-9.0.1/debian/patches/series
--- llvm-toolchain-9-9.0.1/debian/patches/series 2020-04-01 17:23:55.000000000 +0200
+++ llvm-toolchain-9-9.0.1/debian/patches/series 2020-05-11 15:01:23.000000000 +0200
@@ -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
@@ -145,3 +146,4 @@
no-cgi.patch
947f9692440836dcb8d88b74b69dd379d85974ce.patch
riscv64-multilib-empty.patch
+x86-triarch.diff
diff -Nru llvm-toolchain-9-9.0.1/debian/patches/x32-fix-driver-search-paths.diff llvm-toolchain-9-9.0.1/debian/patches/x32-fix-driver-search-paths.diff
--- llvm-toolchain-9-9.0.1/debian/patches/x32-fix-driver-search-paths.diff 1970-01-01 01:00:00.000000000 +0100
+++ llvm-toolchain-9-9.0.1/debian/patches/x32-fix-driver-search-paths.diff 2020-05-11 14:57:46.000000000 +0200
@@ -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: 2020-05-11
+
+--- 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)
+@@ -712,6 +715,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",
+
+@@ -769,7 +774,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;
diff -Nru llvm-toolchain-9-9.0.1/debian/patches/x86-triarch.diff llvm-toolchain-9-9.0.1/debian/patches/x86-triarch.diff
--- llvm-toolchain-9-9.0.1/debian/patches/x86-triarch.diff 1970-01-01 01:00:00.000000000 +0100
+++ llvm-toolchain-9-9.0.1/debian/patches/x86-triarch.diff 2020-05-11 15:07:59.000000000 +0200
@@ -0,0 +1,20 @@
+Description: Fix assumptions since x86 is triarch nowadays
+ Do not assume that an x86 system is amd64 (x86_64) if it
+ isn’t i386, since it can be x32 (amd64ilp32): add -m to
+ linker flags for both, and add a TODO note for x32 handling.
+Author: mirabilos <tg at debian.org>
+Forwarded: not-yet
+
+--- a/compiler-rt/lib/fuzzer/CMakeLists.txt
++++ b/compiler-rt/lib/fuzzer/CMakeLists.txt
+@@ -123,7 +123,10 @@ if(OS_NAME MATCHES "Linux|Fuchsia" AND
+ macro(partially_link_libcxx name dir arch)
+ if(${arch} MATCHES "i386")
+ set(EMULATION_ARGUMENT "-m" "elf_i386")
++ elseif(${arch} MATCHES "x86_64")
++ set(EMULATION_ARGUMENT "-m" "elf_x86_64")
+ else()
++ #XXX TODO: x32 (elf32_x86_64)
+ set(EMULATION_ARGUMENT "")
+ endif()
+ set(cxx_${arch}_merge_dir "${CMAKE_CURRENT_BINARY_DIR}/cxx_${arch}_merge.dir")
More information about the Pkg-llvm-team
mailing list