[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

gcc 3.3 java (and objective c?) fix for 2.6 arm kernels



Hi all,

FYI, the attached patch (to the debian sarge gcc-3.3 package) stops
binaries generated by gcj-3.3 from segfaulting at startup on 2.6 arm
kernels.  The underlying issue is one in libgc that has already been
fixed upstream, but gcc 3.3 includes its own copy of libgc and uses that
in libgcj instead of the version installed on the system.

Since gcc 3.3 is no longer maintained, and debian sid doesn't ship
gcj-3.3 anymore, it's not much use submitting bugs with either the gcc
or the debian project, but I _have_ filed a debian bug for the libgc
package (bugs.debian.org/335816) since this also affects a number of
other packages that depend on libgc.

Thanks for Vincent Sanders and Bill Gatliff for providing access to
little-endian ARM hardware for testing.

Before:

# cat hello.java
class hello {
	static public void main(String args[]) {
		System.out.println("blah!");
	}
}
# gcj-3.3 --main=hello -o hello-3.3 hello.java
# ./hello-3.3
Segmentation fault
# 

With new libgcj4:

# ./hello-3.3 
blah!
# 


cheers,
Lennert


--- gcc-3.3-3.3.5/debian/rules.patch.orig	2005-10-31 21:20:45.000000000 +0000
+++ gcc-3.3-3.3.5/debian/rules.patch	2005-10-31 21:21:16.000000000 +0000
@@ -93,10 +93,10 @@
   debian_patches += alpha-ieee
 endif
 ifeq ($(DEB_TARGET_ARCH),arm)
-  debian_patches += arm-tune arm-gotoff arm-ldm arm-pr22528
+  debian_patches += arm-tune arm-gotoff arm-ldm arm-pr22528 arm-libgc
 endif
 ifeq ($(DEB_TARGET_ARCH),armeb)
-  debian_patches += arm-tune arm-gotoff arm-ldm arm-pr22528 arm-bigendian
+  debian_patches += arm-tune arm-gotoff arm-ldm arm-pr22528 arm-libgc arm-bigendian
 endif
 ifneq (,$(findstring $(DEB_TARGET_ARCH),i386))
   debian_patches += cpu-default-i486
--- gcc-3.3-3.3.5/debian/patches/arm-libgc.dpatch.orig	2005-10-31 21:20:32.000000000 +0000
+++ gcc-3.3-3.3.5/debian/patches/arm-libgc.dpatch	2005-10-31 21:20:21.000000000 +0000
@@ -0,0 +1,34 @@
+#! /bin/sh -e
+
+src=gcc
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+    pdir="-d $3"
+    src=$3/gcc
+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 -p0 --fuzz 10 < $0
+        ;;
+    -unpatch)
+        patch $pdir -f --no-backup-if-mismatch -R -p0 --fuzz 10 < $0
+        ;;
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1
+esac
+exit 0
+
+--- boehm-gc/include/private/gcconfig.h.orig	2005-10-31 21:18:22.000000000 +0000
++++ boehm-gc/include/private/gcconfig.h	2005-10-31 21:18:58.000000000 +0000
+@@ -1568,7 +1568,7 @@
+ #   endif
+ #   ifdef LINUX
+ #       define OS_TYPE "LINUX"
+-#       define HEURISTIC1
++#       define LINUX_STACKBOTTOM
+ #       undef STACK_GRAN
+ #       define STACK_GRAN 0x10000000
+ #       define USE_GENERIC_PUSH_REGS



Reply to: