public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [build] Link with libstdc++ for libpwl test (PR bootstrap/48120)
@ 2011-03-21 11:48 Rainer Orth
  2011-03-21 11:51 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Rainer Orth @ 2011-03-21 11:48 UTC (permalink / raw)
  To: gcc-patches; +Cc: Paolo Bonzini

As reported in the PR, the toplevel configure test for libpwl doesn't
work since it fails to link with libstdc++.  The following patch
corrects this.

There were a couple of issues:

* One cannot use LDFLAGS here since that is passed to $CC before -lpwl,
  which of course fails with a static libpwl.  I'm using LIBS instead.

* It was suggested to add $stage1_libs to LIBS, but I go for -lstdc++
  -lm instead.  I seriously doubt we can make bootstrap work with a
  non-g++ C++ compiler here, especially with Go included which is
  written in C++ itself.  This would mean linking both the foreign C++
  runtime libraries and libstdc++ into the executables, which seems to
  be a recipe for disaster.

This patch allowed a i386-pc-solaris2.11 with ppl/cloog to finish and
all graphite tests passed.

Ok for mainline?

	Rainer


2011-03-19  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.

diff -r 3786717045e5 configure.ac
--- a/configure.ac	Sat Mar 19 10:35:20 2011 +0100
+++ b/configure.ac	Sat Mar 19 21:57:26 2011 +0100
@@ -1677,10 +1677,10 @@
 
 if test "x$with_ppl" != xno; then
   if test "x$pwllib" = x; then
-    saved_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $ppllibs"
-    AC_CHECK_LIB(pwl,PWL_handle_timeout,[pwllib="-lpwl"])
-    LDFLAGS="$saved_LDFLAGS"
+    saved_LIBS="$LIBS"
+    LIBS="$LIBS $ppllibs -lstdc++ -lm"
+    AC_CHECK_LIB(pwl, PWL_handle_timeout, [pwllib="-lpwl"])
+    LIBS="$saved_LIBS"
   fi
 
   ppllibs="$ppllibs -lppl_c -lppl $pwllib -lgmpxx"

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

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

* Re: [build] Link with libstdc++ for libpwl test (PR bootstrap/48120)
  2011-03-21 11:48 [build] Link with libstdc++ for libpwl test (PR bootstrap/48120) Rainer Orth
@ 2011-03-21 11:51 ` Paolo Bonzini
  2011-03-21 12:40   ` Rainer Orth
  0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2011-03-21 11:51 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches

On 03/21/2011 12:48 PM, Rainer Orth wrote:
> As reported in the PR, the toplevel configure test for libpwl doesn't
> work since it fails to link with libstdc++.  The following patch
> corrects this.
>
> There were a couple of issues:
>
> * One cannot use LDFLAGS here since that is passed to $CC before -lpwl,
>    which of course fails with a static libpwl.  I'm using LIBS instead.
>

It's better anyway.

Patch is okay.

Paolo

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

* Re: [build] Link with libstdc++ for libpwl test (PR bootstrap/48120)
  2011-03-21 11:51 ` Paolo Bonzini
@ 2011-03-21 12:40   ` Rainer Orth
  2011-03-21 12:49     ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Rainer Orth @ 2011-03-21 12:40 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: gcc-patches

Paolo Bonzini <bonzini@gnu.org> writes:

> On 03/21/2011 12:48 PM, Rainer Orth wrote:
>> As reported in the PR, the toplevel configure test for libpwl doesn't
>> work since it fails to link with libstdc++.  The following patch
>> corrects this.
>>
>> There were a couple of issues:
>>
>> * One cannot use LDFLAGS here since that is passed to $CC before -lpwl,
>>    which of course fails with a static libpwl.  I'm using LIBS instead.
>>
>
> It's better anyway.
>
> Patch is okay.

Thanks, applied.  Should I sync to src, too?

	Rainer

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

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

* Re: [build] Link with libstdc++ for libpwl test (PR bootstrap/48120)
  2011-03-21 12:40   ` Rainer Orth
@ 2011-03-21 12:49     ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2011-03-21 12:49 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches

On 03/21/2011 01:40 PM, Rainer Orth wrote:
> Paolo Bonzini<bonzini@gnu.org>  writes:
>
>> On 03/21/2011 12:48 PM, Rainer Orth wrote:
>>> As reported in the PR, the toplevel configure test for libpwl doesn't
>>> work since it fails to link with libstdc++.  The following patch
>>> corrects this.
>>>
>>> There were a couple of issues:
>>>
>>> * One cannot use LDFLAGS here since that is passed to $CC before -lpwl,
>>>     which of course fails with a static libpwl.  I'm using LIBS instead.
>>>
>>
>> It's better anyway.
>>
>> Patch is okay.
>
> Thanks, applied.  Should I sync to src, too?

Yes, always (except for libiberty/ and include/).

Paolo

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

end of thread, other threads:[~2011-03-21 12:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-21 11:48 [build] Link with libstdc++ for libpwl test (PR bootstrap/48120) Rainer Orth
2011-03-21 11:51 ` Paolo Bonzini
2011-03-21 12:40   ` Rainer Orth
2011-03-21 12:49     ` 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).