Bug#301208: gcc-4.0: FTBFS (ppc64): Please add support for the ppc64 architecture
Package: gcc-4.0
Severity: wishlist
Tags: patch
Please add support for the ppc64 architecture to 'gcc-4.0'.
The changes from the attached patch have been used
by the ppc64 archive on alioth since December 2004.
The patch basically uses the same approach as the amd64 port
to create a gcc with multilib support.
Regards
Andreas Jochens
Change summary:
* debian/control.m4
- Add libc6-dev-powerpc [ppc64] to the Build-Depends.
- Change the Description for lib32gcc1: s/ia32/32 bit Version/
- Change the Depends for lib32gcc1 from 'ia32-libs' to '${shlibs:Depends}'.
- Remove "Replaces: ia32-libs.openoffice.org (<< 1ubuntu3)" for lib32gcc1.
* debian/rules.defs
- Define 'biarch_ia32' for ppc64 to use the same 32 bit multilib
facilities as amd64. (Probably 'biarch_ia32' should be renamed
to something like 'biarch32'.)
* debian/rules.d/binary-gcc.mk
- Correct an error in the 'files_gcc' definition for biarch_ia32
(replace '64' by '32').
* debian/rules2
- Do not use '--disable-multilib' on powerpc64-linux.
Use '--disable-nof --disable-softfloat' instead.
* debian/rules.d/binary-libstdcxx.mk
- Put the 32 bit libstdc++ files in '/usr/lib32'.
* debian/rules.patch
- Apply 'ppc64-biarch' patch on ppc64.
* debian/patches/ppc64-biarch.dpatch
- MULTILIB_OSDIRNAMES: Use /lib for native 64 bit libraries and
/lib32 for 32 bit libraries.
- Add multilib handling to src/config-ml.in (taken from amd64-biarch.dpatch).
diff -urN ../tmp-orig/gcc-4.0-4.0ds8/debian/control ./debian/control
--- ../tmp-orig/gcc-4.0-4.0ds8/debian/control 2005-03-24 09:28:32.245097672 +0100
+++ ./debian/control 2005-03-24 09:31:26.937816920 +0100
@@ -4,7 +4,7 @@
Maintainer: Debian GCC maintainers <debian-gcc@lists.debian.org>
Uploaders: Matthias Klose <doko@debian.org>
Standards-Version: 3.6.1
-Build-Depends: libc6.1-dev (>= 2.3.2.ds1-19) [alpha ia64] | libc0.3-dev (>= 2.3.2.ds1-19) | libc0.1-dev | libc12-dev (>= 2.3.2.ds1-19) | libc6-dev (>= 2.3.2.ds1-19), libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390], amd64-libs-dev [i386], ia32-libs-dev [amd64], libunwind7-dev [ia64], m4, autoconf, automake1.9, libtool, autogen, gawk, dejagnu (>= 1.4.3) [!hurd-i386], expect (>= 5.38.0) [!hurd-i386], bzip2, binutils (>= 2.15-5) | binutils-multiarch (>= 2.15-5), binutils-hppa64 [hppa], debhelper (>= 4.1), gperf (>= 2.7-3), bison (>= 1:1.875a-1), flex, gettext, texinfo (>= 4.3), zlib1g-dev, libgc-dev [!knetbsd-i386], xlibs-dev, gnat-3.3 [!alpha !arm !ia64 !m68k !kfreebsd-i386 !knetbsd-i386 !netbsd-i386] | gnat-3.4 [!alpha !arm !ia64 !m68k !kfreebsd-i386 !knetbsd-i386 !netbsd-i386], libncurses5-dev [!netbsd-i386], libmpfr-dev, tetex-bin [!netbsd-i386], locales [!hurd-i386 !knetbsd-i386 !netbsd-i386], procps [alpha arm hppa i386 ia64 m68k mips mipsel powerpc s390 s390x sh3 sh3eb sh4 sh4e
b sparc sparc64 amd64], help2man [!netbsd-i386], sharutils, libgtk2.0-dev [!mips !mipsel !knetbsd-i386 !netbsd-i386], libart-2.0-dev [!mips !mipsel !knetbsd-i386 !netbsd-i386], libcairo1-dev (>= 0.3.0) [!mips !mipsel !knetbsd-i386 !netbsd-i386], realpath (>= 1.9.12), chrpath, lsb-release
+Build-Depends: libc6.1-dev (>= 2.3.2.ds1-19) [alpha ia64] | libc0.3-dev (>= 2.3.2.ds1-19) | libc0.1-dev | libc12-dev (>= 2.3.2.ds1-19) | libc6-dev (>= 2.3.2.ds1-19), libc6-dev-powerpc [ppc64], libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390], amd64-libs-dev [i386], ia32-libs-dev [amd64], libunwind7-dev [ia64], m4, autoconf, automake1.9, libtool, autogen, gawk, dejagnu (>= 1.4.3) [!hppa !hurd-i386], expect (>= 5.38.0) [!hppa !hurd-i386], bzip2, binutils (>= 2.15-5) | binutils-multiarch (>= 2.15-5), binutils-hppa64 [hppa], debhelper (>= 4.1), gperf (>= 2.7-3), bison (>= 1:1.875a-1), flex, gettext, texinfo (>= 4.3), zlib1g-dev, libgc-dev [!knetbsd-i386], xlibs-dev, gnat-3.3 [!alpha !arm !ia64 !m68k !ppc64 !kfreebsd-i386 !knetbsd-i386 !netbsd-i386] | gnat-3.4 [!alpha !arm !ia64 !m68k !ppc64 !kfreebsd-i386 !knetbsd-i386 !netbsd-i386], libncurses5-dev [!netbsd-i386], libmpfr-dev, tetex-bin [!netbsd-i386], locales [!hurd-i386 !knetbsd-i386 !netbsd-i386], procps [!darwin-i386 !freebsd-i386
!hurd-i386 !kfreebsd-i386 !knetbsd-i386 !netbsd-i386 !openbsd-i386 !darwin-powerpc], help2man [!netbsd-i386], sharutils, libgtk2.0-dev [!mips !mipsel !knetbsd-i386 !netbsd-i386], libart-2.0-dev [!mips !mipsel !knetbsd-i386 !netbsd-i386], libcairo1-dev (>= 0.3.0) [!mips !mipsel !knetbsd-i386 !netbsd-i386], realpath (>= 1.9.12), chrpath, lsb-release
Build-Depends-Indep: doxygen (>= 1.3.7), graphviz
Package: gcc-4.0-base
diff -urN ../tmp-orig/gcc-4.0-4.0ds8/debian/control.m4 ./debian/control.m4
--- ../tmp-orig/gcc-4.0-4.0ds8/debian/control.m4 2005-03-24 09:28:32.520914486 +0100
+++ ./debian/control.m4 2005-03-24 09:31:26.939815592 +0100
@@ -33,7 +33,7 @@
ifdef(`TARGET',`dnl cross
Build-Depends: LIBC_BUILD_DEP, m4, autoconf, automake1.9, libtool, autotools-dev, autogen, gawk, bzip2, dpkg-cross (>= 1.18.1), BINUTILS_BUILD_DEP, debhelper (>= 4.1), bison (>= 1:1.875a-1) | bison (<< 1:1.50), flex, realpath (>= 1.9.12)`'TARGETBD
',`dnl native
-Build-Depends: LIBC_BUILD_DEP, libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390], amd64-libs-dev [i386], ia32-libs-dev [amd64], libunwind7-dev [ia64], m4, autoconf, automake1.9, libtool, autogen, gawk, dejagnu (>= 1.4.3) [check_no_archs], expect (>= 5.38.0) [check_no_archs], bzip2, BINUTILS_BUILD_DEP, binutils-hppa64 [hppa], debhelper (>= 4.1), gperf (>= 2.7-3), bison (>= 1:1.875a-1), flex, gettext, texinfo (>= 4.3), zlib1g-dev, libgc-dev [libgc_no_archs], xlibs-dev, gnat-3.3 [ada_no_archs] | gnat-3.4 [ada_no_archs], libncurses5-dev [pascal_no_archs], libmpfr-dev, tetex-bin [pascal_no_archs], locales [locale_no_archs], procps [linux_gnu_archs], help2man [pascal_no_archs], sharutils, libgtk2.0-dev [java_no_archs], libart-2.0-dev [java_no_archs], libcairo1-dev (>= 0.3.0) [java_no_archs], realpath (>= 1.9.12), chrpath, lsb-release
+Build-Depends: LIBC_BUILD_DEP, libc6-dev-powerpc [ppc64], libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390], amd64-libs-dev [i386], ia32-libs-dev [amd64], libunwind7-dev [ia64], m4, autoconf, automake1.9, libtool, autogen, gawk, dejagnu (>= 1.4.3) [check_no_archs], expect (>= 5.38.0) [check_no_archs], bzip2, BINUTILS_BUILD_DEP, binutils-hppa64 [hppa], debhelper (>= 4.1), gperf (>= 2.7-3), bison (>= 1:1.875a-1), flex, gettext, texinfo (>= 4.3), zlib1g-dev, libgc-dev [libgc_no_archs], xlibs-dev, gnat-3.3 [ada_no_archs] | gnat-3.4 [ada_no_archs], libncurses5-dev [pascal_no_archs], libmpfr-dev, tetex-bin [pascal_no_archs], locales [locale_no_archs], procps [linux_gnu_archs], help2man [pascal_no_archs], sharutils, libgtk2.0-dev [java_no_archs], libart-2.0-dev [java_no_archs], libcairo1-dev (>= 0.3.0) [java_no_archs], realpath (>= 1.9.12), chrpath, lsb-release
Build-Depends-Indep: doxygen (>= 1.3.7), graphviz
')dnl
@@ -109,9 +109,8 @@
Architecture: any
Section: libs
Priority: optional
-Depends: ia32-libs (>= 0.5ubuntu2)
-Replaces: ia32-libs.openoffice.org (<< 1ubuntu3)
-Description: GCC support library (ia32)
+Depends: ${shlibs:Depends}
+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.
@@ -533,7 +532,7 @@
Section: ifdef(`TARGET',`devel',`libs')
Priority: ifdef(`TARGET',`extra',PRI(optional))
Depends: gcc`'PV-base (>= CV), lib32gcc`'GCC_SO`'LS
-Description: The GNU Standard C++ Library v3 (ia32)
+Description: The GNU Standard C++ Library v3 (32 bit Version)
This package contains an additional runtime library for C++ programs
built with the GNU compiler.
ifdef(`TARGET', `dnl
@@ -641,7 +640,7 @@
Package: gnat`'-GNAT_V
Architecture: any
Priority: PRI(optional)
-Depends: gcc`'PV-base (>= CV), ${shlibs:Depends}, gcc`'PV (>= CV), gcc`'PV (<< NV)
+Depends: gcc`'PV-base (>= CV), ${shlibs:Depends}, libgnat`'PV (>= CV), gcc`'PV (>= CV), gcc`'PV (<< NV)
Suggests: gnat`'PV-doc, ada-reference-manual
Provides: ada-compiler
Conflicts: gnat, gnat-3.1, gnat-3.2, gnat-3.3, gnat-3.4, gnat-3.5
diff -urN ../tmp-orig/gcc-4.0-4.0ds8/debian/rules.d/binary-gcc.mk ./debian/rules.d/binary-gcc.mk
--- ../tmp-orig/gcc-4.0-4.0ds8/debian/rules.d/binary-gcc.mk 2005-03-24 09:28:32.301060504 +0100
+++ ./debian/rules.d/binary-gcc.mk 2005-03-24 09:31:26.942813601 +0100
@@ -39,7 +39,7 @@
files_gcc += $(gcc_lib_dir)/64/{libgcc*,libgcov.a,*.o}
endif
ifeq ($(biarch_ia32),yes)
- files_gcc += $(gcc_lib_dir)/64/{libgcc*,*.o}
+ files_gcc += $(gcc_lib_dir)/32/{libgcc*,*.o}
endif
ifeq ($(DEB_HOST_ARCH),ia64)
diff -urN ../tmp-orig/gcc-4.0-4.0ds8/debian/rules.defs ./debian/rules.defs
--- ../tmp-orig/gcc-4.0-4.0ds8/debian/rules.defs 2005-03-24 09:28:32.470947672 +0100
+++ ./debian/rules.defs 2005-03-24 09:31:26.945811610 +0100
@@ -571,7 +571,7 @@
#with_lib64gcj := yes
endif
-ifeq ($(DEB_TARGET_ARCH),amd64)
+ifeq ($(DEB_TARGET_ARCH),$(findstring $(DEB_TARGET_ARCH),amd64 ppc64))
biarch_ia32 := yes
endif
#ifeq ($(DEB_TARGET_ARCH),ia64)
diff -urN ../tmp-orig/gcc-4.0-4.0ds8/debian/rules.d/binary-libstdcxx.mk ./debian/rules.d/binary-libstdcxx.mk
--- ../tmp-orig/gcc-4.0-4.0ds8/debian/rules.d/binary-libstdcxx.mk 2005-03-24 09:28:32.294065150 +0100
+++ ./debian/rules.d/binary-libstdcxx.mk 2005-03-24 09:31:26.943812937 +0100
@@ -235,17 +235,10 @@
dh_installdirs -p$(p_lib32) \
$(docdir)/$(p_lib32)
-ifeq ($(distribution),Debian)
- dh_installdirs -p$(p_lib32) \
- emul/ia32-linux/usr/lib
- mv $(d)/$(PF)/lib32/libstdc++.so.* \
- $(d_lib32)/emul/ia32-linux/usr/lib/.
-else
dh_installdirs -p$(p_lib32) \
usr/lib32
mv $(d)/$(PF)/lib32/libstdc++.so.* \
$(d_lib32)/usr/lib32/.
-endif
dh_installdocs -p$(p_lib32)
echo "See /$(docdir)/$(p_base) for more information" \
diff -urN ../tmp-orig/gcc-4.0-4.0ds8/debian/rules2 ./debian/rules2
--- ../tmp-orig/gcc-4.0-4.0ds8/debian/rules2 2005-03-24 09:28:32.478942362 +0100
+++ ./debian/rules2 2005-03-24 09:32:37.046780743 +0100
@@ -146,7 +146,7 @@
ifeq ($(biarch),yes)
CONFARGS += --disable-nof --disable-softfloat --with-cpu=default32
else
- CONFARGS += --disable-multilib
+ CONFARGS += --disable-nof --disable-softfloat
endif
endif
diff -urN ../tmp-orig/gcc-4.0-4.0ds8/debian/rules.patch ./debian/rules.patch
--- ../tmp-orig/gcc-4.0-4.0ds8/debian/rules.patch 2005-03-24 09:28:32.480941034 +0100
+++ ./debian/rules.patch 2005-03-24 09:31:26.945811610 +0100
@@ -67,6 +67,9 @@
ifeq ($(DEB_TARGET_ARCH),amd64)
debian_patches += amd64-biarch # amd64-multilib
endif
+ifeq ($(DEB_TARGET_ARCH),ppc64)
+ debian_patches += ppc64-biarch
+endif
ifeq ($(DEB_TARGET_GNU_CPU),alpha)
debian_patches += # alpha-ieee
diff -urN ../tmp-orig/gcc-4.0-4.0ds8/debian/patches/ppc64-biarch.dpatch ./debian/patches/ppc64-biarch.dpatch
--- ../tmp-orig/gcc-4.0-4.0ds8/debian/patches/ppc64-biarch.dpatch 1970-01-01 01:00:00.000000000 +0100
+++ ./debian/patches/ppc64-biarch.dpatch 2005-03-24 09:31:26.941814265 +0100
@@ -0,0 +1,132 @@
+#! /bin/sh -e
+
+# DP: biarch patches for 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-12-04 08:05:46.000000000 +0000
++++ src/gcc/config/rs6000/t-linux64 2004-12-04 08:07:52.180889736 +0000
+@@ -8,13 +8,10 @@
+
+ SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver
+
+-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_OSDIRNAMES = ../lib ../lib32
+-MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
+
+ # We want fine grained libraries, so use the new code to build the
+ # floating point emulation libraries.
+@@ -37,8 +34,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 tmp/config-ml.in src/config-ml.in
+--- tmp/config-ml.in 2004-11-09 08:07:29.000000000 +0000
++++ src/config-ml.in 2004-12-12 07:12:44.631147816 +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}"
Reply to: