https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81878

--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Eric Botcazou from comment #16)
> This also breaks 'make all-gnattools' in a bootstrap build:
> 
> g++ -std=gnu++98 -static-libstdc++ -static-libgcc -I- -I../rts -I.
> -I/home/eric/svn/gcc/gcc/ada -static-libstdc++ -static-libgcc  -DIN_GCC  -g
> -O2 -W -Wall -o ../../gnatmake b_gnatm.o a-except.o ali.o ali-util.o
> aspects.o s-casuti.o alloc.o atree.o binderr.o butil.o casing.o csets.o
> debug.o elists.o einfo.o errout.o erroutc.o errutil.o err_vars.o fmap.o
> fname.o fname-uf.o fname-sf.o gnatmake.o gnatvsn.o hostparm.o interfac.o
> i-c.o i-cstrin.o krunch.o lib.o make.o makeusg.o make_util.o namet.o
> nlists.o opt.o osint.o osint-m.o output.o restrict.o rident.o s-exctab.o
> s-secsta.o s-stalib.o s-stoele.o scans.o scng.o sdefault.o sfn_scan.o
> s-purexc.o s-htable.o scil_ll.o sem_aux.o sinfo.o sinput.o sinput-c.o
> snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o switch.o
> switch-m.o table.o targparm.o tempdir.o tree_io.o types.o uintp.o uname.o
> urealp.o usage.o widechar.o  ../link.o ../targext.o ../../ggc-none.o
> ../../libcommon-target.a ../../libcommon.a ../../../libcpp/libcpp.a
> ../rts/libgnat.a   ../../../libbacktrace/.libs/libbacktrace.a
> ../../../libiberty/libiberty.a   -no-pie -ldl
> g++: error: unrecognized command line option ‘-no-pie’
> ../gcc-interface/Makefile:2221: recipe for target '../../gnatmake' failed
> make[2]: *** [../../gnatmake] Error 1
> make[2]: Leaving directory '/home/eric/build/gcc/native/gcc/ada/tools'
> Makefile:188: recipe for target 'gnattools-native' failed
> make[1]: *** [gnattools-native] Error 2
> make[1]: Leaving directory '/home/eric/build/gcc/native/gnattools'
> Makefile:13917: recipe for target 'all-gnattools' failed
> make: *** [all-gnattools] Error 2
> 
> During the bootstrap, CXX is set to /home/eric/build/gcc/native/./gcc/xg++
> -B/home/eric/build/gcc/native/./gcc/ so this still works.

Hmm, all-gnattools does

all-gnattools: configure-gnattools
        @: $(MAKE); $(unstage)
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(HOST_EXPORTS)  \
        (cd $(HOST_SUBDIR)/gnattools && \
          $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
$(STAGE1_FLAGS_TO_PASS)  \
                $(TARGET-gnattools))

so it builds for the host.  But when bootstrapping we want to build it
similar to if it were a target library, that is, with the just built GCC.
So,

host_modules= { module= gnattools; };

is technically not correct.  Not sure how it works during bootstrap, I'd have
expected that the host compiler is used as well (gnattools is not
bootstrapped).

Reply via email to