diff mbox

[build] Link genmatch with $(LIBINTL)

Message ID ydd8uk8qex9.fsf@lokon.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Oct. 22, 2014, 3:53 p.m. UTC
With the match-and-simply patch, Solaris 10 bootstrap is broken:

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

It seems the following patch fixes this, at least a i386-pc-solaris2.10
bootstrap is in stage2 now.

Ok for mainline?

	Rainer


2014-10-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* Makefile.in (build/genmatch(build_exeext)): Add $(LIBINTL) to
	BUILD_LIBS.
	Add $(LIBINTL_DEP) dependency.

Comments

Jakub Jelinek Oct. 22, 2014, 3:58 p.m. UTC | #1
On Wed, Oct 22, 2014 at 05:53:22PM +0200, Rainer Orth wrote:
> 2014-10-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 
> 	* Makefile.in (build/genmatch(build_exeext)): Add $(LIBINTL) to

Shouldn't that be build/genmatch$(build_exeext) , both in the ChangeLog and
more importantly, in the patch?

> 	BUILD_LIBS.
> 	Add $(LIBINTL_DEP) dependency.
> 

> diff --git a/gcc/Makefile.in b/gcc/Makefile.in
> --- a/gcc/Makefile.in
> +++ b/gcc/Makefile.in
> @@ -2519,8 +2519,9 @@ 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_LIBS += $(LIBINTL)
> +
> +build/genmatch$(build_exeext) : $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) \
>    $(BUILD_ERRORS) build/vec.o build/hash-table.o
>  
>  # These programs are not linked with the MD reader.

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


	Jakub
Joseph Myers Oct. 22, 2014, 5:19 p.m. UTC | #2
On Wed, 22 Oct 2014, Rainer Orth wrote:

> 2014-10-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 
> 	* Makefile.in (build/genmatch(build_exeext)): Add $(LIBINTL) to
> 	BUILD_LIBS.
> 	Add $(LIBINTL_DEP) dependency.

No, this doesn't look right.  A program built for the build system needs 
to use build versions of all relevant libraries, not host versions.  That 
means $(BUILD_LIBIBERTY) not host libiberty, and build versions of libcpp 
and libintl if those are now needed for something built for the build 
system.  That in turn needs toplevel changes to add libcpp and intl to 
build_modules.
Richard Biener Oct. 22, 2014, 6:59 p.m. UTC | #3
On October 22, 2014 7:19:33 PM CEST, "Joseph S. Myers" <joseph@codesourcery.com> wrote:
>On Wed, 22 Oct 2014, Rainer Orth wrote:
>
>> 2014-10-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>> 
>> 	* Makefile.in (build/genmatch(build_exeext)): Add $(LIBINTL) to
>> 	BUILD_LIBS.
>> 	Add $(LIBINTL_DEP) dependency.
>
>No, this doesn't look right.  A program built for the build system
>needs 
>to use build versions of all relevant libraries, not host versions. 
>That 
>means $(BUILD_LIBIBERTY) not host libiberty, and build versions of
>libcpp 
>and libintl if those are now needed for something built for the build 
>system.  That in turn needs toplevel changes to add libcpp and intl to 
>build_modules.

I suppose we should build the build variant of libcpp without NLS support instead.

Richard.
Joseph Myers Oct. 22, 2014, 7:30 p.m. UTC | #4
On Wed, 22 Oct 2014, Richard Biener wrote:

> On October 22, 2014 7:19:33 PM CEST, "Joseph S. Myers" <joseph@codesourcery.com> wrote:
> >On Wed, 22 Oct 2014, Rainer Orth wrote:
> >
> >> 2014-10-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> >> 
> >> 	* Makefile.in (build/genmatch(build_exeext)): Add $(LIBINTL) to
> >> 	BUILD_LIBS.
> >> 	Add $(LIBINTL_DEP) dependency.
> >
> >No, this doesn't look right.  A program built for the build system
> >needs 
> >to use build versions of all relevant libraries, not host versions. 
> >That 
> >means $(BUILD_LIBIBERTY) not host libiberty, and build versions of
> >libcpp 
> >and libintl if those are now needed for something built for the build 
> >system.  That in turn needs toplevel changes to add libcpp and intl to 
> >build_modules.
> 
> I suppose we should build the build variant of libcpp without NLS support instead.

Indeed, that would avoid various complications such as configure options 
for where to find libiconv only being correct for the host and not the 
build system.
diff mbox

Patch

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2519,8 +2519,9 @@  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_LIBS += $(LIBINTL)
+
+build/genmatch$(build_exeext) : $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) \
   $(BUILD_ERRORS) build/vec.o build/hash-table.o
 
 # These programs are not linked with the MD reader.