This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Backport PR 19823 fix


GCC 3.4 also suffers from the gij executable heap problem. This patch backports the fix (PR 19823) to the GCC 3.4 branch.

Regards

Bryce


2005-02-22  Bryce McKinlay  <mckinlay@redhat.com>

        PR libgcj/19823
        * configure.host: Set gc_use_mmap on *-linux*.
        * configure.in: Define USE_MMAP if gc_use_mmap is set.
        * configure: Rebuilt.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/Attic/configure.in,v
retrieving revision 1.53.2.1
diff -u -r1.53.2.1 configure.in
--- configure.in	20 Jan 2004 15:15:48 -0000	1.53.2.1
+++ configure.in	22 Feb 2005 17:45:31 -0000
@@ -419,6 +419,10 @@
     esac ]
   fi)
 
+if test "${gc_use_mmap}" = "yes"; then
+  AC_DEFINE(USE_MMAP, 1, [use MMAP instead of sbrk to get new memory])
+fi
+
 if test -n "$with_cross_host" &&
    test x"$with_cross_host" != x"no"; then
   toolexecdir='$(exec_prefix)/$(target_alias)'
Index: configure.host
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/configure.host,v
retrieving revision 1.7
diff -u -r1.7 configure.host
--- configure.host	28 Jul 2003 04:18:20 -0000	1.7
+++ configure.host	22 Feb 2005 17:45:31 -0000
@@ -18,8 +18,11 @@
 
 # It sets the following shell variables:
 #   gc_cflags	Special CFLAGS to use when building
+#   gc_use_mmap  Set to "yes" on platforms where mmap should be used instead
+#		 of sbrk. This will define USE_MMAP.
 
 gc_cflags=""
+gc_use_mmap=
 
 # We should set -fexceptions if we are using gcc and might be used
 # inside something like gcj.  This is the zeroth approximation:
@@ -37,6 +40,12 @@
     esac
 fi
 
+case "${host}" in
+  *-linux*)
+    gc_use_mmap=yes
+    ;;
+esac
+
 case "${target_optspace}:${host}" in
   yes:*)
     gc_cflags="${gc_cflags} -Os"
Index: configure
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/configure,v
retrieving revision 1.66.2.1
diff -u -r1.66.2.1 configure
--- configure	18 May 2004 09:08:38 -0000	1.66.2.1
+++ configure	22 Feb 2005 17:45:32 -0000
@@ -3076,7 +3076,7 @@
 #
 # We don't set NO_EXECUTE_PERMISSION by default because gcj (and
 # anything else that creates trampolines in gc-allocated memory)
-# always needs exec permission.  The exception to this is IA-64 and
+# always needs exec permission.  The exceptions to this are IA-64 and
 # some variations of Power PC, where trampolines don't contain
 # executable code.
 #
@@ -3453,6 +3453,13 @@
 fi
 
 
+if test "${gc_use_mmap}" = "yes"; then
+  cat >> confdefs.h <<\EOF
+#define USE_MMAP 1
+EOF
+
+fi
+
 if test -n "$with_cross_host" &&
    test x"$with_cross_host" != x"no"; then
   toolexecdir='$(exec_prefix)/$(target_alias)'

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]