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

cross gcc uclibc and bootstrap support



I'm in the middle of cleaning up the changes I did to gcc to support
bootstrapping and building uclibc toolchains and moving the changes to
20070707. I hope to get all patches sent to this list this weekend.
Please give those patches a try even if you're not building a uclibc
toolchain to catch any breakages as soon as possible.
first apply the patch from bug #432356
diff -Naur debian.orig/patches/uclibc.dpatch debian/patches/uclibc.dpatch
--- debian.orig/patches/uclibc.dpatch	1970-01-01 01:00:00.000000000 +0100
+++ debian/patches/uclibc.dpatch	2007-07-13 14:38:55.000000000 +0200
@@ -0,0 +1,198 @@
+#! /bin/sh -e
+
+# DP: Fix the linker error when creating an xcc for ia64
+
+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
+        ;;
+    -unpatch)
+        patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+        ;;
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1
+esac
+exit 0
+
+--- gcc/libgomp/configure
++++ gcc/libgomp/configure
+@@ -3771,7 +3771,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/libstdc++-v3/configure
++++ gcc/libstdc++-v3/configure
+@@ -4276,7 +4276,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/zlib/configure
++++ gcc/zlib/configure
+@@ -3422,7 +3422,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/libobjc/configure
++++ gcc/libobjc/configure
+@@ -3309,7 +3309,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/libgfortran/configure
++++ gcc/libgfortran/configure
+@@ -3695,7 +3695,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/libmudflap/configure
++++ gcc/libmudflap/configure
+@@ -5378,7 +5378,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/boehm-gc/configure
++++ gcc/boehm-gc/configure
+@@ -4316,7 +4316,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/libffi/configure
++++ gcc/libffi/configure
+@@ -3453,7 +3453,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/libssp/configure
++++ gcc/libssp/configure
+@@ -4409,7 +4409,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/libjava/classpath/ltconfig
++++ gcc/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@
+ 
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+ 
+@@ -1251,7 +1251,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   version_type=linux
+   need_lib_prefix=no
+   need_version=no
+--- gcc/libjava/classpath/configure
++++ gcc/libjava/classpath/configure
+@@ -4665,7 +4665,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/libjava/configure
++++ gcc/libjava/configure
+@@ -5212,7 +5212,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/libtool.m4
++++ gcc/libtool.m4
+@@ -739,7 +739,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+--- gcc/ltconfig
++++ gcc/ltconfig
+@@ -603,7 +603,7 @@
+ 
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+ 
+@@ -1251,7 +1251,7 @@
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   version_type=linux
+   need_lib_prefix=no
+   need_version=no
+
diff -Naur debian.orig/rules.conf debian/rules.conf
--- debian.orig/rules.conf	2007-07-14 15:42:51.000000000 +0200
+++ debian/rules.conf	2007-07-14 14:09:04.000000000 +0200
@@ -36,6 +36,11 @@
     LIBC_DEP = libc6
     LIBC_DEV_DEP = libc6-dev$(LS) (>= $(libc_ver))
   endif
+# fixme:
+  ifeq (,$(findstring $(DEB_TARGET_ARCH),uclibc))
+    LIBC_DEP :=
+    LIBC_DEV_DEP := libuclibc-dev-$(DEB_TARGET_ARCH)-cross
+  endif
 else
   ifeq ($(DEB_TARGET_ARCH_OS),gnu)
     LIBC_DEP = libc0.3
@@ -55,6 +60,7 @@
   endif
 endif
 
+
 LIBC_BIARCH_DEP :=
 LIBC_BIARCH_DEV_DEP :=
 LIBCXX_BIARCH_DEP :=
diff -Naur debian.orig/rules.d/binary-libgcc-cross.mk debian/rules.d/binary-libgcc-cross.mk
--- debian.orig/rules.d/binary-libgcc-cross.mk	2007-07-14 15:42:51.000000000 +0200
+++ debian/rules.d/binary-libgcc-cross.mk	2007-07-14 13:30:12.000000000 +0200
@@ -46,7 +46,7 @@
 	cat debian/$(p_lgcc)/DEBIAN/shlibs >> debian/shlibs.local
 endif
 	ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_lgcc)
-	sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_lgcc).substvars > debian/$(p_lgcc).substvars.new
+	sed -e 's@[ =]lib[^ ,]*@&$(cross_lib_arch)@g' < debian/$(p_lgcc).substvars > debian/$(p_lgcc).substvars.new
 	mv debian/$(p_lgcc).substvars.new debian/$(p_lgcc).substvars
 	dh_gencontrol -p$(p_lgcc) \
 		-- -v$(DEB_LIBGCC_VERSION) $(common_substvars)
@@ -92,7 +92,7 @@
 	cat debian/$(p_l64gcc)/DEBIAN/shlibs >> debian/shlibs.local
 endif
 	ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_l64gcc)
-	sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_l64gcc).substvars > debian/$(p_l64gcc).substvars.new
+	sed -e 's@[ =]lib[^ ,]*@&$(cross_lib_arch)@g' < debian/$(p_l64gcc).substvars > debian/$(p_l64gcc).substvars.new
 	mv debian/$(p_l64gcc).substvars.new debian/$(p_l64gcc).substvars
 	dh_gencontrol -p$(p_l64gcc) \
 		-- -v$(DEB_VERSION) $(common_substvars)
@@ -139,7 +139,7 @@
 	cat debian/$(p_l32gcc)/DEBIAN/shlibs >> debian/shlibs.local
 endif
 	ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_l32gcc)
-	sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_l32gcc).substvars > debian/$(p_l32gcc).substvars.new
+	sed -e 's@[ =]lib[^ ,]*@&$(cross_lib_arch)@g' < debian/$(p_l32gcc).substvars > debian/$(p_l32gcc).substvars.new
 	mv debian/$(p_l32gcc).substvars.new debian/$(p_l32gcc).substvars
 	dh_gencontrol -p$(p_l32gcc) \
 		-- -v$(DEB_VERSION) $(common_substvars)
diff -Naur debian.orig/rules.d/binary-libstdcxx-cross.mk debian/rules.d/binary-libstdcxx-cross.mk
--- debian.orig/rules.d/binary-libstdcxx-cross.mk	2007-07-14 15:42:50.000000000 +0200
+++ debian/rules.d/binary-libstdcxx-cross.mk	2007-07-14 13:31:51.000000000 +0200
@@ -125,7 +125,7 @@
 	sed s/$(cross_lib_arch)//g < debian/$(p_lib)/DEBIAN/shlibs > debian/$(p_lib)/DEBIAN/shlibs.fixed
 	mv debian/$(p_lib)/DEBIAN/shlibs.fixed debian/$(p_lib)/DEBIAN/shlibs
 	ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_lib)
-	sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_lib).substvars > debian/$(p_lib).substvars.new
+	sed -e 's@[ =]lib[^ ,]*@&$(cross_lib_arch)@g' < debian/$(p_lib).substvars > debian/$(p_lib).substvars.new
 	mv debian/$(p_lib).substvars.new debian/$(p_lib).substvars
 	dh_gencontrol -p$(p_lib) -- -v$(DEB_VERSION) $(common_substvars)
 
@@ -175,7 +175,7 @@
 	sed s/$(cross_lib_arch)//g < debian/$(p_lib64)/DEBIAN/shlibs > debian/$(p_lib64)/DEBIAN/shlibs.fixed
 	mv debian/$(p_lib64)/DEBIAN/shlibs.fixed debian/$(p_lib64)/DEBIAN/shlibs
 	ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_lib64)
-	sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_lib64).substvars > debian/$(p_lib64).substvars.new
+	sed -e 's@[ =]lib[^ ,]*@&$(cross_lib_arch)@g' < debian/$(p_lib64).substvars > debian/$(p_lib64).substvars.new
 	mv debian/$(p_lib64).substvars.new debian/$(p_lib64).substvars
 	dh_gencontrol -p$(p_lib64) -- -v$(DEB_VERSION) $(common_substvars)
 	dh_gencontrol -p$(p_dbg64) -- -v$(DEB_VERSION) $(common_substvars)
@@ -226,7 +226,7 @@
 	sed s/$(cross_lib_arch)//g < debian/$(p_lib32)/DEBIAN/shlibs > debian/$(p_lib32)/DEBIAN/shlibs.fixed
 	mv debian/$(p_lib32)/DEBIAN/shlibs.fixed debian/$(p_lib32)/DEBIAN/shlibs
 	ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_lib32)
-	sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_lib32).substvars > debian/$(p_lib32).substvars.new
+	sed -e 's@[ =]lib[^ ,]*@&$(cross_lib_arch)@g' < debian/$(p_lib32).substvars > debian/$(p_lib32).substvars.new
 	mv debian/$(p_lib32).substvars.new debian/$(p_lib32).substvars
 	dh_gencontrol -p$(p_lib32) -- -v$(DEB_VERSION) $(common_substvars)
 	dh_gencontrol -p$(p_dbg32) -- -v$(DEB_VERSION) $(common_substvars)
diff -Naur debian.orig/rules.defs debian/rules.defs
--- debian.orig/rules.defs	2007-07-14 15:42:51.000000000 +0200
+++ debian/rules.defs	2007-07-14 15:16:04.000000000 +0200
@@ -210,10 +210,6 @@
   with_nls := yes
 endif
 
-ifeq (nls, $(findstring nls,$(WITHOUT_LANG)))
-  with_nls := disabled by environment
-endif
-
 ifneq ($(WITH_BOOTSTRAP),)
   # "yes" is the default and causes a 3-stage bootstrap.
   # "no" means to just build the first stage, and not create the stage1
@@ -403,7 +399,7 @@
   ssp_no_archs = arm armel alpha hppa ia64 m68k mips mipsel hurd-i386
 endif
 ssp_no_archs = alpha hppa ia64 m68k mips mipsel hurd-i386
-ifneq (, $(filter $(DEB_TARGET_ARCH),$(ssp_no_archs)))
+ifneq (, $(filter $(DEB_TARGET_ARCH),$(ssp_no_archs) $(ssp_no_archs:%=uclibc-%)))
   with_ssp := not available on $(DEB_TARGET_ARCH)
 endif
 ifeq (ssp, $(findstring ssp,$(WITHOUT_LANG)))
@@ -1030,6 +1026,10 @@
 ifneq (, $(filter $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems)))
   force_gnu_locales := disabled for $(DEB_TARGET_GNU_SYSTEM)
 endif
+ifeq (nls, $(findstring nls,$(WITHOUT_LANG)))
+  with_nls := disabled by environment
+  force_gnu_locales := disabled by environment
+endif
 
 gcc_tarpath		:= $(firstword $(wildcard gcc-*.tar.* /usr/src/gcc-4.2/gcc-*.tar.*))
 gcc_tarball		:= $(notdir $(gcc_tarpath))
diff -Naur debian.orig/rules.parameters debian/rules.parameters
--- debian.orig/rules.parameters	2007-07-14 15:42:51.000000000 +0200
+++ debian/rules.parameters	2007-07-14 13:49:32.000000000 +0200
@@ -30,4 +30,4 @@
 SSP_SONAME	:= 0
 GOMP_SONAME	:= 1
 GCCMATH_SONAME	:= 
-LIBC_DEP		:= libc6
+LIBC_DEP		:= 
diff -Naur debian.orig/rules.patch debian/rules.patch
--- debian.orig/rules.patch	2007-07-14 15:42:51.000000000 +0200
+++ debian/rules.patch	2007-07-13 14:48:57.000000000 +0200
@@ -64,7 +64,7 @@
 	m68k-symbolic-operand \
 	m68k-bitfield-offset \
 	mips-libspec \
-
+	uclibc \
 #	m68k-peephole \
 #	m68k-split_shift \
 #	m68k-dwarf3 \

Reply to: