Bug#437470: gcj-4.2: FTBFS on GNU/Hurd
Samuel Thibault, le Mon 13 Aug 2007 10:54:41 +0200, a écrit :
> Samuel Thibault, le Mon 13 Aug 2007 10:51:30 +0200, a écrit :
> > Here is the patch to apply to the gcc-4.2 svn repository for fixing
> > the build on GNU/Hurd.
>
> Oops, I hadn't noticed that you had dropped libjava-maxhostnamelen. Here
> is a patch against revision 2343.
Ah, no, that's because you re-updated from the ubuntu branch, which now
has the fix. Sorry for the spam, here is a third patch..
Samuel
Index: debian/rules.patch
===================================================================
--- debian/rules.patch (révision 2343)
+++ debian/rules.patch (copie de travail)
@@ -165,6 +165,9 @@
ifeq ($(DEB_TARGET_ARCH_OS),netbsd)
debian_patches += # netbsd-all-gcc netbsd-archs-gcc
endif
+ifeq ($(DEB_TARGET_ARCH_OS),hurd)
+ debian_patches += libjava-hurdfix
+endif
ifdef DEB_CROSS
debian_patches += cross-include cross-fixes
Index: debian/patches/hurd-changes.dpatch
===================================================================
--- debian/patches/hurd-changes.dpatch (révision 2343)
+++ debian/patches/hurd-changes.dpatch (copie de travail)
@@ -88,3 +88,14 @@
/* Defined in the automatically-generated underscore.c. */
extern int prepends_underscore;
+--- boehm-gc/dyn_load.c.orig 2007-08-13 09:10:48.215678000 +0200
++++ boehm-gc/dyn_load.c 2007-08-13 09:11:09.743969000 +0200
+@@ -26,7 +26,7 @@
+ * None of this is safe with dlclose and incremental collection.
+ * But then not much of anything is safe in the presence of dlclose.
+ */
+-#if (defined(__linux__) || defined(__GLIBC__)) && !defined(_GNU_SOURCE)
++#if (defined(__linux__) || defined(__GLIBC__) || defined(__GNU__)) && !defined(_GNU_SOURCE)
+ /* Can't test LINUX, since this must be define before other includes */
+ # define _GNU_SOURCE
+ #endif
Index: debian/patches/libjava-hurdfix.dpatch
===================================================================
--- debian/patches/libjava-hurdfix.dpatch (révision 0)
+++ debian/patches/libjava-hurdfix.dpatch (révision 0)
@@ -0,0 +1,136 @@
+#! /bin/sh -e
+
+# Description: java support for GNU/Hurd
+# Author: Robert Millan, Petr Salinger, Samuel Thibault
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p1 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+diff -ur gcj-4.1.1/libjava/libltdl/acinclude.m4 gcj-4.1.1/libjava/libltdl/acinclude.m4
+--- gcj-4.1.1/libjava/libltdl/acinclude.m4 2006-05-12 13:35:07.000000000 +0200
++++ gcj-4.1.1/libjava/libltdl/acinclude.m4 2006-05-12 11:07:03.000000000 +0200
+@@ -1413,7 +1413,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+diff -ur gcj-4.1.1/libjava/libltdl/configure gcj-4.1.1/libjava/libltdl/configure
+--- gcj-4.1.1/libjava/libltdl/configure 2006-05-12 13:35:21.000000000 +0200
++++ gcj-4.1.1/libjava/libltdl/configure 2006-05-12 11:07:15.000000000 +0200
+@@ -8380,7 +8380,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+@@ -12021,7 +12021,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+@@ -15097,7 +15097,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+@@ -17380,7 +17380,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+diff -ur gcj-4.1.1/libjava/configure.host gcj-4.1.1/libjava/configure.host
+--- gcj-4.1.1/libjava/configure.host 2006-09-07 01:00:37.000000000 +0200
++++ gcj-4.1.1/libjava/configure.host 2006-09-07 01:00:37.000000000 +0200
+@@ -326,7 +326,7 @@
+ esac
+
+ case "${host}" in
+- *linux*|*-kfreebsd*-gnu)
++ *linux*|*-kfreebsd*-gnu|*gnu*)
+ use_libgcj_bc=yes
+ ;;
+ *)
+Index: gcc-4.1.1/libjava/java/lang/natPosixProcess.cc
+===================================================================
+--- gcc-4.1.1/libjava/java/lang/natPosixProcess.cc (révision 127274)
++++ gcc-4.1.1/libjava/java/lang/natPosixProcess.cc (copie de travail)
+@@ -110,7 +110,11 @@
+ // sigwait() on SIGCHLD. The information passed is ignored as it
+ // will be recovered by the waitpid() call.
+ static void
++#ifdef SA_SIGINFO
+ sigchld_handler (int sig, siginfo_t *si, void *third)
++#else
++sigchld_handler (int sig)
++#endif
+ {
+ if (PosixProcess$ProcessManager::nativeData != NULL)
+ {
+@@ -121,9 +125,11 @@
+ if (pmi->old_sigaction.sa_handler != SIG_DFL
+ && pmi->old_sigaction.sa_handler != SIG_IGN)
+ {
++#ifdef SA_SIGINFO
+ if ((pmi->old_sigaction.sa_flags & SA_SIGINFO) != 0)
+ pmi->old_sigaction.sa_sigaction(sig, si, third);
+ else
++#endif
+ (*pmi->old_sigaction.sa_handler)(sig);
+ }
+ }
+@@ -156,9 +162,15 @@
+ struct sigaction sa;
+ memset (&sa, 0, sizeof (sa));
+
++#ifdef SA_SIGINFO
+ sa.sa_sigaction = sigchld_handler;
+ // We only want signals when the things exit.
+ sa.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
++#else
++ sa.sa_handler = sigchld_handler;
++ // We only want signals when the things exit.
++ sa.sa_flags = SA_NOCLDSTOP;
++#endif
+
+ if (-1 == sigaction (SIGCHLD, &sa, &pmi->old_sigaction))
+ goto error;
Index: debian/rules.defs
===================================================================
--- debian/rules.defs (révision 2343)
+++ debian/rules.defs (copie de travail)
@@ -323,7 +323,7 @@
java_no_cpus := #mips mipsel
java_no_arches :=
java_plugin_no_cpus := armel arm m68k mips mipsel
-java_no_systems := hurd-i386 knetbsd-gnu netbsdelf-gnu
+java_no_systems := knetbsd-gnu netbsdelf-gnu
gcj_native_archs = alpha amd64 i386 ia64 m68k mips mipsel powerpc s390 sparc
ifneq (, $(filter $(DEB_TARGET_ARCH_CPU),$(java_no_cpus)))
@@ -338,10 +338,6 @@
ifneq (, $(filter $(DEB_TARGET_ARCH),$(java_plugin_no_cpus)))
with_java_plugin := disabled for $(DEB_TARGET_ARCH)
endif
-ifeq ($(DEB_TARGET_ARCH),hurd-i386)
- java_no_systems += hurd-i386
- with_java := disabled for architecure $(DEB_TARGET_ARCH_CPU)
-endif
ifdef DEB_CROSS
with_java := disabled for cross compiler package
endif
@@ -376,7 +372,7 @@
ifeq ($(with_java),yes)
with_java_alsa := yes
- ifneq (,$(filter $(DEB_TARGET_GNU_SYSTEM), kfreebsd-gnu))
+ ifneq (,$(filter $(DEB_TARGET_GNU_SYSTEM), kfreebsd-gnu gnu))
with_java_alsa := no
endif
endif
Index: debian/changelog
===================================================================
--- debian/changelog (révision 2343)
+++ debian/changelog (copie de travail)
@@ -11,6 +11,7 @@
directives, but do not expand macros).
* Report an ICE to apport (if apport is available and the environment
variable GCC_NOAPPORT is not set)
+ * Fix gcj build failure on the Hurd (Samuel Thibault). Closes: #408888.
-- Matthias Klose <doko@debian.org> Sun, 12 Aug 2007 21:11:00 +0200
Index: debian/rules.conf
===================================================================
--- debian/rules.conf (révision 2343)
+++ debian/rules.conf (copie de travail)
@@ -488,7 +488,7 @@
ada_no_archs := $(strip $(foreach cpu,$(ada_no_cpus),!$(cpu)) \
!kfreebsd-amd64 !knetbsd-i386 !netbsd-i386 !hurd-i386)
java_no_archs := $(strip $(foreach cpu,$(java_no_cpus),!$(cpu)) \
- !knetbsd-i386 !netbsd-i386 !hurd-i386)
+ !knetbsd-i386 !netbsd-i386)
java_plugin_no_archs := $(strip $(foreach cpu,$(java_plugin_no_cpus),!$(cpu)) \
!knetbsd-i386 !netbsd-i386 !hurd-i386)
pascal_no_archs := $(strip $(foreach cpu,$(pascal_no_cpus),!$(cpu)) \
Reply to: