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

Bug#262892: gcc-3.4 on amd64: Please replace 'lib64' hack by setting proper MULTILIB_OSDIRNAMES



Package: gcc-3.4
Severity: wishlist
Tags: patch

The attached patch removes the ugly 'lib64' symlink hack from 'debian/rules2'.

Instead it introduces an 'amd64-multilib.dpatch' in 'debian/patches', which
sets MULTILIB_OSDIRNAMES in 'src/gcc/config/i386/t-linux64' to the proper
values for the 'pure64' amd64 port, i.e. to '../lib' for 64bit libraries 
and to '../lib/i486-linux/' for 32bit libraries. The patch also enables the
'amd64-multilib.dpatch' for amd64 in 'debian/rules.patch'.

The name '../lib/i486-linux' for the 32bit library path conforms to the
current multiarch proposals for placing 32bit libraries.

At a later stage, this setting of MULTILIB_OSDIRNAMES will make it possible 
to drop the '--disable-multilib' option in CONFARGS and to build gcc-3.4 
with full multilib support as soon as the necessary 32bit libraries and 
files from glibc are installed in '/usr/lib/i486-linux' (basically libc.a, 
libm.a, libpthread.a and crt?.o are needed for this). With the current
setting of MULTILIB_OSDIRNAMES to '../lib64' and '../lib' this would never
be possible, because '../lib64' and '../lib' are the same directory 
in the pure64 port.

Regards
Andreas Jochens

diff -urN ../tmp-orig/gcc-3.4-3.4.1ds1/debian/rules2 ./debian/rules2
--- ../tmp-orig/gcc-3.4-3.4.1ds1/debian/rules2	2004-08-02 09:13:47.120367094 +0200
+++ ./debian/rules2	2004-08-02 09:13:05.819358217 +0200
@@ -922,14 +926,6 @@
 	rm -rf $(d)
 	mkdir -p $(d)/$(libdir) $(d)/$(PF)
 
-ifeq ($(DEB_TARGET_GNU_CPU),x86_64)
-	: # link lib to lib64 and usr/lib to usr/lib64
-	: # (this works when CONFARGS contains '--disable-multilib')
-	ln -s lib $(d)/lib64
-	mkdir -p $(d)/usr/lib
-	ln -s lib $(d)/usr/lib64
-endif
-
 	: # Install everything
 	PATH=$(PWD)/bin:$$PATH \
 	  $(MAKE) -C $(builddir) \
diff -urN ../tmp-orig/gcc-3.4-3.4.1ds1/debian/patches/amd64-multilib.dpatch ./debian/patches/amd64-multilib.dpatch
--- ../tmp-orig/gcc-3.4-3.4.1ds1/debian/patches/amd64-multilib.dpatch	1970-01-01 01:00:00.000000000 +0100
+++ ./debian/patches/amd64-multilib.dpatch	2004-08-02 09:13:05.800361893 +0200
@@ -0,0 +1,40 @@
+#! /bin/sh -e
+ 
+# DP: Set MULTILIB_OSDIRNAMES to the correct multilib path names for amd64.
+# DP: 
+# DP: 
+ 
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+    pdir="-d $3"
+    dir="$3/"
+elif [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+    -patch)
+        patch $pdir -f --no-backup-if-mismatch -p1 < $0
+        #cd ${dir}gcc && autoconf
+        ;;
+    -unpatch)
+        patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+        #rm ${dir}gcc/configure
+        ;;
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1
+esac
+exit 0
+
+--- src/gcc/config/i386/t-linux64~	2002-11-28 14:47:02.000000000 +0000
++++ src/gcc/config/i386/t-linux64	2004-06-02 16:07:30.533131301 +0000
+@@ -6,7 +6,7 @@
+ 
+ MULTILIB_OPTIONS = m64/m32
+ MULTILIB_DIRNAMES = 64 32 
+-MULTILIB_OSDIRNAMES = ../lib64 ../lib
++MULTILIB_OSDIRNAMES = ../lib ../lib/i486-linux
+ 
+ LIBGCC = stmp-multilib
+ INSTALL_LIBGCC = install-multilib
diff -urN ../tmp-orig/gcc-3.4-3.4.1ds1/debian/rules.patch ./debian/rules.patch
--- ../tmp-orig/gcc-3.4-3.4.1ds1/debian/rules.patch	2004-08-02 09:13:47.112368642 +0200
+++ ./debian/rules.patch	2004-08-02 09:13:05.802361506 +0200
@@ -72,6 +72,11 @@
 ifeq ($(DEB_TARGET_GNU_CPU),alpha)
   debian_patches += # alpha-ieee
 endif
+
+ifeq ($(DEB_TARGET_ARCH),amd64)
+  debian_patches += amd64-multilib
+endif
+
 ifeq ($(DEB_TARGET_GNU_CPU),arm)
   debian_patches += arm-libstdc++-soname
 endif



Reply to: