[RFC PATCH] update to libtool-2.4.2 and regenerate

Markus Trippelsdorf markus@trippelsdorf.de
Sat Oct 29 09:25:00 GMT 2011


On 2011.10.28 at 07:20 +0200, Markus Trippelsdorf wrote:
> On 2011.10.27 at 17:29 -0700, Andi Kleen wrote:
> > Markus Trippelsdorf <markus@trippelsdorf.de> writes:
> > 
> > > By popular demand, I've prepared a patch that updates the in-tree
> > > libtool to version 2.4.2. It is needed for lto-bootstrap with
> > > -fno-fat-lto-objects and FreeBSD10.x versions. 
> > > It's a pretty big update as you can see by the following diffstat. I
> > > cannot attach the patch even as a gzip file, because of its size:
> > >
> > >  417745 Oct 28 00:47 0001-update-to-libtool-2.4.2-and-regenerate.patch.gz
> > >
> > > Bootstrapped on x86_64-pc-linux-gnu. 
> > 
> > Can you put it up for download somewhere? Does the slim bootstrap
> > now work on Linux?
> 
> http://trippelsdorf.de/0001-update-to-libtool-2.4.2-and-regenerate.patch.bz2
> 
> > I presume it needs at least the gcc-ar patch too, unless you use
> > custom AR/RANLIB wrappers.
> 
> Yes, slim bootstrap now works on Linux. One has to point AR,
> AR_FOR_TARGET, etc. to the wrappers and add "-fuse-linker-plugin" to the
> various CFLAGS (BOOT_CFLAGS, STAGE1_CFLAGS and CFLAGS_FOR_TARGET).

Here is what I use right now:

 % cat config/slim-lto-bootstrap.mk
# This option enables slim LTO for stage2 and stage3.

STAGE2_CFLAGS += -flto=jobserver -fno-fat-lto-objects -frandom-seed=1
STAGE3_CFLAGS += -flto=jobserver -fno-fat-lto-objects -frandom-seed=1
STAGE_CFLAGS += -fuse-linker-plugin
STAGEprofile_CFLAGS += -fno-lto
AR=/usr/local/bin/ar
NM=/usr/local/bin/nm
RANLIB=/usr/local/bin/ranlib
AR_FOR_TARGET=/usr/local/bin/ar
NM_FOR_TARGET=/usr/local/bin/nm
RANLIB_FOR_TARGET=/usr/local/bin/ranlib

And the following patch to force fixincludes to honor CFLAGS:

diff --git a/Makefile.in b/Makefile.in
index d1206bd..3f3f9e0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -2819,6 +2819,7 @@ configure-build-fixincludes:
 	test ! -f $(BUILD_SUBDIR)/fixincludes/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/fixincludes ; \
 	$(BUILD_EXPORTS)  \
+	CFLAGS="$(STAGE_CFLAGS)"; export CFLAGS; \
 	echo Configuring in $(BUILD_SUBDIR)/fixincludes; \
 	cd "$(BUILD_SUBDIR)/fixincludes" || exit 1; \
 	case $(srcdir) in \
@@ -2854,6 +2855,7 @@ all-build-fixincludes: configure-build-fixincludes
 	$(BUILD_EXPORTS)  \
 	(cd $(BUILD_SUBDIR)/fixincludes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS)  \
+		CFLAGS="$(STAGE_CFLAGS)" \
 		$(TARGET-build-fixincludes))
 @endif build-fixincludes
 
@@ -7729,6 +7731,7 @@ configure-fixincludes:
 	test ! -f $(HOST_SUBDIR)/fixincludes/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fixincludes ; \
 	$(HOST_EXPORTS)  \
+	CFLAGS="$(STAGE_CFLAGS)"; export CFLAGS; \
 	echo Configuring in $(HOST_SUBDIR)/fixincludes; \
 	cd "$(HOST_SUBDIR)/fixincludes" || exit 1; \
 	case $(srcdir) in \
@@ -7763,6 +7766,7 @@ all-fixincludes: configure-fixincludes
 	$(HOST_EXPORTS)  \
 	(cd $(HOST_SUBDIR)/fixincludes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)  \
+		CFLAGS="$(STAGE_CFLAGS)" \
 		$(TARGET-fixincludes))
 @endif fixincludes
 

With this in place you can configure and build gcc
--with-build-config=slim-lto-bootstrap .

I haven't figured out yet how to use gcc-ar et al. instead of the shell
wrappers. The plugin path seems to be hardcoded, which is unfortunate.
Would it be possible to make the wrappers more flexible, so that they
could be used during bootstrap?

-- 
Markus



More information about the Gcc-patches mailing list