FSF gcc44. gcc45 and gcc46 issues

Jack Howarth howarth at bromo.med.uc.edu
Thu Jul 21 20:55:55 PDT 2011


   I don't really have to directly help with the gcc44, gcc45 and gcc46 packages as
I am overwhelmed with work with the clang transition for the new 10.7 tree in fink.
However there are a few issues you should be aware of with the FSF gcc builds on Lion.
First, upstream gmp 5.0.2 builds fine on clang but is still broken on llvm-gcc. The
patch I sent for gmp 5.0.2 got mangled in translation so that the gmp 5.0.2 configure
needs the additional correction for llvm-gcc...

--- gmp-5.0.2/configure.orig    2011-05-17 19:15:41.000000000 -0400
+++ gmp-5.0.2/configure 2011-05-17 19:16:00.000000000 -0400
@@ -26446,8 +26446,8 @@
 esac
 
 cat >conftest.c <<EOF
-extern const int foo;          /* Suppresses C++'s suppression of foo */
-const int foo = {1,2,3};
+extern const int foo[];                /* Suppresses C++'s suppression of foo */
+const int foo[] = {1,2,3};
 EOF
 echo "Test program:" >&5
 cat conftest.c >&5
--- gmp-5.0.2/acinclude.m4.orig 2011-05-17 19:03:09.000000000 -0400
+++ gmp-5.0.2/acinclude.m4      2011-05-17 19:03:43.000000000 -0400
@@ -1941,8 +1941,8 @@
 esac
 
 cat >conftest.c <<EOF
-extern const int foo[];                /* Suppresses C++'s suppression of foo */
-const int foo[] = {1,2,3};
+extern const int foo[[]];              /* Suppresses C++'s suppression of foo */
+const int foo[[]] = {1,2,3};
 EOF
 echo "Test program:" >&AC_FD_CC
 cat conftest.c >&AC_FD_CC

The original patch accidentally had single braces in gmp-5.0.2/acinclude.m4 which 
allowed the required braces to be chewed away by autoconf. Without change llvm-gcc
will create a broken gmp 5.0.2 build because of..

http://gmplib.org/list-archives/gmp-bugs/2011-May/002254.html
http://gmplib.org/list-archives/gmp-bugs/2011-May/002255.html
http://gmplib.org/list-archives/gmp-bugs/2011-May/002256.html

The FSF gcc releases require the same fix as Apple uses for their gcc-4.2 build. This is to
disable the use of -pie in the linker during the compiler bootstrap. Otherwise both pch
and gcj/ecj1 will be broken. Also the libgcj.spec required a change to insure that the
gcj compiler passed -Wl,-no_pie as well to avoid creating broken executables. These patches
have been backported to gcc-4_5-branch for the upcoming gcc 4.5.4 release but not for
gcc-4_4-branch yet. For gcc-4.4, you can use the patch below which is based roughly on the
gcc-4_5-branch backport. Fortunately the patches made it into gcc-4.6.1 before release so
that needs no changes for Lion.
                Jack

--- gcc-4.4.6/libjava/configure.orig    2011-06-28 23:23:46.000000000 -0400
+++ gcc-4.4.6/libjava/configure 2011-06-28 23:48:05.000000000 -0400
@@ -19167,9 +19167,12 @@
         SYSTEMSPEC="-lunicows $SYSTEMSPEC"
       fi
     ;;
-    *-*-darwin[912]*)
+    *-*-darwin9*)
       SYSTEMSPEC="-allow_stack_execute"
     ;;
+    *-*-darwin[12]*)
+      SYSTEMSPEC="-no_pie -allow_stack_execute"
+    ;;
     *)
       SYSTEMSPEC=
     ;;
--- gcc-4.4.6/libjava/configure.ac.orig 2011-06-28 23:23:46.000000000 -0400
+++ gcc-4.4.6/libjava/configure.ac      2011-06-28 23:48:05.000000000 -0400
@@ -853,9 +853,12 @@
         SYSTEMSPEC="-lunicows $SYSTEMSPEC"
       fi
     ;;
-    *-*-darwin[[912]]*)
+    *-*-darwin9*)
       SYSTEMSPEC="-allow_stack_execute"
     ;;
+    *-*-darwin[[12]]*)
+      SYSTEMSPEC="-no_pie -allow_stack_execute"
+    ;;
     *)
       SYSTEMSPEC=
     ;;
--- gcc-4.4.6/configure.orig    2010-10-02 07:40:32.000000000 -0400
+++ gcc-4.4.6/configure 2011-06-28 23:48:05.000000000 -0400
@@ -2882,6 +2882,9 @@
     tentative_cc="/usr/cygnus/progressive/bin/gcc"
     host_makefile_frag="config/mh-lynxrs6k"
     ;;
+  i[3456789]86-*-darwin* | x86_64-*-darwin*)
+    host_makefile_frag="config/mh-x86-darwin"
+    ;;
   powerpc-*-darwin*)
     host_makefile_frag="config/mh-ppc-darwin"
     ;;
--- gcc-4.4.6/configure.ac.orig 2010-10-02 07:40:32.000000000 -0400
+++ gcc-4.4.6/configure.ac      2011-06-28 23:48:05.000000000 -0400
@@ -1091,6 +1091,9 @@
     tentative_cc="/usr/cygnus/progressive/bin/gcc"
     host_makefile_frag="config/mh-lynxrs6k"
     ;;
+  i[[3456789]]86-*-darwin* | x86_64-*-darwin*)
+    host_makefile_frag="config/mh-x86-darwin"
+    ;;
   powerpc-*-darwin*)
     host_makefile_frag="config/mh-ppc-darwin"
     ;;
--- /dev/null   2011-06-28 23:50:27.000000000 -0400
+++ gcc-4.4.6/config/mh-x86-darwin      2011-06-28 23:48:05.000000000 -0400
@@ -0,0 +1,2 @@
+# Ensure we don't try and use -pie, as it is incompatible with pch.
+BOOT_LDFLAGS += `case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`



More information about the macports-dev mailing list