This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix genmatch linking
- From: Richard Biener <rguenther at suse dot de>
- To: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: gcc-patches at gcc dot gnu dot org, Jakub Jelinek <jakub at redhat dot com>
- Date: Thu, 23 Oct 2014 15:02:10 +0200 (CEST)
- Subject: Re: [PATCH] Fix genmatch linking
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1410231046100 dot 9891 at zhemvz dot fhfr dot qr> <ydd7fzrnecy dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE>
On Thu, 23 Oct 2014, Rainer Orth wrote:
> Richard Biener <rguenther@suse.de> writes:
>
> > This adds a libcpp host module without NLS and ICONV support
> > and properly links genmatch against the build libcpp instead of
> > the host one.
> >
> > Bootstrap running on x86_64-unknown-linux-gnu (stage1 all-gcc
> > finished fine).
>
> Unfortunately, this doesn't work on i386-pc-solaris2.10:
>
> In stage1, build/genmatch is linked correctly
>
> g++ -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc -o build/genmatch \
> build/genmatch.o ../build-i386-pc-solaris2.10/libcpp/libcpp.a build/errors.o build/vec.o build/hash-table.o ../build-i386-pc-solaris2.10/libiberty/libiberty.a
>
> OTOH, in stage2, I get
>
> /var/gcc/regression/trunk/10-gcc/build/./prev-gcc/xg++ -B/var/gcc/regression/trunk/10-gcc/build/./prev-gcc/ -B/vol/gcc/i386-pc-solaris2.10/bin/ -nostdinc++ -B/var/gcc/regression/trunk/10-gcc/build/prev-i386-pc-solaris2.10/libstdc++-v3/src/.libs -B/var/gcc/regression/trunk/10-gcc/build/prev-i386-pc-solaris2.10/libstdc++-v3/libsupc++/.libs -I/var/gcc/regression/trunk/10-gcc/build/prev-i386-pc-solaris2.10/libstdc++-v3/include/i386-pc-solaris2.10 -I/var/gcc/regression/trunk/10-gcc/build/prev-i386-pc-solaris2.10/libstdc++-v3/include -I/vol/gcc/src/hg/trunk/local/libstdc++-v3/libsupc++ -L/var/gcc/regression/trunk/10-gcc/build/prev-i386-pc-solaris2.10/libstdc++-v3/src/.libs -L/var/gcc/regression/trunk/10-gcc/build/prev-i386-pc-solaris2.10/libstdc++-v3/libsupc++/.libs -g -O2 -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc -o build/genmatch \
> build/genmatch.o .././libcpp/libcpp.a build/errors.o build/vec.o build/hash-table.o .././libiberty/libiberty.a
> Undefined first referenced
> symbol in file
> libintl_bindtextdomain .././libcpp/libcpp.a(init.o)
> libintl_dgettext .././libcpp/libcpp.a(errors.o)
> ld: fatal: symbol referencing errors. No output written to build/genmatch
> collect2: error: ld returned 1 exit status
> make[3]: *** [build/genmatch] Error 1
>
> Diffing the stage1 and 2 gcc/Makefiles, I see
>
> --- prev-gcc/Makefile 2014-10-23 13:45:20.720460523 +0200
> +++ gcc/Makefile 2014-10-23 14:32:06.111476537 +0200
> @@ -86 +86 @@
> -build_libsubdir=build-i386-pc-solaris2.10
> +build_libsubdir=.
Hmm, why do stage2+ use the host libraries? Ah, because they can
assume that host == build. Ok, so when bootstrapping you then
need to link libcpp dependencies as well, for stage2+. Not sure
how to achieve that. I guess doing sth in gcc/configure - but
how does that know what stage we are in?
Richard.