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

Bug#169176: Attached is missing patch for packaging changes



Hi,
here is the promised patch. Matthias has accepted my biarch compiler changes, 
so that we could go ahead with the glibc changes. The changes are mostly 
copied from sparc64.

Thanks,
Gerhard
diff -urN debian.bak/control debian/control
--- debian.bak/control	2002-11-15 08:05:56.000000000 +0100
+++ debian/control	2002-11-15 08:06:46.000000000 +0100
@@ -308,3 +308,23 @@
  .
  This package contains a minimal set of libraries needed for the debian
  installer.  Do not install it on a normal system.
+
+Package: libc6-s390x
+Architecture: s390
+Section: base
+Priority: required
+Depends: libc6 (= ${Source-Version})
+Description: GNU C Library: 64bit Shared libraries for IBM zSeries
+ This package includes shared versions of the standard C library and the
+ standard math library, as well as many others. This is the 64bit version
+ of the library, meant for zSeries systems.
+
+Package: libc6-dev-s390x
+Architecture: s390
+Section: devel
+Priority: standard
+Depends: libc6-s390x (= ${Source-Version}), libc6-dev (= ${Source-Version}), gcc-3.2 (>= 3.2.1-0pre1)
+Description: GNU C Library: 64bit Development Libraries for IBM zSeries
+ Contains the symlinks and object files needed to compile and link programs
+ which use the standard C library. This is the 64bit version of the
+ library, meant for zSeries systems.
diff -urN debian.bak/control.in/s390x debian/control.in/s390x
--- debian.bak/control.in/s390x	1970-01-01 01:00:00.000000000 +0100
+++ debian/control.in/s390x	2002-11-15 08:06:46.000000000 +0100
@@ -0,0 +1,21 @@
+
+Package: libc6-s390x
+Architecture: s390
+Section: base
+Priority: required
+Depends: libc6 (= ${Source-Version})
+Description: GNU C Library: 64bit Shared libraries for IBM zSeries
+ This package includes shared versions of the standard C library and the
+ standard math library, as well as many others. This is the 64bit version
+ of the library, meant for zSeries systems.
+
+Package: libc6-dev-s390x
+Architecture: s390
+Section: devel
+Priority: standard
+Depends: libc6-s390x (= ${Source-Version}), libc6-dev (= ${Source-Version}), gcc-3.2 (>= 3.2.1-0pre1)
+Description: GNU C Library: 64bit Development Libraries for IBM zSeries
+ Contains the symlinks and object files needed to compile and link programs
+ which use the standard C library. This is the 64bit version of the
+ library, meant for zSeries systems.
+
diff -urN debian.bak/libc-s390x/postinst debian/libc-s390x/postinst
--- debian.bak/libc-s390x/postinst	1970-01-01 01:00:00.000000000 +0100
+++ debian/libc-s390x/postinst	2002-11-15 08:05:56.000000000 +0100
@@ -0,0 +1,6 @@
+#!/bin/sh -e
+
+if [ "$1" = "configure" ]
+then
+    ldconfig
+fi
diff -urN debian.bak/packages.d/libc-dev.mk debian/packages.d/libc-dev.mk
--- debian.bak/packages.d/libc-dev.mk	2002-11-15 08:05:56.000000000 +0100
+++ debian/packages.d/libc-dev.mk	2002-11-15 08:06:46.000000000 +0100
@@ -58,8 +58,18 @@
 	$(tmpdir)/$@$(bindir)/generate-asm $(tmpdir)/$@$(includedir)/
 	rm -rf $(tmpdir)/$@$(includedir)/asm-sparc64
 else
+ifeq ($(DEB_HOST_GNU_CPU),s390)
+	# IBM zSeries has a 32/64 build setup, make sure we support it
+	cp -R $(LINUX_SOURCE)/include/asm-{s390,s390x} \
+		$(tmpdir)/$@$(includedir)/.
+	$(INSTALL_PROGRAM) $(LINUX_SOURCE)/generate-asm.sh \
+		$(tmpdir)/$@$(bindir)/generate-asm
+	$(tmpdir)/$@$(bindir)/generate-asm $(tmpdir)/$@$(includedir)/
+	rm -rf $(tmpdir)/$@$(includedir)/asm-s390x
+else
 	cp -R $(LINUX_SOURCE)/include/asm/. $(tmpdir)/$@$(includedir)/asm/
 endif
+endif
 	rm -rf $(tmpdir)/$@$(includedir)/linux/modules
 	rm -f $(tmpdir)/$@$(includedir)/linux/modversions.h
 endif
diff -urN debian.bak/packages.d/s390x.mk debian/packages.d/s390x.mk
--- debian.bak/packages.d/s390x.mk	1970-01-01 01:00:00.000000000 +0100
+++ debian/packages.d/s390x.mk	2002-11-15 08:09:20.000000000 +0100
@@ -0,0 +1,157 @@
+# Build 64bit libraries
+
+objdir_64		= $(objdir)_64
+install_root_64		= $(install_root)_64
+stamp_install_64	= $(stamp_install)_64
+stamp_build_64		= $(stamp_build)_64
+stamp_configure_64	= $(stamp_configure)_64
+
+flags_64 = -g0 -O2 -Wall
+
+MYCC = gcc-3.2 -m64
+
+ifeq ($(log_build),/dev/tty)
+  log_build_64 = /dev/tty
+else
+  log_build_64 = $(log_build)_64
+endif
+
+$(stamp_install_64): $(stamp_build_64)
+	$(checkroot)
+	$(make_directory) $(install_root_64)
+	$(MAKE) -C $(objdir_64) install_root=$(install_root_64) install
+	touch $@
+
+$(stamp_build_64): $(stamp_configure_64)
+ifeq ($(NO_LOG),)
+	@if [ -s $(log_build_64) ]; then savelog $(log_build_64); fi
+endif
+	@echo 'Building GNU C Library for a $(DEB_BUILD_GNU_TYPE) host (64bit).'
+	$(MAKE) -C $(objdir_64) PARALLELMFLAGS="$(PARALLELMFLAGS)" 2>&1 | tee $(log_build_64)
+	touch $@
+
+$(stamp_configure_64): $(stamp_unpack) $(stamp_patch)
+	$(make_directory) $(objdir_64) $(stampdir)
+	rm -f $(objdir_64)/configparms
+	echo "CC = $(MYCC)"		>> $(objdir_64)/configparms
+	echo "BUILD_CC = $(MYCC)"	>> $(objdir_64)/configparms
+	echo "CFLAGS = $(flags_64)"	>> $(objdir_64)/configparms
+	echo "BUILD_CFLAGS = $(flags_64)"	>> $(objdir_64)/configparms
+	echo "BASH := /bin/bash"	>> $(objdir_64)/configparms
+	echo "KSH := /bin/bash"		>> $(objdir_64)/configparms
+	echo "mandir = $(mandir)"	>> $(objdir_64)/configparms
+	echo "infodir = $(infodir)"	>> $(objdir_64)/configparms
+	echo "libexecdir = $(libexecdir)"	>> $(objdir_64)/configparms
+	echo "LIBGD = no"		>> $(objdir_64)/configparms
+	echo "cross-compiling = yes"	>> $(objdir_64)/configparms
+	echo 
+	cd $(objdir_64) && CC="$(MYCC)" CFLAGS="$(flags_64)" \
+		$(srcdir)/configure --host=s390x-linux \
+		--build=s390x-linux --prefix=/usr --without-cvs \
+		--disable-profile --enable-static --enable-kernel=2.4.0 \
+		--enable-add-ons="$(add-ons)" $(with_headers)
+
+	touch $@
+
+$(libc)-s390x: $(stamp_install_64) debian/control $(mkdir)/sysdeps.mk \
+  debian/libc/DEBIAN/shlibs
+	$(checkroot)
+	$(debian-clean)
+	-rm -rf $(tmpdir)/$@
+
+	$(make_directory) $(tmpdir)/$@/DEBIAN
+	$(INSTALL_PROGRAM) debian/libc-s390x/* $(tmpdir)/$@/DEBIAN
+	cat debian/libc/DEBIAN/shlibs | sed -e 's_$(libc)_$@_' -e \
+		's_/lib/_/lib64/_' > \
+		$(tmpdir)/$@/DEBIAN/shlibs
+
+	$(make_directory) $(tmpdir)/$@/lib64 $(tmpdir)/$@/usr/lib64
+
+	# Compatibility links
+	$(make_directory) $(tmpdir)/$@/lib $(tmpdir)/$@/usr/lib
+	ln -s ../lib64 $(tmpdir)/$@/lib/64
+	ln -s ../lib64 $(tmpdir)/$@/usr/lib/64
+
+	$(INSTALL_DATA) $(install_root_64)/lib64/lib*-$(VERSION).so $(tmpdir)/$@/lib64/.
+	$(INSTALL_PROGRAM) $(install_root_64)/lib64/libc-$(VERSION).so $(tmpdir)/$@/lib64/.
+	$(INSTALL_DATA) $(install_root_64)/lib64/libSegFault.so $(tmpdir)/$@/lib64/.
+ifeq ($(threads),yes)
+	$(INSTALL_DATA) $(install_root_64)/lib64/libpthread-0.10.so $(tmpdir)/$@/lib64/.
+	$(INSTALL_DATA) $(install_root_64)/lib64/libthread_db-1.0.so $(tmpdir)/$@/lib64/.
+endif
+	@set -e; \
+	cd $(install_root_64)/lib64/; \
+	for l in `find . -type l -name 'lib*.so.*'`; \
+		do cp -vdf $$l $(tmpdir)/$@/lib64/.; done
+	cd $(tmpdir)/$@ && \
+	$(STRIP) lib64/lib*-$(VERSION).so
+ifeq ($(threads),yes)
+	$(STRIP) $(tmpdir)/$@/lib64/libpthread-0.10.so
+	$(STRIP) $(tmpdir)/$@/lib64/libthread_db-1.0.so
+endif
+	$(INSTALL_PROGRAM) $(install_root_64)/lib64/ld-$(VERSION).so \
+		$(tmpdir)/$@/lib64/.
+	#### XXX
+#	test -e /lib64/ld-linux.so.2 && \
+#		$(INSTALL_PROGRAM) /lib64/ld-*.so $(tmpdir)/$@/lib64/ld-$(VERSION).so
+	cp -vdf $(install_root_64)/lib64/ld*.so.* \
+		$(tmpdir)/$@/lib64/.
+	cp -vfa $(install_root_64)/usr/lib64/gconv \
+		$(tmpdir)/$@/usr/lib64/.
+	$(make_directory) $(tmpdir)/$@$(docdir)
+	ln -sf $(libc) $(tmpdir)/$@$(docdir)/$@
+	dpkg-gencontrol -isp -p$@ -P$(tmpdir)/$@
+	chown -R root.root $(tmpdir)/$@
+	chmod -R go=rX $(tmpdir)/$@
+	dpkg --build $(tmpdir)/$@ ..
+
+$(libc)-dev-s390x: $(stamp_install_64) debian/control $(mkdir)/sysdeps.mk
+	$(checkroot)
+	$(debian-clean)
+	-rm -rf $(tmpdir)/$@
+
+	$(make_directory) $(tmpdir)/$@/DEBIAN
+
+	$(make_directory) $(tmpdir)/$@$(libdir)64
+	$(INSTALL_DATA) $(install_root_64)$(libdir)64/*.o $(tmpdir)/$@$(libdir)64/.
+	$(INSTALL_DATA) $(install_root_64)$(libdir)64/*.a $(tmpdir)/$@$(libdir)64/.
+	rm -f $(tmpdir)/$@$(libdir)64/*_?.a
+ifeq ($(DEB_BUILD_OPTION_STRIP),yes)
+# Don't strip linker scripts.
+	@tostrip=; for file in $(tmpdir)/$@$(libdir)64/*; do \
+	  case `file $$file` in \
+	  *text) ;; *) tostrip="$$tostrip $$file" ;; esac; \
+	done; echo "$(STRIP) -g $$tostrip"; \
+	$(STRIP) -g $$tostrip
+endif
+	for f in $(install_root_64)$(libdir)64/lib*.so; do \
+	  case "$$f" in \
+	  *-$(VERSION).so | *-0.[789].so ) ;; \
+	  */libSegFault.so|*/libthread_db.so|*/libdb.so) ;; \
+	  *) cp -df $$f $(tmpdir)/$@$(libdir)64/. || exit 1 ;; \
+	  esac; \
+	done
+	cd $(tmpdir)/$@$(libdir)64; \
+	for link in `find . -name '*.so' -type l`; do \
+	  linksrc=$$(readlink $$link | sed 's%../..%%'); \
+	  rm -f $$link; ln -sf $$linksrc $$link; done
+
+	# IBM zSeries has a 32/64 build setup, make sure we support it
+	$(make_directory) $(tmpdir)/$@$(includedir)
+	cp -R $(LINUX_SOURCE)/include/asm-s390x \
+		$(tmpdir)/$@$(includedir)/.
+	# Remove cruft from CVS trees
+	find $(tmpdir)/$@$(includedir)/ -name CVS -type d | xargs -r rm -rf
+	find $(tmpdir)/$@$(includedir)/ -name '.#*' -type f | xargs rm -f
+
+	$(make_directory) $(tmpdir)/$@$(docdir)/$@
+	$(INSTALL_DATA) debian/changelog $(tmpdir)/$@$(docdir)/$@/changelog.Debian
+	-find $(tmpdir)/$@$(docdir)/$@ -type f | xargs -r gzip -9f
+	$(INSTALL_DATA) debian/copyright $(tmpdir)/$@$(docdir)/$@/.
+
+#	cp -a debian/libc-dev/{postinst,prerm} $(tmpdir)/$@/DEBIAN
+
+	dpkg-gencontrol -isp -p$@ -P$(tmpdir)/$@
+	chown -R root.root $(tmpdir)/$@
+	chmod -R go=rX $(tmpdir)/$@
+	dpkg --build $(tmpdir)/$@ ..
diff -urN debian.bak/patches/0list debian/patches/0list
--- debian.bak/patches/0list	2002-11-15 08:05:56.000000000 +0100
+++ debian/patches/0list	2002-11-15 08:06:46.000000000 +0100
@@ -32,3 +32,4 @@
 elf-machine-rela-mips
 librt-mips
 glibc23-ctype-compat
+s390-lib64
diff -urN debian.bak/rules debian/rules
--- debian.bak/rules	2002-11-15 08:05:56.000000000 +0100
+++ debian/rules	2002-11-15 08:06:46.000000000 +0100
@@ -180,7 +180,12 @@
 include $(package_rules)/locales.mk
 include $(package_rules)/glibc-doc.mk
 include $(package_rules)/optimized.mk
+ifeq ($(DEB_HOST_GNU_CPU),sparc)
 include $(package_rules)/sparc64.mk
+endif
+ifeq ($(DEB_HOST_GNU_CPU),s390)
+include $(package_rules)/s390x.mk
+endif
 
 setperms: debian/perms
 	@for dir in glibc-doc libc libc-* locales nscd; \
diff -urN debian.bak/rules.d/control.mk debian/rules.d/control.mk
--- debian.bak/rules.d/control.mk	2002-11-15 08:05:56.000000000 +0100
+++ debian/rules.d/control.mk	2002-11-15 08:06:46.000000000 +0100
@@ -1,5 +1,5 @@
 # Add opt to this line to generate optimized packages
-control_deps := $(addprefix debian/control.in/, libc6 libc6.1 libc0.3 libc1 sparc64) # 
+control_deps := $(addprefix debian/control.in/, libc6 libc6.1 libc0.3 libc1 sparc64 s390x) # 
 
 threads_archs := alpha arm i386 m68k mips mipsel powerpc sparc ia64 hppa s390 sh3 sh4 sh3eb sh4eb freebsd-i386
 
@@ -25,6 +25,7 @@
 	cat debian/control.in/libc0.3		>> $@T
 	cat debian/control.in/libc1		>> $@T
 	cat debian/control.in/sparc64		>> $@T
+	cat debian/control.in/s390x		>> $@T
 #	Uncomment this line to enable optimized packages
 #	cat debian/control.in/opt		>> $@T
 	cat debian/control.in/libc-udeb         >> $@T
diff -urN debian.bak/sysdeps/linux.mk debian/sysdeps/linux.mk
--- debian.bak/sysdeps/linux.mk	2002-11-15 08:05:56.000000000 +0100
+++ debian/sysdeps/linux.mk	2002-11-15 08:06:46.000000000 +0100
@@ -17,6 +17,10 @@
   arch_packages += $(libc)-sparc64 $(libc)-dev-sparc64
 endif
 
+ifeq ($(DEB_HOST_GNU_CPU),s390)
+  arch_packages += $(libc)-s390x $(libc)-dev-s390x
+endif
+
 # Uncomment this to build optimized libraries
 # opt_packages += $(addprefix opt-$(libc)-,$(cpus))
 

Reply to: