Bug#267049: gcc-3.4: new multilib on amd64 works - minor patch necessary
Package: gcc-3.4
Severity: wishlist
Tags: patch
I built the new gcc-3.4 (version -7) for the amd64/gcc-3.4 archive and
tested it by e.g. compiling 'grub' with '-m32' and by compiling the new
gcc-3.4 with itself. Everything seems to work fine so far.
Thank you for your work on this.
I had to use a minor patch (attached below) to make gcc-3.4 compile
for the amd64/gcc-3.4 archive. This patch does the following:
* Change MULTILIB_OSDIRNAMES from '../lib64 ../lib32' to
'../lib ../lib32' in debian/patches/amd64-biarch.dpatch.
Without this change, the gcc-3.4 package FTBFS on amd64 because
all scripts in debian/rules.d expect everything to be in 'lib'
(and 'lib' is the correct setting for the pure64 port anyway).
* Do not add '--disable-multilib' to CONFARGS in debian/rules2.
* Move 'ifeq ($(biarch_ia32),yes)...' to the correct position
in debian/rules.d/binary-gcc.mk.
* Change debian/rules.defs to build common-libs and common_pkgs
from the gcc-3.4 package (encapsulated with 'if's so that this
is done for the amd64/gcc-3.4 archive only).
I will use this new multilib-enabled gcc-3.4 version for the
amd64/gcc-3.4 archive from now on. However, I could not upload
this new version to the archive yet, because alioth currently
does not allow me (and others) to login.
Regards
Andreas Jochens
diff -urN ../tmp-orig/gcc-3.4-3.4.1ds1/debian/patches/amd64-biarch.dpatch ./debian/patches/amd64-biarch.dpatch
--- ../tmp-orig/gcc-3.4-3.4.1ds1/debian/patches/amd64-biarch.dpatch 2004-08-20 12:35:48.572531969 +0200
+++ ./debian/patches/amd64-biarch.dpatch 2004-08-20 11:19:00.084128697 +0200
@@ -33,7 +33,7 @@
MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
-MULTILIB_OSDIRNAMES = ../lib64 ../lib
-+MULTILIB_OSDIRNAMES = ../lib64 ../lib32
++MULTILIB_OSDIRNAMES = ../lib ../lib32
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
diff -urN ../tmp-orig/gcc-3.4-3.4.1ds1/debian/rules.d/binary-gcc.mk ./debian/rules.d/binary-gcc.mk
--- ../tmp-orig/gcc-3.4-3.4.1ds1/debian/rules.d/binary-gcc.mk 2004-08-20 12:35:48.192589729 +0200
+++ ./debian/rules.d/binary-gcc.mk 2004-08-19 23:54:59.000000000 +0200
@@ -66,15 +66,6 @@
ifeq ($(with_check),yes)
usr_doc_files += test-summary
endif
-ifeq ($(biarch_ia32),yes)
- mkdir -p $(d_gcc)/$(gcc_lib_dir)
- mv $(d)/$(gcc_lib_dir)/32 $(d_gcc)/$(gcc_lib_dir)/
- dh_link -p$(p_gcc) \
- /$(PF)/lib32/libgcc_s.so.$(GCC_SONAME) \
- /$(gcc_lib_dir)/libgcc_s_32.so \
- /$(PF)/lib32/libgcc_s.so.$(GCC_SONAME) \
- /$(gcc_lib_dir)/32/libgcc_s.so
-endif
# ----------------------------------------------------------------------
$(binary_stamp)-gcc: $(install_dependencies)
@@ -92,6 +83,15 @@
ln -sf /$(lib64)/libgcc_s.so.$(GCC_SONAME) $(d)/$(gcc_lib_dir)/libgcc_s_64.so
ln -sf /$(lib64)/libgcc_s.so.$(GCC_SONAME) $(d)/$(gcc_lib_dir)/64/libgcc_s.so
endif
+ifeq ($(biarch_ia32),yes)
+ mkdir -p $(d_gcc)/$(gcc_lib_dir)
+ mv $(d)/$(gcc_lib_dir)/32 $(d_gcc)/$(gcc_lib_dir)/
+ dh_link -p$(p_gcc) \
+ /$(PF)/lib32/libgcc_s.so.$(GCC_SONAME) \
+ /$(gcc_lib_dir)/libgcc_s_32.so \
+ /$(PF)/lib32/libgcc_s.so.$(GCC_SONAME) \
+ /$(gcc_lib_dir)/32/libgcc_s.so
+endif
cp -p debian/gccbug.1 $(d)/$(PF)/share/man/man1/gccbug$(pkg_ver).1
DH_COMPAT=2 dh_movefiles -p$(p_gcc) $(files_gcc)
diff -urN ../tmp-orig/gcc-3.4-3.4.1ds1/debian/rules.defs ./debian/rules.defs
--- ../tmp-orig/gcc-3.4-3.4.1ds1/debian/rules.defs 2004-08-20 12:35:48.611526041 +0200
+++ ./debian/rules.defs 2004-08-19 23:53:32.000000000 +0200
@@ -10,6 +10,9 @@
lib64 = lib64
+# version of default gcc compiler (e.g. 3.3 or 3.4)
+BUILD_CC_VERSION:= $(shell gcc -dumpversion | sed 's/\([0-9]*\.[0-9]*\)\(.*\)/\1/')
+
# architecture dependent variables
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
@@ -92,8 +95,16 @@
# gcc versions (fastjar, fixincludes, libgcj-common) ...
with_common_pkgs := no
-# ... and some libraries, which do not change (libffi2, libg2c, libobjc1).
-with_common_libs := no
+# ... and some libraries, which do not change (libffi3, libg2c, libobjc1).
+with_common_libs := built from gcc-3.3
+
+# Build common_pkgs and common_libs for amd64/gcc-3.4
+ifeq ($(DEB_TARGET_GNU_CPU),x86_64)
+ ifneq ($(BUILD_CC_VERSION),3.3)
+ with_common_pkgs := yes
+ with_common_libs := yes
+ endif
+endif
#no_common_libs := s390
#ifeq ($(DEB_TARGET_GNU_CPU), $(findstring $(DEB_TARGET_GNU_CPU),$(no_common_libs)))
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-20 12:35:48.606526801 +0200
+++ ./debian/rules2 2004-08-19 23:50:03.000000000 +0200
@@ -151,7 +151,7 @@
# CONFARGS += --disable-multilib
#endif
-ifeq ($(DEB_TARGET_GNU_CPU), $(findstring $(DEB_TARGET_GNU_CPU),x86_64 powerpc64))
+ifeq ($(DEB_TARGET_GNU_CPU), $(findstring $(DEB_TARGET_GNU_CPU),powerpc64))
CONFARGS += --disable-multilib
endif
Reply to: