OSDN Git Service

PR bootstrap/37739
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Dec 2008 14:55:42 +0000 (14:55 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Dec 2008 14:55:42 +0000 (14:55 +0000)
* config.host: For powerpc*-*-linux* host with 32-bit GCC,
use rs6000/x-linux-relax snippet if ld is new enough,
otherwise use rs6000/x-linux-O1.
* config/rs6000/x-linux-relax: New file.
* config/x-cflags-O1: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142833 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config.host
gcc/config/rs6000/x-linux-relax [new file with mode: 0644]
gcc/config/x-cflags-O1 [new file with mode: 0644]

index add2497..8575c25 100644 (file)
@@ -1,3 +1,12 @@
+2008-12-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR bootstrap/37739
+       * config.host: For powerpc*-*-linux* host with 32-bit GCC,
+       use rs6000/x-linux-relax snippet if ld is new enough,
+       otherwise use rs6000/x-linux-O1.
+       * config/rs6000/x-linux-relax: New file.
+       * config/x-cflags-O1: New file.
+
 2008-12-18  Joseph Myers  <joseph@codesourcery.com>
 
        * config/rs6000/rs6000.c (rs6000_generate_compare): Condition
index 2cfcd6b..939cc15 100644 (file)
@@ -124,6 +124,27 @@ case ${host} in
         host_xmake_file="${host_xmake_file} rs6000/x-rs6000"
         ;;
     esac
+    case ${host} in
+      *-*-linux* )
+       if test "${GCC}:${ac_cv_sizeof_long}" = yes:4; then
+         # On powerpc*-*-linux* use -Wl,--relax to link cc1,
+         # if ld is new enough, otherwise force -O1 in CFLAGS.
+         host_ppc_relax_xmake_file=
+         host_ld_ver=`${CC} -Wl,--version 2>/dev/null | sed 1q`
+         if echo "$host_ld_ver" | grep GNU > /dev/null; then
+           host_ld_date=`echo $host_ld_ver \
+                         | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
+           if test 0"$host_ld_date" -gt 20080806; then
+             host_ppc_relax_xmake_file=rs6000/x-linux-relax
+           fi
+         fi
+         if test -z "${host_ppc_relax_xmake_file}"; then
+           host_ppc_relax_xmake_file=x-cflags-O1
+         fi
+         host_xmake_file="${host_xmake_file} ${host_ppc_relax_xmake_file}"
+       fi
+       ;;
+    esac
     ;;
 esac
 
diff --git a/gcc/config/rs6000/x-linux-relax b/gcc/config/rs6000/x-linux-relax
new file mode 100644 (file)
index 0000000..2743a94
--- /dev/null
@@ -0,0 +1,2 @@
+# At -O0 cc1 etc. are too large and -Wl,--relax is needed
+$(COMPILERS) : override LDFLAGS += -Wl,--relax
diff --git a/gcc/config/x-cflags-O1 b/gcc/config/x-cflags-O1
new file mode 100644 (file)
index 0000000..9ba1e74
--- /dev/null
@@ -0,0 +1,5 @@
+# At -O0 cc1 etc. are too large on some targets for successful
+# link; force building libbackend.a with -O1.
+ifeq ($(filter-out -O0,$(lastword $(filter -O%,$(CFLAGS)))),)
+$(OBJS) : override CFLAGS += -O1
+endif