Bug 48120 - libpwl test must use g++
Summary: libpwl test must use g++
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Rainer Orth
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-14 19:50 UTC by Rainer Orth
Modified: 2011-09-19 05:39 UTC (History)
2 users (show)

See Also:
Host: i386-pc-solaris2.10
Target: i386-pc-solaris2.10
Build: i386-pc-solaris2.10
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2011-03-14 19:50:32 UTC
The libpwl test in toplevel configure is bogus: it tries to link with gcc, but
libpwl is a C++ library and needs symbols from libstdc++, as can be seen in this
excerpt from config.log of a failing bootstrap:

configure:5755: gcc -o conftest -g -O2   -L/vol/gcc/lib conftest.c -lpwl   >&5
Undefined                       first referenced
 symbol                             in file
std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_st
ring(std::basic_string<char, std::char_traits<char>, std::allocator<char> > cons
t&) /vol/gcc/lib/libpwl.a(Watchdog.o)
operator new(unsigned int)          /vol/gcc/lib/libpwl.a(Watchdog.o)
Comment 1 Andrew Pinski 2011-03-14 20:43:47 UTC
I don't think this is a bug unless --with-host-libstdcxx= option is being ignored.
See the documentation from http://gcc.gnu.org/install/configure.html :

--with-host-libstdcxx=linker-args
    If you are linking with a static copy of PPL, you can use this option to specify how the linker should find the standard C++ library used internally by PPL. Typical values of linker-args might be `-lstdc++' or `-Wl,-Bstatic,-lstdc++,-Bdynamic -lm'. If you are linking with a shared copy of PPL, you probably do not need this option; shared library dependencies will cause the linker to search for the standard C++ library automatically.
Comment 2 ro@CeBiTec.Uni-Bielefeld.DE 2011-03-14 20:51:54 UTC
> --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-03-14 20:43:47 UTC ---
> I don't think this is a bug unless --with-host-libstdcxx= option is being
> ignored.

I've configured with

--with-ppl=/vol/gcc --with-cloog=/vol/gcc --enable-cloog-backend=ppl  \
--with-host-libstdcxx='-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm' \
--with-boot-ldflags=-L/vol/gcc-4.5/lib

Not exactly as in install.texi, but except for the -lpwl issue, it
worked fine.

Apart from this bug, I consider the need for such a
--with-host-libstdcxx an abomination: this should work out of the box,
since it is obvious that with ppl/cloog, libstdc++ is needed, and
preferably the static one to avoid runpath issues.  An excellent example
of how to do this right is the Go case: --enable-languages=go
automatically links with the static libstdc++, no contortions required.

	Rainer
Comment 3 Rainer Orth 2011-03-21 12:26:34 UTC
Author: ro
Date: Mon Mar 21 12:26:30 2011
New Revision: 171225

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171225
Log:
	PR bootstrap/48120:
	* configure.ac (pwllib): Use LIBS instead of LDFLAGS.
	Add -lstdc++ -lm to LIBS.
	* configure: Regenerate.

Modified:
    trunk/ChangeLog
    trunk/configure
    trunk/configure.ac
Comment 4 Rainer Orth 2011-03-21 12:45:54 UTC
Mine.  Fixed for 4.7.0, may backport to 4.6.
Comment 5 jye2 2011-09-19 05:39:11 UTC
Author: jye2
Date: Mon Sep 19 05:39:05 2011
New Revision: 178951

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178951
Log:
2011-09-19  Joey Ye  <joey.ye@arm.com>

        Backport r171225 from mainline
        2011-03-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

        PR bootstrap/48120:
        * configure.ac (pwllib): Use LIBS instead of LDFLAGS.
        Add -lstdc++ -lm to LIBS.
        * configure: Regenerate.

Added:
    branches/ARM/embedded-4_6-branch/ChangeLog.arm
Modified:
    branches/ARM/embedded-4_6-branch/configure
    branches/ARM/embedded-4_6-branch/configure.ac