This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING]^N Fix ppc64 bootstrap with a -m32 host compiler
- From: Nathanael Nerode <neroden at fastmail dot fm>
- To: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Cc: Richard Guenther <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org, dj at redhat dot com, neroden at gcc dot gnu dot org, aoliva at redhat dot com
- Date: Tue, 18 Jul 2006 00:27:32 -0400
- Subject: Re: [PING]^N Fix ppc64 bootstrap with a -m32 host compiler
- References: <200607062258.k66MwlBF025394@earth.phy.uc.edu> <44ADA93C.2000406@fastmail.fm> <44AE0DC5.30003@lu.unisi.ch>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Paolo Bonzini wrote:
>> (1) Stick with the architecture: don't test the newly-built compiler on
>> the gen*.c files, and just build them with the native compiler. In this
>> case, POSTSTAGE1_HOST_EXPORTS should be cleansed of the CC_FOR_BUILD
>> override. (This will work.)
>
>
> This would be a problem because the gen*.c files do test the compiler
> pretty well, and are a heck of a lot easier to debug than GCC itself.
>
>> (2) Decide that we really really want to test the newly-built compiler
>> on the gen*.c files. In this case, the override for BUILD_LIBIBERTY
>> should be passed down from the top level in POSTSTAGE1_HOST_EXPORTS,
>> rather than in the GCC Makefile. (This will also work.)
>
>
> The problem I see with this is that, in the future, people may want to
> have more build libraries than libiberty. And doing this now would add
> to the already awful amount of code duplication and special casing in
> the toplevel.
>
>
> (3) Decide that build *libraries* are different from build *modules*, in
> that post-stage1 host modules should keep using the build modules, but
> should use host libraries instead. Then in configure-stageN-gcc you can
> pass a --with-build-libsubdir=$(HOST_SUBDIR) option that GCC can use to
> find the BUILD_LIBIBERTY. The difference is that the knowledge of which
> directory to use, is now in the toplevel rather than in the GCC directory.
>
> I already sent to Richard a patch to do this, I don't know if he tested
> it. It is attached.
This sounds like a generalization of #2? As such, it sounds good.
> (4) Let GCC find out on its own that it is in post-stage1, and mangle
> the CC_FOR_BUILD appropriately. In this context, the original patch
> would still be a kludge, but at least the kludge would lie entirely in
> the gcc directory rather than being split from the toplevel.
>
> I don't like this, but I can try doing it if you prefer.
No, none of us like this. :-)
>
> As I said, here is the patch for (3), bootstrapped/regtested
> powerpc-apple-darwin8.6.0 where it actually tests almost nothing. Ok
> for mainline if Richard confirms it works?
>
Please put some more documentation comments into the code: it's not
obvious from the resulting file what the function of build_subdir is.
(The function, of course, is exactly what we've been talking about:
simply describe that, preferably nearly the AC_ARG_WITH.)
>
> For 4.3 it should be possible to clean up everything to pass the ../'s
> from the configure script. For now I prefer the definitions of
> build_subdir and build_libsubdir to be coherent.
>
> Paolo
>
>
> ------------------------------------------------------------------------
>
> 2006-04-07 Paolo Bonzini <bonzini@gnu.org>
>
> * Makefile.tpl (configure-stageN-MODULE): Pass --with-build-libsubdir
> for stages after the first.
>
> config:
> 2006-04-07 Paolo Bonzini <bonzini@gnu.org>
>
> * acx.m4: Support --with-build-libsubdir and AC_SUBST
> build_libsubdir.
>
> gcc:
> 2006-04-07 Paolo Bonzini <bonzini@gnu.org>
>
> * configure: Regenerate.
> * Makefile.in (build_libsubdir): New configure substitution
> (build_libobjdir): New variable.
> (BUILD_LIBIBERTY): Use it.
>
> Index: Makefile.tpl
> ===================================================================
> --- Makefile.tpl (revision 114673)
> +++ Makefile.tpl (working copy)
> @@ -802,6 +802,7 @@ configure-stage[+id+]-[+prefix+][+module
> libsrcdir="$$s/[+module+]"; \
> $(SHELL) $${libsrcdir}/configure \
> [+args+] $${srcdiroption} \
> + [+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \
> [+stage_configure_flags+] [+extra_configure_flags+]
> @endif [+prefix+][+module+]-bootstrap
> [+ ENDFOR bootstrap_stage +]
> Index: config/acx.m4
> ===================================================================
> --- config/acx.m4 (revision 114672)
> +++ config/acx.m4 (working copy)
> @@ -76,6 +76,10 @@ AC_DEFUN([GCC_TOPLEV_SUBDIRS],
> AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
> # Prefix 'build-' so this never conflicts with target_subdir.
> build_subdir="build-${build_noncanonical}"
> +AC_ARG_WITH(build-libsubdir,
> +[ --with-build-libsubdir=[DIR] Directory where to find libraries for build system],
> +build_libsubdir="$withval",
> +build_libsubdir="$build_subdir")
> # --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
> if ( test $srcdir = . && test -d gcc ) \
> || test -d $srcdir/../host-${host_noncanonical}; then
> @@ -85,6 +89,7 @@ else
> fi
> # No prefix.
> target_subdir=${target_noncanonical}
> +AC_SUBST([build_libsubdir]) []dnl
> AC_SUBST([build_subdir]) []dnl
> AC_SUBST([host_subdir]) []dnl
> AC_SUBST([target_subdir]) []dnl
> Index: gcc/Makefile.in
> ===================================================================
> --- gcc/Makefile.in (revision 114673)
> +++ gcc/Makefile.in (working copy)
> @@ -86,11 +86,14 @@ objdir = @objdir@
>
> host_subdir=@host_subdir@
> build_subdir=@build_subdir@
> +build_libsubdir=@build_libsubdir@
>
> ifeq ($(host_subdir),.)
> build_objdir := ../$(build_subdir)
> +build_libobjdir := ../$(build_libsubdir)
> else
> build_objdir := ../../$(build_subdir)
> +build_libobjdir := ../../$(build_libsubdir)
> endif
>
> # --------
> @@ -831,7 +834,7 @@ ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) $
>
> # Build and host support libraries.
> LIBIBERTY = ../libiberty/libiberty.a
> -BUILD_LIBIBERTY = $(build_objdir)/libiberty/libiberty.a
> +BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
>
> # Dependencies on the intl and portability libraries.
> LIBDEPS= $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) $(LIBDECNUMBER)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQFEvGMzRGZ0aC4lkIIRAkwaAJ9H8rL+xabLEL0UODloThUKgf583ACdFG0P
wZkiQvwOj4ri+YSI18NVSSs=
=QePm
-----END PGP SIGNATURE-----