[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#301438: glibc: FTBFS (ppc64): Please add support for the ppc64 architecture



Package: glibc
Severity: wishlist
Tags: patch

Hello,

thank you for uploading glibc version 2.3.4 to experimental.
This will make things a lot easier for the ppc64 port.

Please add support for the native 64 bit port to the ppc64 architecture 
to glibc-2.3.4.

The attached patch to glibc-2.3.4 has been used since December 2004 
by the ppc64 archive on alioth. 

The patch uses basically the same strategy as the amd64 port, 
but with an additional extra pass for the creation of an 
alternative 32 bit library.

Regards
Andreas Jochens


Summary of changes:

* debian/control.in/ppc64
  - New file with control information for the alternative 
    32 bit library packages libc6-powerpc and libc-dev-powerpc.

* debian/rules.d/control.mk
  - Add 'ppc64' to the architecture lists.
  - Use the new debian/control.in/ppc64 file

* debian/rules.d/debhelper.mk
  - Add support for 32 bit alternative libraries.

* debian/sysdeps/ppc64.mk
  - New file with support for the ppc64 library (nptl only) 
    and an extra pass for a 32 bit alternative library.

* debian/amd64-lib.mk
  - Treat 'powerpc64' similar to 'x86_64', i.e. use /lib instead of
    /lib64 for the native 64 bit library files.
  - Install the 32 bit alternative library files in /lib32 instead of /lib.


diff -urN ../tmp-orig/glibc-2.3.4/debian/control.in/ppc64 ./debian/control.in/ppc64
--- ../tmp-orig/glibc-2.3.4/debian/control.in/ppc64	1970-01-01 01:00:00.000000000 +0100
+++ ./debian/control.in/ppc64	2005-03-24 19:24:00.000000000 +0100
@@ -0,0 +1,20 @@
+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
+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.4/debian/rules.d/control.mk ./debian/rules.d/control.mk
--- ../tmp-orig/glibc-2.3.4/debian/rules.d/control.mk	2005-03-24 09:28:38.000000000 +0100
+++ ./debian/rules.d/control.mk	2005-03-24 19:25:59.000000000 +0100
@@ -1,10 +1,10 @@
-control_deps := $(addprefix debian/control.in/, libc6 libc6.1 libc0.3 libc1 sparc64 s390x opt)
+control_deps := $(addprefix debian/control.in/, libc6 libc6.1 libc0.3 libc1 ppc64 sparc64 s390x opt)
 
-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 's%@libc@%libc6%g' \
-	    -e 's%@archs@%amd64 arm i386 m68k mips mipsel powerpc sparc s390 hppa sh3 sh4 sh3eb sh4eb%g' < $< > $@
+	    -e 's%@archs@%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 's%@libc@%libc6.1%g;s%@archs@%alpha ia64%g' < $< > $@
@@ -22,6 +22,7 @@
 	cat debian/control.in/libc6.1		>> $@T
 	cat debian/control.in/libc0.3		>> $@T
 	cat debian/control.in/libc1		>> $@T
+	cat debian/control.in/ppc64		>> $@T
 	cat debian/control.in/sparc64		>> $@T
 	cat debian/control.in/s390x		>> $@T
 	cat debian/control.in/opt		>> $@T
diff -urN ../tmp-orig/glibc-2.3.4/debian/rules.d/debhelper.mk ./debian/rules.d/debhelper.mk
--- ../tmp-orig/glibc-2.3.4/debian/rules.d/debhelper.mk	2005-03-24 09:28:38.000000000 +0100
+++ ./debian/rules.d/debhelper.mk	2005-03-25 14:13:21.000000000 +0100
@@ -168,7 +168,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.
@@ -177,7 +177,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.4/debian/sysdeps/ppc64.mk ./debian/sysdeps/ppc64.mk
--- ../tmp-orig/glibc-2.3.4/debian/sysdeps/ppc64.mk	1970-01-01 01:00:00.000000000 +0100
+++ ./debian/sysdeps/ppc64.mk	2005-03-25 20:32:56.051622910 +0100
@@ -0,0 +1,31 @@
+CC = gcc
+BUILD_CC = gcc
+
+# build libc with nptl instead of linuxthreads
+libc_MIN_KERNEL_SUPPORTED = 2.6.0
+libc_add-ons = nptl $(add-ons)
+libc_extra_cflags = -O3
+
+# /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 32bit powerpc library
+GLIBC_PASSES += powerpc
+DEB_ARCH_REGULAR_PACKAGES += libc6-powerpc libc6-dev-powerpc
+powerpc_CC = $(CC) -m32
+powerpc_MIN_KERNEL_SUPPORTED = 2.6.0
+powerpc_configure_target = powerpc-linux
+powerpc_add-ons = nptl $(add-ons)
+libc6-powerpc_shlib_dep = libc6-powerpc (>= $(shlib_dep_ver))
+powerpc_LIBDIR = 32
+powerpc_extra_config_options = $(extra_config_options) \
+ --with-headers=/usr/include/ppc-linux --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
diff -urN ../tmp-orig/glibc-2.3.4/debian/patches/amd64-lib.dpatch ./debian/patches/amd64-lib.dpatch
--- ../tmp-orig/glibc-2.3.4/debian/patches/amd64-lib.dpatch	2005-03-24 09:28:38.000000000 +0100
+++ ./debian/patches/amd64-lib.dpatch	2005-03-25 15:12:35.000000000 +0100
@@ -1,12 +1,12 @@
 #! /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 native 64 ports
 # DP: Dpatch author: Andreas Jochens <aj@andaco.de>
 # DP: Patch author: 
 # DP: Upstream status: Debian-Specific
 # DP: Status Details: 
-# DP: Date: 2004-06-07
+# DP: Date: 2004-06-07 / 2005-03-24
 
 if [ $# -ne 2 ]; then
     echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
@@ -29,10 +29,18 @@
    # 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 | \
++  sparc/sparc64 | s390/s390-64 | \
    mips/mips64/n64/* )
      libc_cv_slibdir="/lib64"
      if test "$libdir" = '${exec_prefix}/lib'; then
+@@ -245,6 +245,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 @@
@@ -40,7 +48,15 @@
    # 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 | \
++  sparc/sparc64 | s390/s390-64 | \
    mips/mips64/n64/* )
      libc_cv_slibdir="/lib64"
      if test "$libdir" = '${exec_prefix}/lib'; then
+@@ -180,6 +180,7 @@
+     ;;
+   *)
+     libc_cv_slibdir="/lib"
++    test "$libdir" = '/usr/lib32' && libc_cv_slibdir="/lib32"
+     ;;
+   esac
+   # Allow the user to override the path with --sysconfdir



Reply to: