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

Re: gcc-43 bootstrap patch



Again, this time with attachment.

On 10/03/2008, Jonas Meyer <quitte@gmail.com> wrote:
> Hi.
>  The attached patch allowed me to build gcc-4.3 bootstrap packages.
>  This does not yet handle dependencies at all so the resulting packages
>  have to be force installed because of the missing libgcc package. Also
>  I want to give building --without-libmudflap another try because I'm
>  not happy about the make invocation.
>  If you actually want to give it a try you have to somehow put libc
>  headers in the include directory. For uclibc that is described in the
>  embedded clfs "book". For glibc the clfs 1.0 book should be able to
>  help.
>  I hope this is finally a patch that does not only work on my system.
>  In any case it shouldn'T break native or normal crossbuilds.
>
> Jonas
>
--- gcc-4.3-4.3.0.orig/debian/rules2	2008-03-10 14:10:15.000000000 +0100
+++ gcc-4.3-4.3.0/debian/rules2	2008-03-10 12:24:43.000000000 +0100
@@ -170,13 +170,23 @@
 	--enable-languages=$(subst $(SPACE),$(COMMA),$(enabled_languages)) \
 	--prefix=/$(PF) \
 	--enable-shared \
-	--with-system-zlib \
+	--with-system-zlib
+
+ifneq ($(DEB_CROSS_BOOTSTRAP),yes)
+  CONFARGS += --enable-shared
+else
+  CONFARGS += \
+	--disable-shared \
+	--disable-threads
+endif
 
 ifneq ($(PKGSOURCE),gcc-snapshot)
   CONFARGS += \
 	--libexecdir=/$(libexecdir) \
-	--without-included-gettext \
-	--enable-threads=posix
+	--without-included-gettext 
+  ifneq ($(DEB_CROSS_BOOTSTRAP),yes)
+    CONFARGS += --enable-threads=posix
+   endif
 endif
 
 CONFARGS += $(if $(filter yes,$(with_nls)),--enable-nls,--disable-nls)
@@ -572,6 +582,7 @@
 # DEB_CROSS is never set if REVERSE_CROSS is set and vice-versa.
 # DEB_CROSS build
 ifeq ($(DEB_CROSS),yes)
+  ifneq ($(DEB_CROSS_BOOTSTRAP),yes)
 	: # build cross compiler for $(TARGET_ALIAS)
 	( \
 	  set +e; \
@@ -586,6 +597,22 @@
 	) 2>&1 | tee bootstrap-protocol
 	s=`cat status`; rm -f status; test $$s -eq 0
 else
+	: # build bootstrap cross compiler for $(TARGET_ALIAS)
+	( \
+	  set +e; \
+	  PATH=$(PWD)/bin:$$PATH \
+	  $(SET_LOCPATH) \
+	    $(MAKE) -C $(builddir) $(NJOBS) \
+		CC="$(CC)" \
+		$(CFLAGS_TO_PASS) \
+		$(LDFLAGS_TO_PASS) \
+		all-gcc all-target-libgcc; \
+	  echo $$? > status; \
+	) 2>&1 | tee bootstrap-protocol
+	s=`cat status`; rm -f status; test $$s -eq 0
+endif
+
+else
   # REVERSE_CROSS build
   ifeq ($(REVERSE_CROSS),yes)
 	: # build cross compiler for $(TARGET_ALIAS)
@@ -1412,7 +1439,7 @@
 	mkdir -p $(d)/$(PF)/$(libdir)
 	ln -s $(libdir) $(d)/$(PF)/lib64
 endif
-
+  ifneq ($(DEB_CROSS_BOOTSTRAP),yes)
 	: # Install everything
 	PATH=$(PWD)/bin:$$PATH \
 	$(SET_SHELL) \
@@ -1423,7 +1450,18 @@
 	    infodir=/$(PF)/share/info \
 	    mandir=/$(PF)/share/man \
 		install
-
+  else
+	: # Install everything
+	PATH=$(PWD)/bin:$$PATH \
+	$(SET_SHELL) \
+	  $(MAKE) -C $(builddir) \
+	    $(CFLAGS_TO_PASS) \
+	    $(LDFLAGS_TO_PASS) \
+	    DESTDIR=$(PWD)/$(d) \
+	    infodir=/$(PF)/share/info \
+	    mandir=/$(PF)/share/man \
+		install-gcc install-target-libgcc
+  endif
 ifeq ($(with_common_gcclibdir),yes)
 	mv $(d)/$(subst /$(BASE_VERSION),/$(GCC_VERSION),$(gcc_lib_dir)) \
 		$(d)/$(gcc_lib_dir)
--- gcc-4.3-4.3.0.orig/debian/rules.defs	2008-03-10 14:48:28.000000000 +0100
+++ gcc-4.3-4.3.0/debian/rules.defs	2008-03-10 14:45:46.000000000 +0100
@@ -187,7 +187,11 @@
 
 # ... and some libraries, which do not change (libgcc1, libffi2, libg2c,
 # libmudflap, libssp0).
+ifneq ($(DEB_CROSS_BOOTSTRAP),yes)
 with_common_libs := yes
+else
+with_common_libs := disabled for the bootstrap compiler
+endif
 
 #ifeq ($(distribution),Debian)
 #  next_gcc_not_built := alpha m68k mips mipsel hurd-i386 kfreebsd-i386 kfreebsd-amd64
@@ -215,6 +219,9 @@
 else
   with_nls := yes
 endif
+ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+  with_nls := disabled for the bootstrap compiler
+endif
 with_nls := $(call envfilt, nls, , , $(with_nls))
 
 ifneq ($(WITH_BOOTSTRAP),)
@@ -263,6 +270,9 @@
   with_cxx := yes
 endif
 no_cxx_cpus := avr
+ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+  with_cxx := disabled for the bootstrap compiler
+endif
 ifneq (, $(filter $(DEB_TARGET_ARCH_CPU),$(no_cxx_cpus)))
   with_cxx := disabled for architecture $(DEB_TARGET_ARCH_CPU)
 endif
@@ -337,6 +347,9 @@
 ifeq ($(DEB_CROSS),yes)
   with_java := disabled for cross compiler package
 endif
+ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+  with_java := disabled for the bootstrap compiler
+endif
 with_java := $(call envfilt, java, , c++, $(with_java))
 
 #ifneq (,$(filter $(DEB_TARGET_ARCH),hppa))
@@ -413,6 +426,9 @@
 ifneq (, $(filter $(DEB_TARGET_ARCH),$(ssp_no_archs)))
   with_ssp := not available on $(DEB_TARGET_ARCH)
 endif
+ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+  with_ssp := disabled for the bootstrap compiler
+endif
 with_ssp := $(call envfilt, ssp, , , $(with_ssp))
 
 ifeq ($(with_ssp),yes)
@@ -452,6 +468,9 @@
   ifeq ($(DEB_CROSS),yes)
     with_libffi := disabled for cross compiler package
   endif
+  ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+    with_libffi := disabled for the bootstrap compiler
+  endif
 endif
 
 # Fortran 95 --------------------
@@ -468,6 +487,9 @@
 ifeq ($(DEB_CROSS),yes)
   with_fortran := disabled for cross compiler package
 endif
+ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+  with_fortran := disabled for the bootstrap compiler
+endif
 ifeq (f95, $(findstring f95,$(WITHOUT_LANG)))
   with_fortran := disabled by environment
 endif
@@ -571,6 +593,9 @@
     with_objc := disabled for cross compiler package
   endif
 endif
+ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+  with_objc := disabled for the bootstrap compiler
+endif
 with_objc := $(call envfilt, objc, obj-c++, , $(with_objc))
 ifeq ($(DEB_TARGET_ARCH),armel)
   with_objc := disabled for armel
@@ -598,6 +623,9 @@
 
 # ObjC++ --------------------
 with_objcxx := yes
+ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+  with_objcxx := disabled for the bootstrap compiler
+endif
 with_objcxx := $(call envfilt, obj-c++, , c++ objc, $(with_objcxx))
 
 ifeq ($(with_objcxx),yes)
@@ -626,6 +654,9 @@
 ifeq ($(DEB_CROSS),yes)
   with_ada := disabled for cross compiler package
 endif
+ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+  with_ada := disabled for the bootstrap compiler
+endif
 #ifeq ($(PKGSOURCE),gcc-snapshot)
 #  with_ada := disabled for snapshot builds
 #endif
@@ -718,6 +749,9 @@
 ifeq ($(REVERSE_CROSS),yes)
   with_check := disabled for reverse cross build
 endif
+ifeq ($(DEB_CROSS_BOOTSTRAP),yes)
+  with_check := disabled for the bootstrap compiler
+endif
 check_no_systems := hurd-i386
 ifneq (, $(filter $(DEB_TARGET_GNU_SYSTEM),$(check_no_systems)))
   with_check := disabled for $(DEB_TARGET_GNU_SYSTEM)

Reply to: