Bug#326875: gcc-3.4: FTBFS (ppc64): Please support the ppc64 architecture
Package: gcc-3.4
Version: 3.4.4-8
Severity: wishlist
Tags: patch
Currently the 'gcc-3.4' package FTBFS on ppc64.
The attached patch fixes this by adding ppc64 biarch-support
and by disabling ada for ppc64.
Regards
Andreas Jochens
diff -urN ../tmp-orig/gcc-3.4-3.4.4/debian/control.m4 ./debian/control.m4
--- ../tmp-orig/gcc-3.4-3.4.4/debian/control.m4 2005-09-06 08:06:17.000000000 +0200
+++ ./debian/control.m4 2005-09-06 08:05:54.000000000 +0200
@@ -108,7 +108,7 @@
Depends: ${dep:libcbiarch}
Conflicts: ia32-libs-openoffice.org (<= 1ubuntu2)
Replaces: ia32-libs-openoffice.org (<= 1ubuntu2)
-Description: GCC support library (ia32)
+Description: GCC support library (32-bit version)
Shared version of the support library, a library of internal subroutines
that GCC uses to overcome shortcomings of particular machines, or
special needs for some languages.
diff -urN ../tmp-orig/gcc-3.4-3.4.4/debian/patches/ppc64-biarch.dpatch ./debian/patches/ppc64-biarch.dpatch
--- ../tmp-orig/gcc-3.4-3.4.4/debian/patches/ppc64-biarch.dpatch 1970-01-01 01:00:00.000000000 +0100
+++ ./debian/patches/ppc64-biarch.dpatch 2005-09-06 08:01:48.000000000 +0200
@@ -0,0 +1,131 @@
+#! /bin/sh -e
+
+# DP: biarch patches for powerpc/ppc64
+
+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 -urN tmp/gcc/config/rs6000/t-linux64 src/gcc/config/rs6000/t-linux64
+--- tmp/gcc/config/rs6000/t-linux64 2004-03-17 15:16:48.000000000 +0000
++++ src/gcc/config/rs6000/t-linux64 2004-11-22 07:56:52.681533760 +0000
+@@ -11,9 +11,9 @@
+-MULTILIB_OPTIONS = m64/m32 msoft-float
+-MULTILIB_DIRNAMES = 64 32 nof
++MULTILIB_OPTIONS = m64/m32
++MULTILIB_DIRNAMES = 64 32
+ MULTILIB_EXTRA_OPTS = fPIC mstrict-align
+-MULTILIB_EXCEPTIONS = m64/msoft-float
+-MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
+-MULTILIB_OSDIRNAMES = ../lib64 ../lib nof
+-MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
++#MULTILIB_EXCEPTIONS = m64/msoft-float
++#MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
++MULTILIB_OSDIRNAMES = ../lib ../lib32
++#MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
+
+ # We want fine grained libraries, so use the new code to build the
+@@ -37,8 +37,11 @@
+ mklibgcc: bispecs
+
+ bispecs: specs
+- if [ x`$(GCC_FOR_TARGET) -print-multi-os-directory` = x../lib ]; then \
++ touch f-test.c; \
++ $(GCC_FOR_TARGET) -c f-test.c -o f-test.o; \
++ if [ "x`file f-test.o | grep 64-bit`" = "x" ]; then \
+ sed -e '/cc1_options/{ n; s/$$/ %{m64:-mlong-double-128}/; }' < specs > $@; \
+ else \
+ sed -e '/cc1_options/{ n; s/$$/ %{!m32:-mlong-double-128}/; }' < specs > $@; \
+- fi
++ fi; \
++ rm f-test.c f-test.o;
+diff -urN tmp/libjava/configure.host src/libjava/configure.host
+--- tmp/libjava/configure.host 25 Nov 2004 03:46:56 -0000
++++ src/libjava/configure.host 15 Dec 2004 15:45:22 -0000
+@@ -123,10 +123,13 @@
+ powerpc64*-*)
+ sysdeps_dir=powerpc
+ libgcj_interpreter=yes
+- if [ x`$CC -print-multi-os-directory` = x../lib64 ]; then
++ touch f-test.c
++ $CC -c f-test.c -o f-test.o
++ if [ "x`file f-test.o | grep 32-bit`" = "x" ]; then
+ libgcj_flags="${libgcj_flags} -mminimal-toc"
+ fi
+ enable_hash_synchronization_default=yes
+ slow_pthread_self=yes
++ rm f-test.c f-test.o
+ ;;
+ powerpc*-*)
+diff -urN gcc-3.4.3/config-ml.in src/config-ml.in
+--- gcc-3.4.3/config-ml.in 2004-01-05 00:41:14.000000000 +0000
++++ src/config-ml.in 2004-12-10 18:59:35.651141848 +0000
+@@ -400,7 +400,47 @@
+ ;;
+ esac
+ ;;
+-powerpc*-*-* | rs6000*-*-*)
++powerpc64-*-*)
++ case " $multidirs " in
++ *" 32 "*)
++ # We will not be able to create libraries with -m32 if
++ # we cannot even link a trivial program. It usually
++ # indicates the 32bit libraries are missing.
++ if echo 'main() {}' > conftest.c &&
++ ${CC-gcc} -m32 conftest.c -o conftest; then
++ echo Enable only libstdc++.
++ old_multidirs="${multidirs}"
++ multidirs=""
++ for x in ${old_multidirs}; do
++ case "$x" in
++ *32* ) case ${ml_realsrcdir} in
++ *"libstdc++-v3" ) multidirs="${multidirs} ${x}" ;;
++ *"libf2c" ) multidirs="${multidirs} ${x}" ;;
++ *"libobjc" ) multidirs="${multidirs} ${x}" ;;
++ *"libiberty" ) multidirs="${multidirs} ${x}" ;;
++ *"zlib" ) multidirs="${multidirs} ${x}" ;;
++ *) : ;;
++ esac
++ ;;
++ *) multidirs="${multidirs} ${x}" ;;
++ esac
++ done
++ else
++ echo Could not link program with -m32, disabling it.
++ old_multidirs="${multidirs}"
++ multidirs=""
++ for x in ${old_multidirs}; do
++ case "$x" in
++ *m32* ) : ;;
++ *) multidirs="${multidirs} ${x}" ;;
++ esac
++ done
++ fi
++ rm -f conftest.c conftest
++ ;;
++ esac
++ ;;
++powerpc-*-* | rs6000*-*-*)
+ if [ x$enable_aix64 = xno ]
+ then
+ old_multidirs="${multidirs}"
diff -urN ../tmp-orig/gcc-3.4-3.4.4/debian/rules.defs ./debian/rules.defs
--- ../tmp-orig/gcc-3.4-3.4.4/debian/rules.defs 2005-09-06 08:06:17.000000000 +0200
+++ ./debian/rules.defs 2005-09-06 08:04:03.000000000 +0200
@@ -437,7 +437,7 @@
endif
with_libgnat := yes
-ada_no_cpus := arm m68k m32r
+ada_no_cpus := arm m68k m32r ppc64
ada_no_systems := hurd-i386 kfreebsd-gnu knetbsd-gnu netbsd-elf-gnu
ifeq ($(DEB_TARGET_ARCH_CPU), $(findstring $(DEB_TARGET_ARCH_CPU),$(ada_no_cpus)))
with_ada := disabled for architecure $(DEB_TARGET_ARCH_CPU)
diff -urN ../tmp-orig/gcc-3.4-3.4.4/debian/rules.patch ./debian/rules.patch
--- ../tmp-orig/gcc-3.4-3.4.4/debian/rules.patch 2005-09-06 08:06:17.000000000 +0200
+++ ./debian/rules.patch 2005-09-06 08:02:34.000000000 +0200
@@ -129,6 +129,9 @@
ifeq ($(DEB_TARGET_ARCH),amd64)
debian_patches += amd64-biarch # amd64-multilib
endif
+ ifeq ($(DEB_TARGET_ARCH),ppc64)
+ debian_patches += ppc64-biarch
+ endif
endif
ifeq ($(DEB_TARGET_ARCH_OS),kfreebsd)
Reply to: