public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix genmatch linking
@ 2014-10-23  9:01 Richard Biener
  2014-10-23  9:16 ` Jakub Jelinek
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Richard Biener @ 2014-10-23  9:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jakub Jelinek


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).

Ok for trunk?

Thanks,
Richard.

2014-10-23  Richard Biener  <rguenther@suse.de>

	* Makefile.def: Add libcpp build module and dependencies.
	* configure.ac: Add libcpp build module.
	* Makefile.in: Regenerate.
	* configure: Likewise.

	gcc/
	* Makefile.in (BUILD_CPPLIB): Add.
	(build/genmatch$(build_exeext)): Use BUILD_CPPLIB, not CPPLIB.
	Drop LIBIBERTY.

Index: Makefile.def
===================================================================
--- Makefile.def	(revision 216543)
+++ Makefile.def	(working copy)
@@ -30,6 +30,8 @@ build_modules= { module= flex; };
 build_modules= { module= m4; };
 build_modules= { module= texinfo; };
 build_modules= { module= fixincludes; };
+build_modules= { module= libcpp;
+                 extra_configure_flags='--disable-nls am_cv_func_iconv=no';};
 
 host_modules= { module= bfd; bootstrap=true; };
 host_modules= { module= opcodes; bootstrap=true; };
@@ -301,6 +303,7 @@ dependencies = { module=all-build-flex;
 dependencies = { module=all-build-libiberty; on=all-build-texinfo; };
 dependencies = { module=all-build-m4; on=all-build-texinfo; };
 dependencies = { module=all-build-fixincludes; on=all-build-libiberty; };
+dependencies = { module=all-build-libcpp; on=all-build-libiberty; };
 
 // Host modules specific to gcc.
 dependencies = { module=configure-gcc; on=configure-intl; };
@@ -321,6 +324,7 @@ dependencies = { module=all-gcc; on=all-
 dependencies = { module=all-gcc; on=all-build-flex; };
 dependencies = { module=all-gcc; on=all-build-libiberty; };
 dependencies = { module=all-gcc; on=all-build-fixincludes; };
+dependencies = { module=all-gcc; on=all-build-libcpp; };
 dependencies = { module=all-gcc; on=all-zlib; };
 dependencies = { module=all-gcc; on=all-libbacktrace; hard=true; };
 dependencies = { module=all-gcc; on=all-libcpp; hard=true; };
Index: configure.ac
===================================================================
--- configure.ac	(revision 216543)
+++ configure.ac	(working copy)
@@ -126,7 +126,7 @@ extra_host_args=
 # these library is used by various programs built for the build
 # environment
 #
-build_libs="build-libiberty"
+build_libs="build-libiberty build-libcpp"
 
 # these tools are built for the build environment
 build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes"
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 216543)
+++ gcc/Makefile.in	(working copy)
@@ -981,6 +981,7 @@ else
 LIBIBERTY = ../libiberty/libiberty.a
 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
 endif
+BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
 
 # Dependencies on the intl and portability libraries.
 LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \
@@ -2520,7 +2521,7 @@ genprog = $(genprogerr) check checksum c
 # These programs need libs over and above what they get from the above list.
 build/genautomata$(build_exeext) : BUILD_LIBS += -lm
 
-build/genmatch$(build_exeext) : $(CPPLIB) $(LIBIBERTY) \
+build/genmatch$(build_exeext) : $(BUILD_CPPLIB) \
   $(BUILD_ERRORS) build/vec.o build/hash-table.o
 
 # These programs are not linked with the MD reader.
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 216543)
+++ Makefile.in	(working copy)
@@ -991,6 +991,7 @@ all-build: maybe-all-build-flex
 all-build: maybe-all-build-m4
 all-build: maybe-all-build-texinfo
 all-build: maybe-all-build-fixincludes
+all-build: maybe-all-build-libcpp
 
 .PHONY: all-host
 
@@ -3005,6 +3006,63 @@ all-build-fixincludes: configure-build-f
 
 
 
+.PHONY: configure-build-libcpp maybe-configure-build-libcpp
+maybe-configure-build-libcpp:
+@if gcc-bootstrap
+configure-build-libcpp: stage_current
+@endif gcc-bootstrap
+@if build-libcpp
+maybe-configure-build-libcpp: configure-build-libcpp
+configure-build-libcpp: 
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	test ! -f $(BUILD_SUBDIR)/libcpp/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/libcpp ; \
+	$(BUILD_EXPORTS)  \
+	echo Configuring in $(BUILD_SUBDIR)/libcpp; \
+	cd "$(BUILD_SUBDIR)/libcpp" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(BUILD_SUBDIR)/libcpp/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libcpp; \
+	rm -f no-such-file || : ; \
+	CONFIG_SITE=no-such-file $(SHELL) \
+	  $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \
+	  --target=${target_alias} --disable-nls am_cv_func_iconv=no \
+	  || exit 1
+@endif build-libcpp
+
+
+
+
+
+.PHONY: all-build-libcpp maybe-all-build-libcpp
+maybe-all-build-libcpp:
+@if gcc-bootstrap
+all-build-libcpp: stage_current
+@endif gcc-bootstrap
+@if build-libcpp
+TARGET-build-libcpp=all
+maybe-all-build-libcpp: all-build-libcpp
+all-build-libcpp: configure-build-libcpp
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS)  \
+	(cd $(BUILD_SUBDIR)/libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS)   \
+		$(TARGET-build-libcpp))
+@endif build-libcpp
+
+
+
+
+
 # --------------------------------------
 # Modules which run on the host machine
 # --------------------------------------
@@ -48047,6 +48105,7 @@ all-build-flex: maybe-all-build-m4
 all-build-libiberty: maybe-all-build-texinfo
 all-build-m4: maybe-all-build-texinfo
 all-build-fixincludes: maybe-all-build-libiberty
+all-build-libcpp: maybe-all-build-libiberty
 configure-gcc: maybe-configure-intl
 
 configure-stage1-gcc: maybe-configure-stage1-intl
@@ -48191,6 +48250,14 @@ all-stage3-gcc: maybe-all-build-fixinclu
 all-stage4-gcc: maybe-all-build-fixincludes
 all-stageprofile-gcc: maybe-all-build-fixincludes
 all-stagefeedback-gcc: maybe-all-build-fixincludes
+all-gcc: maybe-all-build-libcpp
+
+all-stage1-gcc: maybe-all-build-libcpp
+all-stage2-gcc: maybe-all-build-libcpp
+all-stage3-gcc: maybe-all-build-libcpp
+all-stage4-gcc: maybe-all-build-libcpp
+all-stageprofile-gcc: maybe-all-build-libcpp
+all-stagefeedback-gcc: maybe-all-build-libcpp
 all-gcc: maybe-all-zlib
 
 all-stage1-gcc: maybe-all-stage1-zlib
Index: configure
===================================================================
--- configure	(revision 216543)
+++ configure	(working copy)
@@ -2713,7 +2713,7 @@ extra_host_args=
 # these library is used by various programs built for the build
 # environment
 #
-build_libs="build-libiberty"
+build_libs="build-libiberty build-libcpp"
 
 # these tools are built for the build environment
 build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes"

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-23  9:01 [PATCH] Fix genmatch linking Richard Biener
@ 2014-10-23  9:16 ` Jakub Jelinek
  2014-10-23 12:51 ` Rainer Orth
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Jakub Jelinek @ 2014-10-23  9:16 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Thu, Oct 23, 2014 at 10:47:43AM +0200, Richard Biener wrote:
> 
> 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).
> 
> Ok for trunk?

Ok, thanks.

> 2014-10-23  Richard Biener  <rguenther@suse.de>
> 
> 	* Makefile.def: Add libcpp build module and dependencies.
> 	* configure.ac: Add libcpp build module.
> 	* Makefile.in: Regenerate.
> 	* configure: Likewise.
> 
> 	gcc/
> 	* Makefile.in (BUILD_CPPLIB): Add.
> 	(build/genmatch$(build_exeext)): Use BUILD_CPPLIB, not CPPLIB.
> 	Drop LIBIBERTY.

	Jakub

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-23  9:01 [PATCH] Fix genmatch linking Richard Biener
  2014-10-23  9:16 ` Jakub Jelinek
@ 2014-10-23 12:51 ` Rainer Orth
  2014-10-23 13:10   ` Richard Biener
  2014-10-23 21:35 ` Richard Sandiford
  2014-10-24  4:32 ` PATCH: fix breakage from "[PATCH] Fix genmatch linking" Hans-Peter Nilsson
  3 siblings, 1 reply; 23+ messages in thread
From: Rainer Orth @ 2014-10-23 12:51 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, Jakub Jelinek

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=.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-23 12:51 ` Rainer Orth
@ 2014-10-23 13:10   ` Richard Biener
  2014-10-23 14:18     ` Richard Biener
  0 siblings, 1 reply; 23+ messages in thread
From: Richard Biener @ 2014-10-23 13:10 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Jakub Jelinek

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3175 bytes --]

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.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-23 13:10   ` Richard Biener
@ 2014-10-23 14:18     ` Richard Biener
  2014-10-23 14:30       ` Richard Biener
  0 siblings, 1 reply; 23+ messages in thread
From: Richard Biener @ 2014-10-23 14:18 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Jakub Jelinek

[-- Attachment #1: Type: TEXT/PLAIN, Size: 4025 bytes --]

On Thu, 23 Oct 2014, Richard Biener wrote:

> 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-macro
 s -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?

I wonder if the following works

Richard.

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 216590)
+++ gcc/Makefile.in	(working copy)
@@ -981,7 +981,15 @@ else
 LIBIBERTY = ../libiberty/libiberty.a
 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
 endif
+ifeq ($(current_stage),stage1)
 BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
+else
+ifeq ($(current_stage),)
+BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
+else
+BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) ($LIBICONV_DEP)
+endif
+endif
 
 # Dependencies on the intl and portability libraries.
 LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-23 14:18     ` Richard Biener
@ 2014-10-23 14:30       ` Richard Biener
  2014-10-23 14:37         ` Richard Biener
  0 siblings, 1 reply; 23+ messages in thread
From: Richard Biener @ 2014-10-23 14:30 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Jakub Jelinek

[-- Attachment #1: Type: TEXT/PLAIN, Size: 5210 bytes --]

On Thu, 23 Oct 2014, Richard Biener wrote:

> On Thu, 23 Oct 2014, Richard Biener wrote:
> 
> > 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-mac
 ros -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?
> 
> I wonder if the following works

Or this one.

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in     (revision 216590)
+++ gcc/Makefile.in     (working copy)
@@ -981,7 +981,14 @@ else
 LIBIBERTY = ../libiberty/libiberty.a
 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
 endif
+# For stage1 and when cross-compiling use the build libcpp which is
+# built with NLS disabled.  For stage2+ use the host library and
+# its dependencies.
+ifeq ($(build_objdir),$(build_libobjdir))
 BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
+else
+BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP)
+endif
 
 # Dependencies on the intl and portability libraries.
 LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) 
$(LIBICONV_DEP) \

pre-approved if it works for you.

Richard.

> Richard.
> 
> Index: gcc/Makefile.in
> ===================================================================
> --- gcc/Makefile.in	(revision 216590)
> +++ gcc/Makefile.in	(working copy)
> @@ -981,7 +981,15 @@ else
>  LIBIBERTY = ../libiberty/libiberty.a
>  BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
>  endif
> +ifeq ($(current_stage),stage1)
>  BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
> +else
> +ifeq ($(current_stage),)
> +BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
> +else
> +BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) ($LIBICONV_DEP)
> +endif
> +endif
>  
>  # Dependencies on the intl and portability libraries.
>  LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \

-- 
Richard Biener <rguenther@suse.de>
SUSE / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imend"orffer

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-23 14:30       ` Richard Biener
@ 2014-10-23 14:37         ` Richard Biener
  2014-10-23 14:38           ` Richard Biener
  2014-10-23 15:27           ` Jakub Jelinek
  0 siblings, 2 replies; 23+ messages in thread
From: Richard Biener @ 2014-10-23 14:37 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Jakub Jelinek


Final try for today.

Richard.

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 216590)
+++ gcc/Makefile.in	(working copy)
@@ -981,7 +981,15 @@ else
 LIBIBERTY = ../libiberty/libiberty.a
 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
 endif
+# For stage1 and when cross-compiling use the build libcpp which is
+# built with NLS disabled.  For stage2+ use the host library and
+# its dependencies.
+ifeq ($(build_objdir),$(build_libobjdir))
 BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
+else
+BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL) $(LIBICONV) $(LIBINTL_DEP) $(LIBICONV_DEP)
+build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
+endif
 
 # Dependencies on the intl and portability libraries.
 LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-23 14:37         ` Richard Biener
@ 2014-10-23 14:38           ` Richard Biener
  2014-10-24  7:56             ` Rainer Orth
  2014-10-23 15:27           ` Jakub Jelinek
  1 sibling, 1 reply; 23+ messages in thread
From: Richard Biener @ 2014-10-23 14:38 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Jakub Jelinek

On Thu, 23 Oct 2014, Richard Biener wrote:

> 
> Final try for today.

And this may work as well and is slightly simpler.

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 216590)
+++ gcc/Makefile.in	(working copy)
@@ -981,7 +981,15 @@ else
 LIBIBERTY = ../libiberty/libiberty.a
 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
 endif
+# For stage1 and when cross-compiling use the build libcpp which is
+# built with NLS disabled.  For stage2+ use the host library and
+# its dependencies.
+ifeq ($(build_objdir),$(build_libobjdir))
 BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
+else
+BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL) $(LIBICONV)
+build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
+endif
 
 # Dependencies on the intl and portability libraries.
 LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \


Can you test it please?

Thanks,
Richard.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-23 14:37         ` Richard Biener
  2014-10-23 14:38           ` Richard Biener
@ 2014-10-23 15:27           ` Jakub Jelinek
  1 sibling, 0 replies; 23+ messages in thread
From: Jakub Jelinek @ 2014-10-23 15:27 UTC (permalink / raw)
  To: Richard Biener; +Cc: Rainer Orth, gcc-patches

On Thu, Oct 23, 2014 at 04:31:36PM +0200, Richard Biener wrote:
> 
> Final try for today.
> 
> Richard.
> 
> Index: gcc/Makefile.in
> ===================================================================
> --- gcc/Makefile.in	(revision 216590)
> +++ gcc/Makefile.in	(working copy)
> @@ -981,7 +981,15 @@ else
>  LIBIBERTY = ../libiberty/libiberty.a
>  BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
>  endif
> +# For stage1 and when cross-compiling use the build libcpp which is
> +# built with NLS disabled.  For stage2+ use the host library and
> +# its dependencies.
> +ifeq ($(build_objdir),$(build_libobjdir))
>  BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
> +else
> +BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL) $(LIBICONV) $(LIBINTL_DEP) $(LIBICONV_DEP)

The  $(LIBINTL_DEP) $(LIBICONV_DEP) on the above line is unnecessary IMHO,
# Rule for the generator programs:
$(genprog:%=build/gen%$(build_exeext)): build/gen%$(build_exeext): build/gen%.o $(BUILD_LIBDEPS)
        +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \
            $(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS)
adds that automatically.

> +build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)

Here it is needed supposedly.

> +endif
>  
>  # Dependencies on the intl and portability libraries.
>  LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \

	Jakub

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-23  9:01 [PATCH] Fix genmatch linking Richard Biener
  2014-10-23  9:16 ` Jakub Jelinek
  2014-10-23 12:51 ` Rainer Orth
@ 2014-10-23 21:35 ` Richard Sandiford
  2014-10-24  8:00   ` Richard Biener
  2014-10-24  4:32 ` PATCH: fix breakage from "[PATCH] Fix genmatch linking" Hans-Peter Nilsson
  3 siblings, 1 reply; 23+ messages in thread
From: Richard Sandiford @ 2014-10-23 21:35 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, Jakub Jelinek

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).
>
> Ok for trunk?
>
> Thanks,
> Richard.
>
> 2014-10-23  Richard Biener  <rguenther@suse.de>
>
> 	* Makefile.def: Add libcpp build module and dependencies.
> 	* configure.ac: Add libcpp build module.
> 	* Makefile.in: Regenerate.
> 	* configure: Likewise.
>
> 	gcc/
> 	* Makefile.in (BUILD_CPPLIB): Add.
> 	(build/genmatch$(build_exeext)): Use BUILD_CPPLIB, not CPPLIB.
> 	Drop LIBIBERTY.

This breaks a -j1 (!) build on x86_64-linux-gnu for me with:

g++  -I/blah/libcpp -I. -I/blah/libcpp/../include -I/blah/libcpp/include  -g -O2 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I/blah/libcpp -I. -I/blah/libcpp/../include -I/blah/libcpp/include   -c -o charset.o -MT charset.o -MMD -MP -MF .deps/charset.Tpo /blah/libcpp/charset.c
In file included from /blah/libcpp/../include/hashtab.h:40:0,
                 from /blah/libcpp/../include/filenames.h:29,
                 from /blah/libcpp/system.h:367,
                 from /blah/libcpp/charset.c:21:
/blah/libcpp/../include/ansidecl.h:171:64: error: new declaration ‘char* basename(const char*)’
 #  define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
                                                                ^
/blah/libcpp/../include/libiberty.h:113:64: note: in expansion of macro ‘ATTRIBUTE_NONNULL’
 extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
                                                                ^
In file included from /blah/libcpp/system.h:201:0,
                 from /blah/libcpp/charset.c:21:
/usr/include/string.h:597:26: error: ambiguates old declaration ‘const char* basename(const char*)’
 extern "C++" const char *basename (const char *__filename)
                          ^
make: *** [charset.o] Error 1

The build libiberty and libcpp share a config.cache file and both check
for basename.  The problem is that libiberty is built without _GNU_SOURCE
and doesn't see the declaration while libcpp is built with it and does
see the declaration.  So if libiberty configures first we assume basename
isn't available.  If they both configure at the same time we're OK.

Thanks,
Richard

^ permalink raw reply	[flat|nested] 23+ messages in thread

* PATCH: fix breakage from "[PATCH] Fix genmatch linking"
  2014-10-23  9:01 [PATCH] Fix genmatch linking Richard Biener
                   ` (2 preceding siblings ...)
  2014-10-23 21:35 ` Richard Sandiford
@ 2014-10-24  4:32 ` Hans-Peter Nilsson
  2014-10-24  5:02   ` Hans-Peter Nilsson
                     ` (2 more replies)
  3 siblings, 3 replies; 23+ messages in thread
From: Hans-Peter Nilsson @ 2014-10-24  4:32 UTC (permalink / raw)
  To: rguenther; +Cc: gcc-patches, jakub

> From: Richard Biener <rguenther@suse.de>
> Date: Thu, 23 Oct 2014 10:47:43 +0200

> 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).
> 
> Ok for trunk?
> 
> Thanks,
> Richard.
> 
> 2014-10-23  Richard Biener  <rguenther@suse.de>
> 
> 	* Makefile.def: Add libcpp build module and dependencies.
> 	* configure.ac: Add libcpp build module.
> 	* Makefile.in: Regenerate.
> 	* configure: Likewise.

You only exposed a dormant issue, but ever since this commit
(nominally, some commit in "(216573:216588]" but I only see this
one matching) I see, for cross-builds (to cris-elf):

make[2]: Entering directory `/tmp/hpautotest-gcc1/cris-elf/gccobj/build-x86_64-unknown-linux-gnu/libcpp'
g++  -I/tmp/hpautotest-gcc1/gcc/libcpp -I. -I/tmp/hpautotest-gcc1/gcc/libcpp/../include -I/tmp/hpautotest-gcc1/gcc/libcpp/include  -g -O2 -W -Wall -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I/tmp/hpautotest-gcc1/gcc/libcpp -I. -I/tmp/hpautotest-gcc1/gcc/libcpp/../include -I/tmp/hpautotest-gcc1/gcc/libcpp/include   -c -o charset.o -MT charset.o -MMD -MP -MF .deps/charset.Tpo /tmp/hpautotest-gcc1/gcc/libcpp/charset.c
In file included from /tmp/hpautotest-gcc1/gcc/libcpp/system.h:370,
                 from /tmp/hpautotest-gcc1/gcc/libcpp/charset.c:21:
/tmp/hpautotest-gcc1/gcc/libcpp/../include/libiberty.h:113: error: new declaration 'char* basename(const char*)'
/usr/include/string.h:601: error: ambiguates old declaration 'const char* basename(const char*)'
make[2]: *** [charset.o] Error 1
make[2]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj/build-x86_64-unknown-linux-gnu/libcpp'
make[1]: *** [all-build-libcpp] Error 2
make[1]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj'
make: *** [all] Error 2

Above that, we have:
checking whether basename is declared... (cached) no

and above that, we have:
make[2]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj/build-x86_64-unknown-linux-gnu/fixincludes'
mkdir -p -- build-x86_64-unknown-linux-gnu/libcpp
Configuring in build-x86_64-unknown-linux-gnu/libcpp
configure: loading cache ../config.cache

which is apparently set due to (above that, first non-cached):
mkdir -p -- build-x86_64-unknown-linux-gnu/libiberty
Configuring in build-x86_64-unknown-linux-gnu/libiberty
configure: creating cache ../config.cache
...
checking whether basename is declared... no

Your commit introduces build-subdirectories for cross-builds.
Build-subdirs share a config.cache (in build-<host>/config.cache),
with subdirs in build-<host> being fixincludes, libcpp and
libiberty.

But, libiberty and fixincludes are configure-tested and compiled
using gcc, while libcpp is compiled with g++, which causes a
different set of declarations to be exposed, so the shared
config.cache is invalid and its use is bogus.  Not sure how this
works for native builds.

The libcpp configure checks are actually run with gcc which is
bogus by itself, but apparently working.  I guess the C vs. C++
declaration etc. differences for libcpp are mostly hidden by
using _GNU_SOURCE (through AC_USE_SYSTEM_EXTENSIONS), and I'm a
bit surprised that's not used for libiberty and fixincludes.
Still, a red herring.  Aligning those options *may* cause the
build to succeed, but I think that'd be too much of sweeping the
issue under the carpet.

It seems "more correct" to just disable the config.cache sharing
between the differently-configured build-subdirectories, as is
already is done for host-libraries and target-libraries, even if
that may slow down the builds.  (Erroring out is infinitely
slower. :)  Still, I don't understand exactly how your patch
introduces build-subdirectories where there were none before.
Maybe that "+all-gcc: maybe-all-build-libcpp" was wrong and
should be different?

Anyway, with this, a cris-elf cross build passes the point of
failure; compilers and libraries built, progressing into
testing.

Ok to commit?

toplev:
	* configure.ac (build_configargs): Don't share
	config.cache between build subdirs.

Index: configure.ac
===================================================================
--- configure.ac	(revision 216610)
+++ configure.ac	(working copy)
@@ -2922,8 +2922,10 @@ AC_ARG_VAR([target_configargs],
 
 # For the build-side libraries, we just need to pretend we're native,
 # and not use the same cache file.  Multilibs are neither needed nor
-# desired.
-build_configargs="$build_configargs --cache-file=../config.cache ${baseargs}"
+# desired.  We can't even use the same cache file for all build-side
+# libraries, as they're compiled differently; some with C, some with
+# C++ or with different feature-enabling options.
+build_configargs="$build_configargs --cache-file=./config.cache ${baseargs}"
 
 # For host modules, accept cache file option, or specification as blank.
 case "${cache_file}" in
Index: configure
===================================================================
--- configure	(revision 216610)
+++ configure	(working copy)
@@ -7386,8 +7386,10 @@ tbaseargs="$tbaseargs --disable-option-c
 
 # For the build-side libraries, we just need to pretend we're native,
 # and not use the same cache file.  Multilibs are neither needed nor
-# desired.
-build_configargs="$build_configargs --cache-file=../config.cache ${baseargs}"
+# desired.  We can't even use the same cache file for all build-side
+# libraries, as they're compiled differently; some with C, some with
+# C++ or with different feature-enabling options.
+build_configargs="$build_configargs --cache-file=./config.cache ${baseargs}"
 
 # For host modules, accept cache file option, or specification as blank.
 case "${cache_file}" in

brgds, H-P

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: PATCH: fix breakage from "[PATCH] Fix genmatch linking"
  2014-10-24  4:32 ` PATCH: fix breakage from "[PATCH] Fix genmatch linking" Hans-Peter Nilsson
@ 2014-10-24  5:02   ` Hans-Peter Nilsson
  2014-10-24  8:03   ` Richard Biener
  2014-10-29  0:22   ` Paolo Bonzini
  2 siblings, 0 replies; 23+ messages in thread
From: Hans-Peter Nilsson @ 2014-10-24  5:02 UTC (permalink / raw)
  To: hp; +Cc: rguenther, gcc-patches, jakub

> From: Hans-Peter Nilsson <hp@axis.com>
> Date: Fri, 24 Oct 2014 06:32:06 +0200

> The libcpp configure checks are actually run with gcc which is
> bogus by itself, but apparently working.  I guess the C vs. C++
> declaration etc. differences for libcpp are mostly hidden by
> using _GNU_SOURCE (through AC_USE_SYSTEM_EXTENSIONS), and I'm a
> bit surprised that's not used for libiberty and fixincludes.

Bah, I was confused by a cached value; strike "and fixincludes".

> Still, a red herring.

brgds, H-P

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-23 14:38           ` Richard Biener
@ 2014-10-24  7:56             ` Rainer Orth
  2014-10-24  8:07               ` Richard Biener
  0 siblings, 1 reply; 23+ messages in thread
From: Rainer Orth @ 2014-10-24  7:56 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, Jakub Jelinek

Richard Biener <rguenther@suse.de> writes:

> On Thu, 23 Oct 2014, Richard Biener wrote:
>
>> 
>> Final try for today.
>
> And this may work as well and is slightly simpler.
>
> Index: gcc/Makefile.in
> ===================================================================
> --- gcc/Makefile.in	(revision 216590)
> +++ gcc/Makefile.in	(working copy)
> @@ -981,7 +981,15 @@ else
>  LIBIBERTY = ../libiberty/libiberty.a
>  BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
>  endif
> +# For stage1 and when cross-compiling use the build libcpp which is
> +# built with NLS disabled.  For stage2+ use the host library and
> +# its dependencies.
> +ifeq ($(build_objdir),$(build_libobjdir))
>  BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
> +else
> +BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL) $(LIBICONV)
> +build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
> +endif
>  
>  # Dependencies on the intl and portability libraries.
>  LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \
>
>
> Can you test it please?

Sure: this version allowed an i386-pc-solaris2.10 bootstrap to complete
just fine.

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-23 21:35 ` Richard Sandiford
@ 2014-10-24  8:00   ` Richard Biener
  0 siblings, 0 replies; 23+ messages in thread
From: Richard Biener @ 2014-10-24  8:00 UTC (permalink / raw)
  To: Richard Sandiford; +Cc: gcc-patches, Jakub Jelinek

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3234 bytes --]

On Thu, 23 Oct 2014, Richard Sandiford 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).
> >
> > Ok for trunk?
> >
> > Thanks,
> > Richard.
> >
> > 2014-10-23  Richard Biener  <rguenther@suse.de>
> >
> > 	* Makefile.def: Add libcpp build module and dependencies.
> > 	* configure.ac: Add libcpp build module.
> > 	* Makefile.in: Regenerate.
> > 	* configure: Likewise.
> >
> > 	gcc/
> > 	* Makefile.in (BUILD_CPPLIB): Add.
> > 	(build/genmatch$(build_exeext)): Use BUILD_CPPLIB, not CPPLIB.
> > 	Drop LIBIBERTY.
> 
> This breaks a -j1 (!) build on x86_64-linux-gnu for me with:
> 
> g++  -I/blah/libcpp -I. -I/blah/libcpp/../include -I/blah/libcpp/include  -g -O2 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I/blah/libcpp -I. -I/blah/libcpp/../include -I/blah/libcpp/include   -c -o charset.o -MT charset.o -MMD -MP -MF .deps/charset.Tpo /blah/libcpp/charset.c
> In file included from /blah/libcpp/../include/hashtab.h:40:0,
>                  from /blah/libcpp/../include/filenames.h:29,
>                  from /blah/libcpp/system.h:367,
>                  from /blah/libcpp/charset.c:21:
> /blah/libcpp/../include/ansidecl.h:171:64: error: new declaration ‘char* basename(const char*)’
>  #  define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
>                                                                 ^
> /blah/libcpp/../include/libiberty.h:113:64: note: in expansion of macro ‘ATTRIBUTE_NONNULL’
>  extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
>                                                                 ^
> In file included from /blah/libcpp/system.h:201:0,
>                  from /blah/libcpp/charset.c:21:
> /usr/include/string.h:597:26: error: ambiguates old declaration ‘const char* basename(const char*)’
>  extern "C++" const char *basename (const char *__filename)
>                           ^
> make: *** [charset.o] Error 1
> 
> The build libiberty and libcpp share a config.cache file and both check

Ugh - why do they do this kind of thing?  Btw, I can't decipher
where or how it's doing that.

> for basename.  The problem is that libiberty is built without _GNU_SOURCE
> and doesn't see the declaration while libcpp is built with it and does
> see the declaration.  So if libiberty configures first we assume basename
> isn't available.  If they both configure at the same time we're OK.

Bah.  Where does the _GNU_SOURCE come from?  Is it libcpp being built
with C++ and libiberty build with C?

I think the solution is to force a separate config.cache for libcpp.
But as I didn't yet figure out how it ends up sharing config.cache
I didn't figure out how to disable that sharing...

Thanks,
Richard.

> Thanks,
> Richard
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imend"orffer

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: PATCH: fix breakage from "[PATCH] Fix genmatch linking"
  2014-10-24  4:32 ` PATCH: fix breakage from "[PATCH] Fix genmatch linking" Hans-Peter Nilsson
  2014-10-24  5:02   ` Hans-Peter Nilsson
@ 2014-10-24  8:03   ` Richard Biener
  2014-10-24 17:04     ` Hans-Peter Nilsson
  2014-10-29  0:22   ` Paolo Bonzini
  2 siblings, 1 reply; 23+ messages in thread
From: Richard Biener @ 2014-10-24  8:03 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gcc-patches, jakub

On Fri, 24 Oct 2014, Hans-Peter Nilsson wrote:

> > From: Richard Biener <rguenther@suse.de>
> > Date: Thu, 23 Oct 2014 10:47:43 +0200
> 
> > 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).
> > 
> > Ok for trunk?
> > 
> > Thanks,
> > Richard.
> > 
> > 2014-10-23  Richard Biener  <rguenther@suse.de>
> > 
> > 	* Makefile.def: Add libcpp build module and dependencies.
> > 	* configure.ac: Add libcpp build module.
> > 	* Makefile.in: Regenerate.
> > 	* configure: Likewise.
> 
> You only exposed a dormant issue, but ever since this commit
> (nominally, some commit in "(216573:216588]" but I only see this
> one matching) I see, for cross-builds (to cris-elf):
> 
> make[2]: Entering directory `/tmp/hpautotest-gcc1/cris-elf/gccobj/build-x86_64-unknown-linux-gnu/libcpp'
> g++  -I/tmp/hpautotest-gcc1/gcc/libcpp -I. -I/tmp/hpautotest-gcc1/gcc/libcpp/../include -I/tmp/hpautotest-gcc1/gcc/libcpp/include  -g -O2 -W -Wall -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I/tmp/hpautotest-gcc1/gcc/libcpp -I. -I/tmp/hpautotest-gcc1/gcc/libcpp/../include -I/tmp/hpautotest-gcc1/gcc/libcpp/include   -c -o charset.o -MT charset.o -MMD -MP -MF .deps/charset.Tpo /tmp/hpautotest-gcc1/gcc/libcpp/charset.c
> In file included from /tmp/hpautotest-gcc1/gcc/libcpp/system.h:370,
>                  from /tmp/hpautotest-gcc1/gcc/libcpp/charset.c:21:
> /tmp/hpautotest-gcc1/gcc/libcpp/../include/libiberty.h:113: error: new declaration 'char* basename(const char*)'
> /usr/include/string.h:601: error: ambiguates old declaration 'const char* basename(const char*)'
> make[2]: *** [charset.o] Error 1
> make[2]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj/build-x86_64-unknown-linux-gnu/libcpp'
> make[1]: *** [all-build-libcpp] Error 2
> make[1]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj'
> make: *** [all] Error 2
> 
> Above that, we have:
> checking whether basename is declared... (cached) no
> 
> and above that, we have:
> make[2]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj/build-x86_64-unknown-linux-gnu/fixincludes'
> mkdir -p -- build-x86_64-unknown-linux-gnu/libcpp
> Configuring in build-x86_64-unknown-linux-gnu/libcpp
> configure: loading cache ../config.cache
> 
> which is apparently set due to (above that, first non-cached):
> mkdir -p -- build-x86_64-unknown-linux-gnu/libiberty
> Configuring in build-x86_64-unknown-linux-gnu/libiberty
> configure: creating cache ../config.cache
> ...
> checking whether basename is declared... no
> 
> Your commit introduces build-subdirectories for cross-builds.
> Build-subdirs share a config.cache (in build-<host>/config.cache),
> with subdirs in build-<host> being fixincludes, libcpp and
> libiberty.
> 
> But, libiberty and fixincludes are configure-tested and compiled
> using gcc, while libcpp is compiled with g++, which causes a
> different set of declarations to be exposed, so the shared
> config.cache is invalid and its use is bogus.  Not sure how this
> works for native builds.
> 
> The libcpp configure checks are actually run with gcc which is
> bogus by itself, but apparently working.  I guess the C vs. C++
> declaration etc. differences for libcpp are mostly hidden by
> using _GNU_SOURCE (through AC_USE_SYSTEM_EXTENSIONS), and I'm a
> bit surprised that's not used for libiberty and fixincludes.
> Still, a red herring.  Aligning those options *may* cause the
> build to succeed, but I think that'd be too much of sweeping the
> issue under the carpet.
> 
> It seems "more correct" to just disable the config.cache sharing
> between the differently-configured build-subdirectories, as is
> already is done for host-libraries and target-libraries, even if
> that may slow down the builds.  (Erroring out is infinitely
> slower. :)  Still, I don't understand exactly how your patch
> introduces build-subdirectories where there were none before.
> Maybe that "+all-gcc: maybe-all-build-libcpp" was wrong and
> should be different?

No, we do need a build-libcpp to build gcc/build/genmatch.
Not sure how you got around without a build-libiberty as other
gen* programs surely require that.

> Anyway, with this, a cris-elf cross build passes the point of
> failure; compilers and libraries built, progressing into
> testing.
> 
> Ok to commit?

Ok.

Thanks,
Richard.

> toplev:
> 	* configure.ac (build_configargs): Don't share
> 	config.cache between build subdirs.
> 
> Index: configure.ac
> ===================================================================
> --- configure.ac	(revision 216610)
> +++ configure.ac	(working copy)
> @@ -2922,8 +2922,10 @@ AC_ARG_VAR([target_configargs],
>  
>  # For the build-side libraries, we just need to pretend we're native,
>  # and not use the same cache file.  Multilibs are neither needed nor
> -# desired.
> -build_configargs="$build_configargs --cache-file=../config.cache ${baseargs}"
> +# desired.  We can't even use the same cache file for all build-side
> +# libraries, as they're compiled differently; some with C, some with
> +# C++ or with different feature-enabling options.
> +build_configargs="$build_configargs --cache-file=./config.cache ${baseargs}"
>  
>  # For host modules, accept cache file option, or specification as blank.
>  case "${cache_file}" in
> Index: configure
> ===================================================================
> --- configure	(revision 216610)
> +++ configure	(working copy)
> @@ -7386,8 +7386,10 @@ tbaseargs="$tbaseargs --disable-option-c
>  
>  # For the build-side libraries, we just need to pretend we're native,
>  # and not use the same cache file.  Multilibs are neither needed nor
> -# desired.
> -build_configargs="$build_configargs --cache-file=../config.cache ${baseargs}"
> +# desired.  We can't even use the same cache file for all build-side
> +# libraries, as they're compiled differently; some with C, some with
> +# C++ or with different feature-enabling options.
> +build_configargs="$build_configargs --cache-file=./config.cache ${baseargs}"
>  
>  # For host modules, accept cache file option, or specification as blank.
>  case "${cache_file}" in
> 
> brgds, H-P
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imend"orffer

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-24  7:56             ` Rainer Orth
@ 2014-10-24  8:07               ` Richard Biener
  2014-10-24  9:51                 ` Richard Biener
  0 siblings, 1 reply; 23+ messages in thread
From: Richard Biener @ 2014-10-24  8:07 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Jakub Jelinek

On Fri, 24 Oct 2014, Rainer Orth wrote:

> Richard Biener <rguenther@suse.de> writes:
> 
> > On Thu, 23 Oct 2014, Richard Biener wrote:
> >
> >> 
> >> Final try for today.
> >
> > And this may work as well and is slightly simpler.
> >
> > Index: gcc/Makefile.in
> > ===================================================================
> > --- gcc/Makefile.in	(revision 216590)
> > +++ gcc/Makefile.in	(working copy)
> > @@ -981,7 +981,15 @@ else
> >  LIBIBERTY = ../libiberty/libiberty.a
> >  BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
> >  endif
> > +# For stage1 and when cross-compiling use the build libcpp which is
> > +# built with NLS disabled.  For stage2+ use the host library and
> > +# its dependencies.
> > +ifeq ($(build_objdir),$(build_libobjdir))
> >  BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
> > +else
> > +BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL) $(LIBICONV)
> > +build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
> > +endif
> >  
> >  # Dependencies on the intl and portability libraries.
> >  LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \
> >
> >
> > Can you test it please?
> 
> Sure: this version allowed an i386-pc-solaris2.10 bootstrap to complete
> just fine.

Great.  Installed as follows.

Richard.

2014-10-24  Richard Biener  <rguenther@suse.de>

	* Makefile.in (BUILD_CPPLIB): When in stage2+ use the
	host library and make sure to pull in the required libintl
	and libiconv dependencies.

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 216590)
+++ gcc/Makefile.in	(working copy)
@@ -981,7 +981,15 @@ else
 LIBIBERTY = ../libiberty/libiberty.a
 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
 endif
+# For stage1 and when cross-compiling use the build libcpp which is
+# built with NLS disabled.  For stage2+ use the host library and
+# its dependencies.
+ifeq ($(build_objdir),$(build_libobjdir))
 BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
+else
+BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL) $(LIBICONV)
+build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
+endif
 
 # Dependencies on the intl and portability libraries.
 LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-24  8:07               ` Richard Biener
@ 2014-10-24  9:51                 ` Richard Biener
  2014-10-24 11:04                   ` Rainer Orth
  0 siblings, 1 reply; 23+ messages in thread
From: Richard Biener @ 2014-10-24  9:51 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Jakub Jelinek

On Fri, 24 Oct 2014, Richard Biener wrote:

> On Fri, 24 Oct 2014, Rainer Orth wrote:
> 
> > Richard Biener <rguenther@suse.de> writes:
> > 
> > > On Thu, 23 Oct 2014, Richard Biener wrote:
> > >
> > >> 
> > >> Final try for today.
> > >
> > > And this may work as well and is slightly simpler.
> > >
> > > Index: gcc/Makefile.in
> > > ===================================================================
> > > --- gcc/Makefile.in	(revision 216590)
> > > +++ gcc/Makefile.in	(working copy)
> > > @@ -981,7 +981,15 @@ else
> > >  LIBIBERTY = ../libiberty/libiberty.a
> > >  BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
> > >  endif
> > > +# For stage1 and when cross-compiling use the build libcpp which is
> > > +# built with NLS disabled.  For stage2+ use the host library and
> > > +# its dependencies.
> > > +ifeq ($(build_objdir),$(build_libobjdir))
> > >  BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
> > > +else
> > > +BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL) $(LIBICONV)
> > > +build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
> > > +endif
> > >  
> > >  # Dependencies on the intl and portability libraries.
> > >  LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \
> > >
> > >
> > > Can you test it please?
> > 
> > Sure: this version allowed an i386-pc-solaris2.10 bootstrap to complete
> > just fine.
> 
> Great.  Installed as follows.
> 
> Richard.
> 
> 2014-10-24  Richard Biener  <rguenther@suse.de>
> 
> 	* Makefile.in (BUILD_CPPLIB): When in stage2+ use the
> 	host library and make sure to pull in the required libintl
> 	and libiconv dependencies.
> 
> Index: gcc/Makefile.in
> ===================================================================
> --- gcc/Makefile.in	(revision 216590)
> +++ gcc/Makefile.in	(working copy)
> @@ -981,7 +981,15 @@ else
>  LIBIBERTY = ../libiberty/libiberty.a
>  BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
>  endif
> +# For stage1 and when cross-compiling use the build libcpp which is
> +# built with NLS disabled.  For stage2+ use the host library and
> +# its dependencies.
> +ifeq ($(build_objdir),$(build_libobjdir))
>  BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
> +else
> +BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL) $(LIBICONV)
> +build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
> +endif
>  
>  # Dependencies on the intl and portability libraries.
>  LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \

Dominique reported that this fails for system libiconv but built libintl.

Which might be fixed by the following.  Does that still work for you?

Thanks,
Richard.

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 216626)
+++ gcc/Makefile.in	(working copy)
@@ -981,15 +981,6 @@ else
 LIBIBERTY = ../libiberty/libiberty.a
 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
 endif
-# For stage1 and when cross-compiling use the build libcpp which is
-# built with NLS disabled.  For stage2+ use the host library and
-# its dependencies.
-ifeq ($(build_objdir),$(build_libobjdir))
-BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
-else
-BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL) $(LIBICONV)
-build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
-endif
 
 # Dependencies on the intl and portability libraries.
 LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \
@@ -2529,6 +2520,17 @@ genprog = $(genprogerr) check checksum c
 # These programs need libs over and above what they get from the above list.
 build/genautomata$(build_exeext) : BUILD_LIBS += -lm
 
+# For stage1 and when cross-compiling use the build libcpp which is
+# built with NLS disabled.  For stage2+ use the host library and
+# its dependencies.
+ifeq ($(build_objdir),$(build_libobjdir))
+BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
+else
+BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY)
+build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
+build/genmatch$(build_exeext): BUILD_LIBS += $(LIBINTL) $(LIBICONV)
+endif
+
 build/genmatch$(build_exeext) : $(BUILD_CPPLIB) \
   $(BUILD_ERRORS) build/vec.o build/hash-table.o
 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-24  9:51                 ` Richard Biener
@ 2014-10-24 11:04                   ` Rainer Orth
  2014-10-24 11:29                     ` Richard Biener
  0 siblings, 1 reply; 23+ messages in thread
From: Rainer Orth @ 2014-10-24 11:04 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, Jakub Jelinek

Richard Biener <rguenther@suse.de> writes:

> Dominique reported that this fails for system libiconv but built libintl.
>
> Which might be fixed by the following.  Does that still work for you?

It does: an i386-pc-solaris2.10 bootstrap has finished by now and make
check is running.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] Fix genmatch linking
  2014-10-24 11:04                   ` Rainer Orth
@ 2014-10-24 11:29                     ` Richard Biener
  0 siblings, 0 replies; 23+ messages in thread
From: Richard Biener @ 2014-10-24 11:29 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Jakub Jelinek

On Fri, 24 Oct 2014, Rainer Orth wrote:

> Richard Biener <rguenther@suse.de> writes:
> 
> > Dominique reported that this fails for system libiconv but built libintl.
> >
> > Which might be fixed by the following.  Does that still work for you?
> 
> It does: an i386-pc-solaris2.10 bootstrap has finished by now and make
> check is running.

Dominique reported an ok as well.  Bootstrapped myself on
x86_64-unknown-linux-gnu and commited as r216632.

Richard.

2014-10-24  Richard Biener  <rguenther@suse.de>

	* Makefile.in (BUILD_CPPLIB): Move $(LIBINTL) $(LIBICONV)
	to genmatch BUILD_LIBS instead.

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 216626)
+++ gcc/Makefile.in	(working copy)
@@ -981,15 +981,6 @@ else
 LIBIBERTY = ../libiberty/libiberty.a
 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
 endif
-# For stage1 and when cross-compiling use the build libcpp which is
-# built with NLS disabled.  For stage2+ use the host library and
-# its dependencies.
-ifeq ($(build_objdir),$(build_libobjdir))
-BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
-else
-BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY) $(LIBINTL) $(LIBICONV)
-build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
-endif
 
 # Dependencies on the intl and portability libraries.
 LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \
@@ -2529,6 +2520,17 @@ genprog = $(genprogerr) check checksum c
 # These programs need libs over and above what they get from the above list.
 build/genautomata$(build_exeext) : BUILD_LIBS += -lm
 
+# For stage1 and when cross-compiling use the build libcpp which is
+# built with NLS disabled.  For stage2+ use the host library and
+# its dependencies.
+ifeq ($(build_objdir),$(build_libobjdir))
+BUILD_CPPLIB = $(build_libobjdir)/libcpp/libcpp.a
+else
+BUILD_CPPLIB = $(CPPLIB) $(LIBIBERTY)
+build/genmatch$(build_exeext): BUILD_LIBDEPS += $(LIBINTL_DEP) $(LIBICONV_DEP)
+build/genmatch$(build_exeext): BUILD_LIBS += $(LIBINTL) $(LIBICONV)
+endif
+
 build/genmatch$(build_exeext) : $(BUILD_CPPLIB) \
   $(BUILD_ERRORS) build/vec.o build/hash-table.o
 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: PATCH: fix breakage from "[PATCH] Fix genmatch linking"
  2014-10-24  8:03   ` Richard Biener
@ 2014-10-24 17:04     ` Hans-Peter Nilsson
  2014-10-25  8:57       ` Richard Biener
  0 siblings, 1 reply; 23+ messages in thread
From: Hans-Peter Nilsson @ 2014-10-24 17:04 UTC (permalink / raw)
  To: rguenther; +Cc: gcc-patches, jakub

> From: Richard Biener <rguenther@suse.de>
> Date: Fri, 24 Oct 2014 09:56:51 +0200
> On Fri, 24 Oct 2014, Hans-Peter Nilsson wrote:
> > Still, I don't understand exactly how your patch
> > introduces build-subdirectories where there were none before.
> > Maybe that "+all-gcc: maybe-all-build-libcpp" was wrong and
> > should be different?
> 
> No, we do need a build-libcpp to build gcc/build/genmatch.
> Not sure how you got around without a build-libiberty as other
> gen* programs surely require that.

Regular cross-configurations got around fine as they used the
"host"-build libiberty, which for crosses seemed to differ from
"build"-builds(!) only in that they're built at the objdir top
instead of objdir/build-<hosttuple>.  Crosses *could* still use
the host libraries, but whatever; we're avoiding a
cross-or-native-conditional now.  I haven't given
canadian-crosses any thought, maybe they were broken before.

brgds, H-P

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: PATCH: fix breakage from "[PATCH] Fix genmatch linking"
  2014-10-24 17:04     ` Hans-Peter Nilsson
@ 2014-10-25  8:57       ` Richard Biener
  0 siblings, 0 replies; 23+ messages in thread
From: Richard Biener @ 2014-10-25  8:57 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gcc-patches, jakub

On October 24, 2014 6:47:10 PM CEST, Hans-Peter Nilsson <hans-peter.nilsson@axis.com> wrote:
>> From: Richard Biener <rguenther@suse.de>
>> Date: Fri, 24 Oct 2014 09:56:51 +0200
>> On Fri, 24 Oct 2014, Hans-Peter Nilsson wrote:
>> > Still, I don't understand exactly how your patch
>> > introduces build-subdirectories where there were none before.
>> > Maybe that "+all-gcc: maybe-all-build-libcpp" was wrong and
>> > should be different?
>> 
>> No, we do need a build-libcpp to build gcc/build/genmatch.
>> Not sure how you got around without a build-libiberty as other
>> gen* programs surely require that.
>
>Regular cross-configurations got around fine as they used the
>"host"-build libiberty, which for crosses seemed to differ from
>"build"-builds(!) only in that they're built at the objdir top
>instead of objdir/build-<hosttuple>.  Crosses *could* still use
>the host libraries, but whatever; we're avoiding a
>cross-or-native-conditional now.  I haven't given
>canadian-crosses any thought, maybe they were broken before.

Most definitely. I wonder why we don't use the same trick with regular bootstrap. There I see build- variants of libiberty used for stage1.

Richard.

>brgds, H-P


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: PATCH: fix breakage from "[PATCH] Fix genmatch linking"
  2014-10-24  4:32 ` PATCH: fix breakage from "[PATCH] Fix genmatch linking" Hans-Peter Nilsson
  2014-10-24  5:02   ` Hans-Peter Nilsson
  2014-10-24  8:03   ` Richard Biener
@ 2014-10-29  0:22   ` Paolo Bonzini
  2014-10-29  0:30     ` Paolo Bonzini
  2 siblings, 1 reply; 23+ messages in thread
From: Paolo Bonzini @ 2014-10-29  0:22 UTC (permalink / raw)
  To: Hans-Peter Nilsson, rguenther; +Cc: gcc-patches, jakub

On 10/24/2014 06:32 AM, Hans-Peter Nilsson wrote:
> It seems "more correct" to just disable the config.cache sharing
> between the differently-configured build-subdirectories, as is
> already is done for host-libraries and target-libraries, even if
> that may slow down the builds.

Yes, please do.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: PATCH: fix breakage from "[PATCH] Fix genmatch linking"
  2014-10-29  0:22   ` Paolo Bonzini
@ 2014-10-29  0:30     ` Paolo Bonzini
  0 siblings, 0 replies; 23+ messages in thread
From: Paolo Bonzini @ 2014-10-29  0:30 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-patches, jakub

On 10/24/2014 06:32 AM, Hans-Peter Nilsson wrote:
> It seems "more correct" to just disable the config.cache sharing
> between the differently-configured build-subdirectories, as is
> already is done for host-libraries and target-libraries, even if
> that may slow down the builds.

Yes, please do.

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-10-29  0:17 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-23  9:01 [PATCH] Fix genmatch linking Richard Biener
2014-10-23  9:16 ` Jakub Jelinek
2014-10-23 12:51 ` Rainer Orth
2014-10-23 13:10   ` Richard Biener
2014-10-23 14:18     ` Richard Biener
2014-10-23 14:30       ` Richard Biener
2014-10-23 14:37         ` Richard Biener
2014-10-23 14:38           ` Richard Biener
2014-10-24  7:56             ` Rainer Orth
2014-10-24  8:07               ` Richard Biener
2014-10-24  9:51                 ` Richard Biener
2014-10-24 11:04                   ` Rainer Orth
2014-10-24 11:29                     ` Richard Biener
2014-10-23 15:27           ` Jakub Jelinek
2014-10-23 21:35 ` Richard Sandiford
2014-10-24  8:00   ` Richard Biener
2014-10-24  4:32 ` PATCH: fix breakage from "[PATCH] Fix genmatch linking" Hans-Peter Nilsson
2014-10-24  5:02   ` Hans-Peter Nilsson
2014-10-24  8:03   ` Richard Biener
2014-10-24 17:04     ` Hans-Peter Nilsson
2014-10-25  8:57       ` Richard Biener
2014-10-29  0:22   ` Paolo Bonzini
2014-10-29  0:30     ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).