Source: gcc-4.3 Version: 4.3-20080219-1 Severity: normal Hello Matthias,
Here is the patch that fixes gcc-4.3 cross compilation :-) I have succesfully built an arm cross toolchain, i'm now trying it more extensibly on other arches. The patch updates cross-fixes patch with a part that has been included into mainstream gcc. It also moves limits.h, syslimits.h and README from new path as we where discussing in a previous mail at debian-gcc list. Plus it replaces: -ifdef DEB_CROSS by +ifeq ($(DEB_CROSS),yes) -- Héctor Orón
diff -urN gcc-4.3-4.3-20080219/debian/patches/cross-fixes.dpatch gcc-4.3-4.3-20080219.cross/debian/patches/cross-fixes.dpatch --- gcc-4.3-4.3-20080219/debian/patches/cross-fixes.dpatch 2008-02-25 18:13:54.000000000 +0100 +++ gcc-4.3-4.3-20080219.cross/debian/patches/cross-fixes.dpatch 2008-02-25 18:14:43.000000000 +0100 @@ -59,23 +59,6 @@ #endif +#endif -diff -NurpP -x '*.orig' -x '*.libc' gcc-4.0.0.orig/gcc/config/pa/linux-unwind.h gcc-4.0.0.new/gcc/config/pa/linux-unwind.h ---- gcc-4.0.0.orig/gcc/config/pa/linux-unwind.h 2005-02-11 02:46:20.000000000 +0100 -+++ gcc-4.0.0.new/gcc/config/pa/linux-unwind.h 2005-05-15 02:37:02.000000000 +0200 -@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */ - /* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - -+#ifndef inhibit_libc - #include <signal.h> - #include <sys/ucontext.h> - -@@ -136,3 +137,5 @@ pa32_fallback_frame_state (struct _Unwin - fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN; - return _URC_NO_REASON; - } -+ -+#endif diff -NurpP -x '*.orig' -x '*.libc' gcc-4.0.0.orig/gcc/config/sh/linux-unwind.h gcc-4.0.0.new/gcc/config/sh/linux-unwind.h --- gcc-4.0.0.orig/gcc/config/sh/linux-unwind.h 2005-02-11 02:12:57.000000000 +0100 +++ gcc-4.0.0.new/gcc/config/sh/linux-unwind.h 2005-05-15 02:44:31.000000000 +0200 diff -urN gcc-4.3-4.3-20080219/debian/rules.conf gcc-4.3-4.3-20080219.cross/debian/rules.conf --- gcc-4.3-4.3-20080219/debian/rules.conf 2008-02-25 18:13:54.000000000 +0100 +++ gcc-4.3-4.3-20080219.cross/debian/rules.conf 2008-02-25 18:14:43.000000000 +0100 @@ -29,7 +29,7 @@ # the safe side (something like newest( version in stable, versions for the # various platforms in INSTALL/specific.html) ). BINUTILSV = 2.17cvs20070426 -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) BINUTILS_BUILD_DEP = binutils$(TS) (>= $(BINUTILSV)) else BINUTILS_BUILD_DEP = binutils (>= $(BINUTILSV)) | binutils-multiarch (>= $(BINUTILSV)) @@ -119,7 +119,7 @@ endif endif -ifndef DEB_CROSS +ifneq ($(DEB_CROSS),yes) LIBC_BUILD_DEP := libc6.1-dev (>= $(libc_ver)) [alpha ia64] | libc0.3-dev (>= $(libc_ver)) [hurd-i386] | libc0.1-dev (>= $(libc_ver)) [kfreebsd-i386 kfreebsd-amd64 knetbsd-gnu] | libc12-dev (>= $(libc_ver)) [netbsd-elf-gnu] | libc6-dev (>= $(libc_ver)) JAVA_BUILD_DEP := libz-dev, @@ -416,7 +416,7 @@ -DTS=$(TS) \ -DLS=$(LS) -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) ctrl_flags += \ -DTARGET=$(DEB_TARGET_ARCH) \ -DLIBUNWIND_BUILD_DEP="$(LIBUNWIND_BUILD_DEP)" \ @@ -434,7 +434,7 @@ control: control-file readme-bugs-file parameters-file substvars-file versioned-files -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) languages = c c++ objc objpp addons = libgcc lib64gcc libcxx lib32cxx lib64cxx cdev c++dev libobjc objcdev objppdev gccxbase else diff -urN gcc-4.3-4.3-20080219/debian/rules.d/binary-gcc-cross.mk gcc-4.3-4.3-20080219.cross/debian/rules.d/binary-gcc-cross.mk --- gcc-4.3-4.3-20080219/debian/rules.d/binary-gcc-cross.mk 2008-02-25 18:13:54.000000000 +0100 +++ gcc-4.3-4.3-20080219.cross/debian/rules.d/binary-gcc-cross.mk 2008-02-25 18:15:29.000000000 +0100 @@ -7,7 +7,7 @@ dirs_gcc = \ $(PF)/bin \ $(gcc_lexec_dir) \ - $(gcc_lib_dir)/include \ + $(gcc_lib_dir)/{include,include-fixed} \ $(PF)/share/man/man1 $(libdir) files_gcc = \ @@ -15,8 +15,9 @@ $(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-gcc$(pkg_ver).1 \ $(gcc_lexec_dir)/collect2 \ $(gcc_lib_dir)/{libgcc*,*.o} \ - $(gcc_lib_dir)/include/README \ - $(gcc_lib_dir)/include/{float,iso646,limits,std*,syslimits,unwind,varargs}.h \ + $(gcc_lib_dir)/include-fixed/README \ + $(gcc_lib_dir)/include/{float,iso646,std*,unwind,varargs}.h \ + $(gcc_lib_dir)/include-fixed/{limits,syslimits}.h \ $(shell for d in asm bits gnu linux; do \ test -e $(d)/$(gcc_lib_dir)/include/$$d \ && echo $(gcc_lib_dir)/include/$$d; \ diff -urN gcc-4.3-4.3-20080219/debian/rules.defs gcc-4.3-4.3-20080219.cross/debian/rules.defs --- gcc-4.3-4.3-20080219/debian/rules.defs 2008-02-25 18:13:54.000000000 +0100 +++ gcc-4.3-4.3-20080219.cross/debian/rules.defs 2008-02-25 18:14:43.000000000 +0100 @@ -88,7 +88,7 @@ $(error GCC_TARGET value "$(GCC_TARGET)" is not a valid Debian architecture) endif -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) # TP: Target Prefix. Used primarily as a prefix for cross tool # names (e.g. powerpc-linux-gcc). # TS: Target Suffix. Used primarily at the end of cross compiler @@ -143,12 +143,12 @@ versioned_packages := yes endif -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) cross_bin_arch := -$(subst _,-,$(TARGET_ALIAS)) cross_lib_arch := -$(subst _,-,$(DEB_TARGET_ARCH))-cross endif -ifndef DEB_CROSS +ifneq ($(DEB_CROSS),yes) ifneq ($(PKGSOURCE),gcc-snapshot) with_common_gcclibdir := yes endif @@ -335,7 +335,7 @@ ifneq (, $(filter $(DEB_TARGET_ARCH),$(java_no_arches))) with_java := disabled for $(DEB_TARGET_ARCH) endif -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) with_java := disabled for cross compiler package endif with_java := $(call envfilt, java, , c++, $(with_java)) @@ -440,7 +440,7 @@ endif with_libffi := $(call envfilt, ffi, , , $(with_libffi)) endif - ifdef DEB_CROSS + ifeq ($(DEB_CROSS),yes) with_libffi := disabled for cross compiler package endif endif @@ -456,7 +456,7 @@ ifneq (, $(filter $(DEB_TARGET_ARCH_CPU),$(f95_no_cpus))) with_fortran := disabled for architecure $(DEB_TARGET_ARCH_CPU) endif -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) with_fortran := disabled for cross compiler package endif ifeq (f95, $(findstring f95,$(WITHOUT_LANG))) @@ -484,7 +484,7 @@ # protoize -------------------- ifeq ($(with_common_pkgs),yes) with_proto := yes - ifdef DEB_CROSS + ifeq ($(DEB_CROSS),yes) with_proto := disabled for cross compiler package endif else @@ -496,7 +496,7 @@ ifeq ($(with_common_pkgs),yes) with_fixincl := yes - ifdef DEB_CROSS + ifeq ($(DEB_CROSS),yes) with_fixincl := disabled for cross compiler package endif else @@ -532,7 +532,7 @@ with_pascal := disabled by environment endif with_pascal := disabled for 4.3 -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) with_pascal := disabled for cross compiler package endif ifeq ($(with_pascal),yes) @@ -557,7 +557,7 @@ ifneq (, $(filter $(DEB_TARGET_GNU_SYSTEM),$(libgc_no_systems))) with_objc_gc := disabled for $(DEB_TARGET_GNU_SYSTEM) endif -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) ifneq (objc, $(findstring objc,$(WITH_LANG))) with_objc := disabled for cross compiler package endif @@ -614,7 +614,7 @@ with_ada := disabled for architecure $(DEB_TARGET_ARCH) endif with_ada := $(call envfilt, ada, , , $(with_ada)) -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) with_ada := disabled for cross compiler package endif #ifeq ($(PKGSOURCE),gcc-snapshot) @@ -665,7 +665,7 @@ ifneq (, $(filter $(DEB_TARGET_ARCH_CPU),$(tl_no_cpus))) with_treelang := disabled for architecure $(DEB_TARGET_ARCH_CPU) endif -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) with_treelang := disabled for cross compiler package endif with_treelang := $(call envfilt, treelang, , , $(with_treelang)) @@ -727,10 +727,10 @@ ifeq ($(with_base_only),yes) with_check := no endif -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) with_check := disabled for cross compiler package endif -ifdef REVERSE_CROSS +ifeq ($(REVERSE_CROSS),yes) with_check := disabled for reverse cross build endif check_no_systems := hurd-i386 diff -urN gcc-4.3-4.3-20080219/debian/rules.patch gcc-4.3-4.3-20080219.cross/debian/rules.patch --- gcc-4.3-4.3-20080219/debian/rules.patch 2008-02-25 18:13:54.000000000 +0100 +++ gcc-4.3-4.3-20080219.cross/debian/rules.patch 2008-02-25 18:14:43.000000000 +0100 @@ -134,7 +134,7 @@ debian_patches += kbsd-gnu-ada endif -ifdef DEB_CROSS +ifeq ($(DEB_CROSS),yes) debian_patches += cross-include cross-fixes endif