Hello,

attached is the latest update of the native ppc64 support patch.
This patch applies cleanly against the current glibc version 2.3.5-7.

Regards
Andreas Jochens


Summary of changes to enable native ppc64 support:

    * debian/control.in/main: Add Build-Depends on gcc-3.4 for ppc64.
        Add Build-Depends on 'libc6-dev-powerpc [ppc64]'.

    * debian/control.in/powerpc: New libc6-(dev-)powerpc packages for ppc64.

    * debian/patches/amd64-lib.dpatch: Enable this patch for ppc64.
        Add support to install 32-bit alternative glibc in (/usr)/lib32.

    * debian/sysdeps/ppc64.mk: Build settings for ppc64.

    * debian/rules.d/debhelper.mk: Add support for (/usr)/lib32.

    * debian/rules.d/control.mk: Add ppc64 to archs and threads_archs.
        Include new 'debian/control.in/powerpc' file.
diff -urN ../tmp-orig/glibc-2.3.5/debian/control ./debian/control
--- ../tmp-orig/glibc-2.3.5/debian/control      2005-10-16 07:18:27.000000000 
+0000
+++ ./debian/control    2005-10-16 07:11:38.000000000 +0000
@@ -1,7 +1,7 @@
 Source: glibc
 Section: libs
 Priority: required
-Build-Depends: gettext (>= 0.10.37-1), make (>= 3.80-1), dpkg-dev (>= 1.13.5), 
debianutils (>= 1.13.1), tar (>= 1.13.11), bzip2, texinfo (>= 4.0), 
linux-kernel-headers (>= 2.6.13+0rc3-2) [!hurd-i386], mig (>= 1.3-2) 
[hurd-i386], hurd-dev (>= 20020608-1) [hurd-i386], gnumach-dev [hurd-i386], 
texi2html, file, gcc-4.0 [!powerpc !m68k !hppa !hurd-i386], gcc-4.0 (>= 
4.0.1-5) [hppa], gcc-3.4 (>= 3.4.4-6) [powerpc], gcc-3.4 [m68k], gcc-3.3 
[hurd-i386], autoconf, binutils (>= 2.14.90.0.7-5), sed (>= 4.0.5-4), gawk, 
debhelper (>= 4.1.76), libc6-dev-amd64 [i386]
+Build-Depends: gettext (>= 0.10.37-1), make (>= 3.80-1), dpkg-dev (>= 1.13.5), 
debianutils (>= 1.13.1), tar (>= 1.13.11), bzip2, texinfo (>= 4.0), 
linux-kernel-headers (>= 2.6.13+0rc3-2) [!hurd-i386], mig (>= 1.3-2) 
[hurd-i386], hurd-dev (>= 20020608-1) [hurd-i386], gnumach-dev [hurd-i386], 
texi2html, file, gcc-4.0 [!powerpc !m68k !hppa !hurd-i386], gcc-4.0 (>= 
4.0.1-5) [hppa], gcc-3.4 (>= 3.4.4-6) [powerpc ppc64], gcc-3.4 [m68k], gcc-3.3 
[hurd-i386], autoconf, binutils (>= 2.14.90.0.7-5), sed (>= 4.0.5-4), gawk, 
debhelper (>= 4.1.76), libc6-dev-amd64 [i386], libc6-dev-powerpc [ppc64]
 Build-Depends-Indep: perl, po-debconf
 Maintainer: GNU Libc Maintainers <[email protected]>
 Uploaders: Ben Collins <[EMAIL PROTECTED]>, GOTO Masanori <[EMAIL PROTECTED]>, 
Philip Blundell <[EMAIL PROTECTED]>, Jeff Bailey <[EMAIL PROTECTED]>, Daniel 
Jacobowitz <[EMAIL PROTECTED]>
diff -urN ../tmp-orig/glibc-2.3.5/debian/control.in/main 
./debian/control.in/main
--- ../tmp-orig/glibc-2.3.5/debian/control.in/main      2005-10-16 
07:18:27.000000000 +0000
+++ ./debian/control.in/main    2005-10-16 07:11:15.000000000 +0000
@@ -1,7 +1,7 @@
 Source: @glibc@
 Section: libs
 Priority: required
-Build-Depends: gettext (>= 0.10.37-1), make (>= 3.80-1), dpkg-dev (>= 1.13.5), 
debianutils (>= 1.13.1), tar (>= 1.13.11), bzip2, texinfo (>= 4.0), 
linux-kernel-headers (>= 2.6.13+0rc3-2) [!hurd-i386], mig (>= 1.3-2) 
[hurd-i386], hurd-dev (>= 20020608-1) [hurd-i386], gnumach-dev [hurd-i386], 
texi2html, file, gcc-4.0 [!powerpc !m68k !hppa !hurd-i386], gcc-4.0 (>= 
4.0.1-5) [hppa], gcc-3.4 (>= 3.4.4-6) [powerpc], gcc-3.4 [m68k], gcc-3.3 
[hurd-i386], autoconf, binutils (>= 2.14.90.0.7-5), sed (>= 4.0.5-4), gawk, 
debhelper (>= 4.1.76), libc6-dev-amd64 [i386]
+Build-Depends: gettext (>= 0.10.37-1), make (>= 3.80-1), dpkg-dev (>= 1.13.5), 
debianutils (>= 1.13.1), tar (>= 1.13.11), bzip2, texinfo (>= 4.0), 
linux-kernel-headers (>= 2.6.13+0rc3-2) [!hurd-i386], mig (>= 1.3-2) 
[hurd-i386], hurd-dev (>= 20020608-1) [hurd-i386], gnumach-dev [hurd-i386], 
texi2html, file, gcc-4.0 [!powerpc !m68k !hppa !hurd-i386], gcc-4.0 (>= 
4.0.1-5) [hppa], gcc-3.4 (>= 3.4.4-6) [powerpc ppc64], gcc-3.4 [m68k], gcc-3.3 
[hurd-i386], autoconf, binutils (>= 2.14.90.0.7-5), sed (>= 4.0.5-4), gawk, 
debhelper (>= 4.1.76), libc6-dev-amd64 [i386], libc6-dev-powerpc [ppc64]
 Build-Depends-Indep: perl, po-debconf
 Maintainer: GNU Libc Maintainers <[email protected]>
 Uploaders: Ben Collins <[EMAIL PROTECTED]>, GOTO Masanori <[EMAIL PROTECTED]>, 
Philip Blundell <[EMAIL PROTECTED]>, Jeff Bailey <[EMAIL PROTECTED]>, Daniel 
Jacobowitz <[EMAIL PROTECTED]>
diff -urN ../tmp-orig/glibc-2.3.5/debian/control.in/powerpc 
./debian/control.in/powerpc
--- ../tmp-orig/glibc-2.3.5/debian/control.in/powerpc   1970-01-01 
00:00:00.000000000 +0000
+++ ./debian/control.in/powerpc 2005-10-16 07:09:23.000000000 +0000
@@ -0,0 +1,21 @@
+Package: libc6-powerpc
+Architecture: ppc64
+Section: libs
+Priority: extra
+Depends: libc6 (= ${Source-Version}), lib32gcc1
+Description: GNU C Library: 32bit powerpc shared libraries for ppc64
+ This package includes shared versions of the standard C
+ library and the standard math library, as well as many others.
+ This is the 32bit version of the library, meant for ppc64 systems.
+
+Package: libc6-dev-powerpc
+Architecture: ppc64
+Section: libdevel
+Priority: standard
+Provides: lib32c-dev
+Depends: libc6-powerpc (= ${Source-Version}), libc6-dev (= ${Source-Version})
+Description: GNU C Library: 32bit powerpc development libraries for ppc64
+ Contains the symlinks and object files needed to compile and link programs
+ which use the standard C library. This is the 32bit version of the
+ library, meant for ppc64 systems.
+
diff -urN ../tmp-orig/glibc-2.3.5/debian/patches/amd64-lib.dpatch 
./debian/patches/amd64-lib.dpatch
--- ../tmp-orig/glibc-2.3.5/debian/patches/amd64-lib.dpatch     2005-10-16 
07:18:27.000000000 +0000
+++ ./debian/patches/amd64-lib.dpatch   2005-10-16 07:17:37.000000000 +0000
@@ -1,16 +1,16 @@
 #! /bin/sh -e
  
 # All lines beginning with `# DP:' are a description of the patch.
-# DP: Description: Use /lib instead of /lib64 for the native amd64 port
+# DP: Description: Use /lib instead of /lib64 for the native amd64/ppc64 port
 # DP: Dpatch author: Andreas Jochens <[EMAIL PROTECTED]>
 # DP: Patch author: 
 # DP: Upstream status: Debian-Specific
 # DP: Status Details: 
 # DP: Date: 2004-06-07 (updated 2005-10-13)
 
-# This patch is for amd64 only; on i386 we want the 64-bit libraries
+# This patch is for amd64 and ppc64 only; on i386 we want the 64-bit libraries
 # in /lib64.
-[ "$DEB_HOST_ARCH" != "amd64" ] && exit 0
+[ "$DEB_HOST_ARCH" != "amd64" ] && [ "$DEB_HOST_ARCH" != "ppc64" ] && exit 0
 
 if [ $# -ne 2 ]; then
     echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
@@ -28,23 +28,43 @@
 # append the patch here and adjust the -p? flag in the patch calls.
 --- glibc-2.3.2/sysdeps/unix/sysv/linux/configure~     2004-06-05 
14:03:22.118247000 +0200
 +++ glibc-2.3.2/sysdeps/unix/sysv/linux/configure      2004-06-05 
11:43:35.667961319 +0200
-@@ -224,7 +224,7 @@
- /usr | /usr/)
-   # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
-   case $machine in
--  sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
-+  sparc/sparc64 | powerpc/powerpc64 | s390/s390-64 | \
+@@ -229,7 +229,9 @@
+   sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
    mips/mips64/n64/* )
      libc_cv_slibdir="/lib64"
-     if test "$libdir" = '${exec_prefix}/lib'; then
++    if $CC -dumpmachine | grep "^\(powerpc64\|x86_64\)" >/dev/null; then
++      libc_cv_slibdir="/lib"
+-    if test "$libdir" = '${exec_prefix}/lib'; then
++    elif test "$libdir" = '${exec_prefix}/lib'; then
+       libdir='${exec_prefix}/lib64';
+       # Locale data can be shared between 32bit and 64bit libraries
+       libc_cv_localedir='${exec_prefix}/lib/locale'
+@@ -245,6 +247,7 @@
+     ;;
+   *)
+     libc_cv_slibdir="/lib"
++    test "$libdir" = "/usr/lib32" && libc_cv_slibdir="/lib32"
+     ;;
+   esac
+   # Allow the user to override the path with --sysconfdir
 --- glibc-2.3.2/sysdeps/unix/sysv/linux/configure.in~  2004-07-05 
09:52:28.000000000 +0200
 +++ glibc-2.3.2/sysdeps/unix/sysv/linux/configure.in   2004-07-05 
12:18:07.995664571 +0200
-@@ -157,7 +157,7 @@
- /usr | /usr/)
-   # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
-   case $machine in
--  sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
-+  sparc/sparc64 | powerpc/powerpc64 | s390/s390-64 | \
+@@ -164,7 +164,9 @@
+   sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
    mips/mips64/n64/* )
      libc_cv_slibdir="/lib64"
-     if test "$libdir" = '${exec_prefix}/lib'; then
++    if $CC -dumpmachine | grep "^\(powerpc64\|x86_64\)" >/dev/null; then
++      libc_cv_slibdir="/lib"
+-    if test "$libdir" = '${exec_prefix}/lib'; then
++    elif test "$libdir" = '${exec_prefix}/lib'; then
+       libdir='${exec_prefix}/lib64';
+       # Locale data can be shared between 32bit and 64bit libraries
+       libc_cv_localedir='${exec_prefix}/lib/locale'
+@@ -180,6 +182,7 @@
+     ;;
+   *)
+     libc_cv_slibdir="/lib"
++    test "$libdir" = "/usr/lib32" && libc_cv_slibdir="/lib32"
+     ;;
+   esac
+   # Allow the user to override the path with --sysconfdir
diff -urN ../tmp-orig/glibc-2.3.5/debian/rules.d/control.mk 
./debian/rules.d/control.mk
--- ../tmp-orig/glibc-2.3.5/debian/rules.d/control.mk   2005-10-16 
07:18:27.000000000 +0000
+++ ./debian/rules.d/control.mk 2005-10-16 07:12:59.000000000 +0000
@@ -1,10 +1,10 @@
-control_deps := $(addprefix debian/control.in/, libc6 libc6.1 libc0.3 libc1 
sparc64 s390x ppc64 opt amd64)
+control_deps := $(addprefix debian/control.in/, libc6 libc6.1 libc0.3 libc1 
sparc64 s390x powerpc ppc64 opt amd64)
 
-threads_archs := alpha amd64 arm i386 m68k mips mipsel powerpc sparc ia64 hppa 
s390 sh3 sh4 sh3eb sh4eb freebsd-i386
+threads_archs := alpha amd64 arm i386 m68k mips mipsel powerpc ppc64 sparc 
ia64 hppa s390 sh3 sh4 sh3eb sh4eb freebsd-i386
 
 debian/control.in/libc6: debian/control.in/libc debian/rules.d/control.mk
        sed -e '[EMAIL PROTECTED]@%libc6%g' \
-           -e '[EMAIL PROTECTED]@%amd64 arm i386 m68k mips mipsel powerpc 
sparc s390 hppa sh3 sh4 sh3eb sh4eb%g' < $< > $@
+           -e '[EMAIL PROTECTED]@%amd64 arm i386 m68k mips mipsel powerpc 
ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb%g' < $< > $@
 
 debian/control.in/libc6.1: debian/control.in/libc debian/rules.d/control.mk
        sed -e '[EMAIL PROTECTED]@%libc6.1%g;[EMAIL PROTECTED]@%alpha ia64%g' < 
$< > $@
@@ -25,6 +25,7 @@
        cat debian/control.in/sparc64           >> [EMAIL PROTECTED]
        cat debian/control.in/s390x             >> [EMAIL PROTECTED]
        cat debian/control.in/amd64             >> [EMAIL PROTECTED]
+       cat debian/control.in/powerpc           >> [EMAIL PROTECTED]
        cat debian/control.in/ppc64             >> [EMAIL PROTECTED]
        cat debian/control.in/opt               >> [EMAIL PROTECTED]
        cat debian/control.in/libnss-dns-udeb   >> [EMAIL PROTECTED]
diff -urN ../tmp-orig/glibc-2.3.5/debian/rules.d/debhelper.mk 
./debian/rules.d/debhelper.mk
--- ../tmp-orig/glibc-2.3.5/debian/rules.d/debhelper.mk 2005-10-16 
07:18:27.000000000 +0000
+++ ./debian/rules.d/debhelper.mk       2005-10-16 07:09:23.000000000 +0000
@@ -184,7 +184,7 @@
          esac; \
        done
 
-       # Hack: special-case passes whose destdir is 64 (i.e. /lib64)
+       # Hack: special-case for destdir==32 or 64 (i.e. /lib32 or /lib64)
        # to use a different install template, which includes more
        # libraries.  Also generate a -dev.  Non-64 libraries get scripts
        # to temporarily disable hwcap.  This needs some cleaning up.
@@ -193,7 +193,7 @@
          destdir=$$1; \
          shift; \
          z=debian/$(libc)-$$x.install; \
-         if test $$destdir = 64; then \
+         if test $$destdir = 64 || test $$destdir = 32; then \
            cp debian/debhelper.in/libc-alt.install $$z; \
            zd=debian/$(libc)-dev-$$x.install; \
            cp debian/debhelper.in/libc-alt-dev.install $$zd; \
diff -urN ../tmp-orig/glibc-2.3.5/debian/sysdeps/ppc64.mk 
./debian/sysdeps/ppc64.mk
--- ../tmp-orig/glibc-2.3.5/debian/sysdeps/ppc64.mk     1970-01-01 
00:00:00.000000000 +0000
+++ ./debian/sysdeps/ppc64.mk   2005-10-16 07:09:23.000000000 +0000
@@ -0,0 +1,36 @@
+CC = gcc-3.4
+BUILD_CC = gcc-3.4
+
+# build libc with nptl instead of linuxthreads
+libc_MIN_KERNEL_SUPPORTED = 2.6.0
+libc_add-ons = nptl $(add-ons)
+libc_extra_cflags = -O3
+
+# nptl/ppc64 extra_cflags needs -g2 because of gcc-3.4 bug.
+ifeq ($(BUILD_CC_VERSION),3.4)
+        libc_extra_cflags += -g2
+endif
+
+# /lib64 and /usr/lib64 are provided as symlinks 
+define libc6_extra_pkg_install
+ln -sf lib debian/$(curpass)/lib64
+ln -sf lib debian/$(curpass)/usr/lib64
+endef
+
+# build 32-bit (powerpc) alternative library
+GLIBC_PASSES += powerpc
+DEB_ARCH_REGULAR_PACKAGES += libc6-powerpc libc6-dev-powerpc
+powerpc_MIN_KERNEL_SUPPORTED = 2.6.0
+powerpc_configure_target = powerpc-linux
+powerpc_CC = $(CC) -m32
+powerpc_add-ons = nptl $(add-ons)
+libc6-powerpc_shlib_dep = libc6-powerpc (>= $(shlib_dep_ver))
+powerpc_extra_cflags = -O3 # -g1 disabled (should be reenabled)
+powerpc_LIBDIR = 32
+powerpc_extra_config_options = $(extra_config_options) --libdir=/usr/lib32
+
+# create a symlink for the 32 bit dynamic linker in /lib
+define libc6-powerpc_extra_pkg_install
+mkdir -p debian/$(curpass)/lib
+ln -s /lib32/ld.so.1 debian/$(curpass)/lib
+endef

Reply via email to