Bug#908847: llvm-toolchain-6.0: FTBFS on hurd-i386
Samuel Thibault
sthibault at debian.org
Thu Oct 18 15:30:52 BST 2018
Hello,
Svante Signell, le sam. 15 sept. 2018 01:45:06 +0200, a ecrit:
> Currently llvm-toolchain-6.0 FTBFS on GNU/Hurd due to missing porting
> issues. Attached are three patches to fix this:
As this is blocking a hell lot of packages, I have uploaded the attached
NMU to delayed/5.
Samuel
-------------- next part --------------
diff -Nru llvm-toolchain-6.0-6.0.1/debian/changelog llvm-toolchain-6.0-6.0.1/debian/changelog
--- llvm-toolchain-6.0-6.0.1/debian/changelog 2018-09-14 07:24:02.000000000 +0000
+++ llvm-toolchain-6.0-6.0.1/debian/changelog 2018-10-16 20:18:39.000000000 +0000
@@ -1,3 +1,13 @@
+llvm-toolchain-6.0 (1:6.0.1-9.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Apply hurd fixes (Closes: #908847).
+ - hurd-lib_Support_Unix_Path.inc.diff
+ - hurd-pathmax.diff
+ - hurd-tools_llvm-shlib_CMakeLists.txt.diff
+
+ -- Samuel Thibault <sthibault at debian.org> Tue, 16 Oct 2018 20:18:39 +0000
+
llvm-toolchain-6.0 (1:6.0.1-9) unstable; urgency=medium
[ John Paul Adrian Glaubitz ]
diff -Nru llvm-toolchain-6.0-6.0.1/debian/patches/hurd-lib_Support_Unix_Path.inc.diff llvm-toolchain-6.0-6.0.1/debian/patches/hurd-lib_Support_Unix_Path.inc.diff
--- llvm-toolchain-6.0-6.0.1/debian/patches/hurd-lib_Support_Unix_Path.inc.diff 1970-01-01 00:00:00.000000000 +0000
+++ llvm-toolchain-6.0-6.0.1/debian/patches/hurd-lib_Support_Unix_Path.inc.diff 2018-10-16 20:16:49.000000000 +0000
@@ -0,0 +1,52 @@
+Index: llvm-toolchain-6.0-6.0.1/lib/Support/Unix/Path.inc
+===================================================================
+--- llvm-toolchain-6.0-6.0.1.orig/lib/Support/Unix/Path.inc
++++ llvm-toolchain-6.0-6.0.1/lib/Support/Unix/Path.inc
+@@ -98,7 +98,7 @@
+ #define STATVFS_F_FRSIZE(vfs) static_cast<uint64_t>(vfs.f_bsize)
+ #endif
+
+-#if defined(__NetBSD__)
++#if defined(__NetBSD__) || defined(__GNU__)
+ #define STATVFS_F_FLAG(vfs) (vfs).f_flag
+ #else
+ #define STATVFS_F_FLAG(vfs) (vfs).f_flags
+@@ -111,7 +111,7 @@ namespace sys {
+ namespace fs {
+ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
+ defined(__minix) || defined(__FreeBSD_kernel__) || defined(__linux__) || \
+- defined(__CYGWIN__) || defined(__DragonFly__) || defined(_AIX)
++ defined(__CYGWIN__) || defined(__DragonFly__) || defined(_AIX) || defined(__GNU__)
+ static int
+ test_dir(char ret[PATH_MAX], const char *dir, const char *bin)
+ {
+@@ -187,7 +187,7 @@ std::string getMainExecutable(const char
+
+ if (getprogpath(exe_path, argv0) != NULL)
+ return exe_path;
+-#elif defined(__linux__) || defined(__CYGWIN__)
++#elif defined(__linux__) || defined(__CYGWIN__) || defined(__GNU__)
+ char exe_path[MAXPATHLEN];
+ StringRef aPath("/proc/self/exe");
+ if (sys::fs::exists(aPath)) {
+@@ -360,7 +360,7 @@ std::error_code remove(const Twine &path
+ }
+
+ static bool is_local_impl(struct STATVFS &Vfs) {
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__GNU__)
+ #ifndef NFS_SUPER_MAGIC
+ #define NFS_SUPER_MAGIC 0x6969
+ #endif
+@@ -370,7 +370,11 @@ static bool is_local_impl(struct STATVFS
+ #ifndef CIFS_MAGIC_NUMBER
+ #define CIFS_MAGIC_NUMBER 0xFF534D42
+ #endif
++#ifdef __GNU__
++ switch ((uint32_t)Vfs.__f_type) {
++#else
+ switch ((uint32_t)Vfs.f_type) {
++#endif
+ case NFS_SUPER_MAGIC:
+ case SMB_SUPER_MAGIC:
+ case CIFS_MAGIC_NUMBER:
diff -Nru llvm-toolchain-6.0-6.0.1/debian/patches/hurd-pathmax.diff llvm-toolchain-6.0-6.0.1/debian/patches/hurd-pathmax.diff
--- llvm-toolchain-6.0-6.0.1/debian/patches/hurd-pathmax.diff 2018-09-14 07:24:02.000000000 +0000
+++ llvm-toolchain-6.0-6.0.1/debian/patches/hurd-pathmax.diff 2018-10-16 20:18:39.000000000 +0000
@@ -75,3 +75,19 @@
/* Open the host .cu file and the kernel .hu and .cu files for writing.
* Add the necessary includes.
*/
+Index: llvm-toolchain-6.0-6.0.1/clang/lib/Frontend/ModuleDependencyCollector.cpp
+===================================================================
+--- llvm-toolchain-6.0-6.0.1.orig/clang/lib/Frontend/ModuleDependencyCollector.cpp
++++ llvm-toolchain-6.0-6.0.1/clang/lib/Frontend/ModuleDependencyCollector.cpp
+@@ -97,6 +97,11 @@ struct ModuleDependencyMMCallbacks : pub
+
+ }
+
++// For GNU Hurd
++#if defined(__GNU__) && !defined(PATH_MAX)
++# define PATH_MAX 4096
++#endif
++
+ // TODO: move this to Support/Path.h and check for HAVE_REALPATH?
+ static bool real_path(StringRef SrcPath, SmallVectorImpl<char> &RealPath) {
+ #ifdef LLVM_ON_UNIX
diff -Nru llvm-toolchain-6.0-6.0.1/debian/patches/hurd-tools_llvm-shlib_CMakeLists.txt.diff llvm-toolchain-6.0-6.0.1/debian/patches/hurd-tools_llvm-shlib_CMakeLists.txt.diff
--- llvm-toolchain-6.0-6.0.1/debian/patches/hurd-tools_llvm-shlib_CMakeLists.txt.diff 1970-01-01 00:00:00.000000000 +0000
+++ llvm-toolchain-6.0-6.0.1/debian/patches/hurd-tools_llvm-shlib_CMakeLists.txt.diff 2018-10-16 20:16:49.000000000 +0000
@@ -0,0 +1,12 @@
+Index: llvm-toolchain-6.0-6.0.1/tools/llvm-shlib/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-6.0-6.0.1.orig/tools/llvm-shlib/CMakeLists.txt
++++ llvm-toolchain-6.0-6.0.1/tools/llvm-shlib/CMakeLists.txt
+@@ -40,6 +40,7 @@ set_property(TARGET LLVM PROPERTY VERSIO
+ list(REMOVE_DUPLICATES LIB_NAMES)
+ if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
+ OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
++ OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
+ OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
+ OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")) # FIXME: It should be "GNU ld for elf"
+ configure_file(
diff -Nru llvm-toolchain-6.0-6.0.1/debian/patches/series llvm-toolchain-6.0-6.0.1/debian/patches/series
--- llvm-toolchain-6.0-6.0.1/debian/patches/series 2018-09-14 07:24:02.000000000 +0000
+++ llvm-toolchain-6.0-6.0.1/debian/patches/series 2018-10-16 20:18:39.000000000 +0000
@@ -68,3 +68,5 @@
rL338481-cherry-pick-really-subtle-miscompile.diff
disable-sse2-old-x86.diff
powerpcspe-add-missing-include-path.diff
+hurd-lib_Support_Unix_Path.inc.diff
+hurd-tools_llvm-shlib_CMakeLists.txt.diff
diff -Nru llvm-toolchain-6.0-6.0.1/debian/rules llvm-toolchain-6.0-6.0.1/debian/rules
--- llvm-toolchain-6.0-6.0.1/debian/rules 2018-09-14 07:24:02.000000000 +0000
+++ llvm-toolchain-6.0-6.0.1/debian/rules 2018-10-16 20:18:39.000000000 +0000
@@ -84,7 +84,7 @@
control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev'
endif
-BINUTILS_GOLD_ARCHS := amd64 arm64 armhf i386 ppc64 ppc64el sparc sparc64 x32 s390x
+BINUTILS_GOLD_ARCHS := amd64 arm64 armhf i386 ppc64 ppc64el sparc sparc64 x32 s390x hurd-i386
ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' binutils) ge 2.23.1-1~exp3 ; echo $$?),0)
ifneq (,$(filter $(DEB_HOST_ARCH),$(BINUTILS_GOLD_ARCHS)))
# -fused-ld=gold enables the gold linker (but is not supported by all archs / distro)
More information about the Pkg-llvm-team
mailing list