On 05-Aug-09 14:14, Daniel Jacobowitz wrote:
> On Tue, Aug 09, 2005 at 07:50:38PM +0200, Andreas Jochens wrote:
> > I could provide a patch to make 'glibc' build the necessary
> > 'libc6-i386' and 'libc6-dev-i386' packages if this approach
> > is welcome.

I meant 'libc6-amd64' and 'libc6-dev-amd64', i.e. 64-bit amd64 
libraries for the i386 architecture. The 'libc6-i386' and 'libc6-dev-i386' 
packages would be 32-bit i386 libraries for amd64.
Sorry for this confusion.

> If you have one handy, I won't complain...

The attached patch to glibc-2.3.5-3 works for me. 

Some bootstrapping will be necessary, because the 64-bit build pass 
needs a Build-Depends on the resulting new 'libc6-dev-amd64' binary 
package itself because the 'configure' process tries to compile
64-bit programs.

Additionally, the linux-kernel-headers package needs to be changed to
support /usr/include/asm wrappers for an i386/amd64 biarch setup.

To build a first version of glibc with the patch, the following can be
done:

1. Create a clean i386/unstable chroot environment with debootstrap

2. apt-get build-dep glibc; apt-get source glibc

3. Apply the attached patch to the glibc source package

4. Ignore the new Build-Depends on 'libc6-dev-amd64 [i386]' and
   'apt-get install lib64gcc1' instead

5. Do _not_ install 'amd64-libs-dev'

6. Install a linux-kernel-headers package with the patch from BTS #321969 
   which adds /usr/include/asm wrappers for i386/amd64.

7. Manually copy amd64 64-bit versions of the following libc6-dev files 
   to /usr/lib64: libc.so, libpthread.so, *crt*.o, libc_nonshared.a   

8. Run dpkg-buildpackage to build the patched glibc. This will create
   the new libc6-amd64 and libc6-dev-amd64 packages which can then be
   used for a regular build with the Build-Depends on 'libc6-dev-amd64'
   installed.

When this is done, the Build-Depends of gcc-4.0 on 'amd64-libs-dev [i386]'
can be replaced by 'libc6-dev-amd64 [i386]' and gcc-4.0 can be recompiled.

With this change, the i386 toolchain would no longer depend on packages
from the amd64 port.

Regards
Andreas Jochens

diff -urN ../tmp-orig/glibc-2.3.5/debian/control ./debian/control
--- ../tmp-orig/glibc-2.3.5/debian/control      2005-08-09 18:01:25.000000000 
+0000
+++ ./debian/control    2005-08-09 15:57:20.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 !ppc64 !m68k], gcc-3.4 (>= 3.4.4-6) 
[powerpc], gcc-3.4 [m68k ppc64], autoconf, binutils (>= 2.14.90.0.7-5), sed (>= 
4.0.5-4), gawk, debhelper (>= 4.1.76), libc6-dev-amd64 [i386]
 Build-Depends-Indep: perl, po-debconf
 Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
 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/amd64 
./debian/control.in/amd64
--- ../tmp-orig/glibc-2.3.5/debian/control.in/amd64     1970-01-01 
00:00:00.000000000 +0000
+++ ./debian/control.in/amd64   2005-08-09 15:38:42.000000000 +0000
@@ -0,0 +1,22 @@
+Package: libc6-amd64
+Architecture: i386
+Section: base
+Priority: required
+Depends: libc6 (= ${Source-Version}), lib64gcc1
+Replaces: amd64-libs
+Description: GNU C Library: 64bit Shared libraries for AMD64
+ 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 AMD64 systems.
+
+Package: libc6-dev-amd64
+Architecture: i386
+Section: libdevel
+Priority: standard
+Depends: libc6-amd64 (= ${Source-Version}), libc6-dev (= ${Source-Version})
+Replaces: amd64-libs-dev
+Description: GNU C Library: 64bit Development Libraries for AMD64
+ 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 AMD64 systems.
+
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 !ppc64 !m68k], gcc-3.4 (>= 3.4.4-6) 
[powerpc], gcc-3.4 [m68k ppc64], autoconf, binutils (>= 2.14.90.0.7-5), sed (>= 
4.0.5-4), gawk, debhelper (>= 4.1.76), libc6-dev-amd64 [i386]
 Build-Depends-Indep: perl, po-debconf
 Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
 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/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
@@ -6,7 +6,10 @@
 # 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 only
+[ "$DEB_HOST_ARCH" != "amd64" ] && exit 0
 
 if [ $# -ne 2 ]; then
     echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
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
@@ -24,6 +24,7 @@
        cat debian/control.in/libc1             >> [EMAIL PROTECTED]
        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/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/sysdeps/i386.mk 
./debian/sysdeps/i386.mk
--- ../tmp-orig/glibc-2.3.5/debian/sysdeps/i386.mk      2005-08-09 
18:01:25.000000000 +0000
+++ ./debian/sysdeps/i386.mk    2005-08-09 18:01:20.000000000 +0000
@@ -20,3 +20,16 @@
 i686_extra_config_options = $(extra_config_options) --disable-profile 
--with-tls --with-__thread
 
 libc_extra_config_options = $(extra_config_options) --with-tls 
--without-__thread
+
+# build 64-bit (amd64) alternative library
+GLIBC_PASSES += amd64
+DEB_ARCH_REGULAR_PACKAGES += libc6-amd64 libc6-dev-amd64
+amd64_MIN_KERNEL_SUPPORTED = 2.6.0
+amd64_configure_target = x86_64-linux
+#__x86_64__ is defined here because Makeconfig uses -undef and the 
+#/usr/include/asm wrappers need that symbol.
+amd64_CC = $(CC) -m64 -D__x86_64__
+amd64_add-ons = nptl $(add-ons)
+libc6-amd64_shlib_dep = libc6-amd64 (>= $(shlib_dep_ver))
+amd64_extra_cflags = -O3 -g1
+amd64_LIBDIR = 64



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to