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

Bug#301438: New patch for native ppc64 support



On 05-Aug-18 19:38, GOTO Masanori wrote:
> At Thu, 18 Aug 2005 10:24:14 +0200,
> Andreas Jochens wrote:
> > A small number of packages still need some minor patches
> > to make this work, notably 'glibc' (see #301438 - the patch in that
> > bug is outdated, but I could supply an updated patch for this).
> 
> I didn't put your patch because the native ppc64 support was not
> adopted, from the discussion that was done in debian-powerpc lists.

Indeed, in the discussions on debian-powerpc some people considered
a native ppc64 port to be uninteresting. However, I think that running a 
native ppc64 buildd will be the easiest way to provide 64-bit packages 
for biarch installations on powerpc. Additionally, there are some 
people who like to run a native 64-bit environment, even if some
utilities may run a little slower (by ~10% according to my own tests) 
than their 32-bit counterparts on current hardware.

> If your patch does not have any impact, please send your latest
> version to me.

The attached updated patch adds support for the native pp64 
architecture to glibc. It applies to the lastest unstable version 
glibc_2.3.5-3.

The main difference to the original patch is that
the new one disables the modified amd64-lib.dpatch for all 
architectures except amd64 and ppc64. Otherwise the new powerpc
biarch build, which has been introduced by the latest glibc version,
would fail. 

Perhaps the amd64-lib.dpatch file should also be renamed to 
amd64+ppc64-lib.dpatch or something like that.

Is there maybe a better way to disable a single patch selectively
for some architectures than the method used in the patch below?

Regards
Andreas Jochens


Summary of changes:

* debian/control.in/main
  - Build-Depend on gcc-3.4 on ppc64
  - add 'libc6-powerpc-dev [ppc64]' to the Build-Depends

* 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/control.in/powerpc
  - New file with control information for the alternative 
    32 bit library packages libc6-powerpc and libc-dev-powerpc.

* debian/control.in/libc6
  - Add 'ppc64' to the architecture lists.

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

* debian/rules.d/debhelper.mk
  - Add support for 32 bit alternative library builds.
    (This may also be used to build a 32-bit libc6-i386 package on 
    amd64 at a later stage to make the amd64 toolchain independend
    of the somewhat problematic ia32-libs package.)

* debian/amd64-lib.dpatch
  - Treat 'powerpc64' similar to 'x86_64', i.e. use /lib instead of
    /lib64 for the native 64 bit library files.
  - Install 32 bit alternative library files in /lib32 instead of /lib.
  - Apply the patch only on amd64 and ppc64 to avoid problems with
    the 64-bit ppc64 pass on powerpc (and to also avoid possible 
    problems with a 64-bit amd64 pass on i386 which may be introduced
    later).

diff -urN ../tmp-orig/glibc-2.3.5/debian/control.in/libc6 ./debian/control.in/libc6
--- ../tmp-orig/glibc-2.3.5/debian/control.in/libc6	2005-08-09 18:01:25.000000000 +0000
+++ ./debian/control.in/libc6	2005-08-09 15:38:42.000000000 +0000
@@ -1,5 +1,5 @@
 Package: libc6
-Architecture: amd64 arm i386 m68k mips mipsel powerpc sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
 Section: base
 Priority: required
 Provides: ${locale:Depends}
@@ -10,7 +10,7 @@
  Timezone data is also included.
 
 Package: libc6-dev
-Architecture: amd64 arm i386 m68k mips mipsel powerpc sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
 Section: libdevel
 Priority: standard
 Depends: libc6 (= ${Source-Version})
@@ -20,7 +20,7 @@
  and link programs which use the standard C library.
 
 Package: libc6-dbg
-Architecture: amd64 arm i386 m68k mips mipsel powerpc sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
 Section: libdevel
 Priority: extra
 Provides: libc-dbg
@@ -34,7 +34,7 @@
  Most people will not need this package.
 
 Package: libc6-prof
-Architecture: amd64 arm i386 m68k mips mipsel powerpc sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
 Section: libdevel
 Priority: extra
 Depends: libc6 (= ${Source-Version})
@@ -43,7 +43,7 @@
  with gprof.
 
 Package: libc6-pic
-Architecture: amd64 arm i386 m68k mips mipsel powerpc sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
 Section: libdevel
 Priority: optional
 Conflicts: libc-pic
@@ -58,7 +58,7 @@
 
 Package: libc6-udeb
 XC-Package-Type: udeb
-Architecture: amd64 arm i386 m68k mips mipsel powerpc sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
 Section: debian-installer
 Priority: extra
 Provides: libc6, libc-udeb, ${locale:Depends}
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-08-09 18:01:25.000000000 +0000
+++ ./debian/control.in/main	2005-08-09 15:38:42.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.5.999-test7-bk-9) [!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] | gcc-3.4 (>= 3.4.4-6) [powerpc] | gcc-3.4 [m68k], autoconf, binutils (>= 2.14.90.0.7-5), sed (>= 4.0.5-4), gawk, debhelper (>= 4.1.76)
+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.5.999-test7-bk-9) [!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], gcc-3.4 (>= 3.4.4-6) [powerpc ppc64], gcc-3.4 [m68k], autoconf, binutils (>= 2.14.90.0.7-5), sed (>= 4.0.5-4), gawk, debhelper (>= 4.1.76), libc6-dev-powerpc [ppc64]
 Build-Depends-Indep: perl, po-debconf
 Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
 Uploaders: Ben Collins <bcollins@debian.org>, GOTO Masanori <gotom@debian.org>, Philip Blundell <pb@nexus.co.uk>, Jeff Bailey <jbailey@raspberryginger.com>, Daniel Jacobowitz <dan@debian.org>
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-08-09 15:38:42.000000000 +0000
@@ -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.5/debian/patches/amd64-lib.dpatch ./debian/patches/amd64-lib.dpatch
--- ../tmp-orig/glibc-2.3.5/debian/patches/amd64-lib.dpatch	2005-08-09 18:01:25.000000000 +0000
+++ ./debian/patches/amd64-lib.dpatch	2005-08-09 17:19:33.000000000 +0000
@@ -1,12 +1,15 @@
 #! /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 amd64/ppc64 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-08-09
+
+# this patch is for amd64 and ppc64 only - do not apply for others
+[ "$DEB_HOST_ARCH" != "amd64" ] && [ "$DEB_HOST_ARCH" != "ppc64" ] && exit 0
 
 if [ $# -ne 2 ]; then
     echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
@@ -29,10 +32,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 +51,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
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-08-09 18:01:25.000000000 +0000
+++ ./debian/rules.d/control.mk	2005-08-09 15:38:42.000000000 +0000
@@ -1,10 +1,10 @@
 control_deps := $(addprefix debian/control.in/, libc6 libc6.1 libc0.3 libc1 sparc64 s390x ppc64 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' < $< > $@
@@ -24,6 +24,7 @@
 	cat debian/control.in/libc1		>> $@T
 	cat debian/control.in/sparc64		>> $@T
 	cat debian/control.in/s390x		>> $@T
+	cat debian/control.in/powerpc		>> $@T
 	cat debian/control.in/ppc64		>> $@T
 	cat debian/control.in/opt		>> $@T
 	cat debian/control.in/libnss-dns-udeb	>> $@T
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-08-09 18:01:25.000000000 +0000
+++ ./debian/rules.d/debhelper.mk	2005-08-09 15:38:42.000000000 +0000
@@ -178,7 +178,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.
@@ -187,7 +187,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-08-09 15:38:42.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 to: