From patchwork Mon Mar 21 11:48:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 87751 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D8EE6B6F74 for ; Mon, 21 Mar 2011 22:48:46 +1100 (EST) Received: (qmail 2243 invoked by alias); 21 Mar 2011 11:48:37 -0000 Received: (qmail 2166 invoked by uid 22791); 21 Mar 2011 11:48:35 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 Mar 2011 11:48:28 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 463D8A9B; Mon, 21 Mar 2011 12:48:26 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SSFetcy54YRr; Mon, 21 Mar 2011 12:48:24 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 4D032A9A; Mon, 21 Mar 2011 12:48:24 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p2LBmNBW015492; Mon, 21 Mar 2011 12:48:23 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Paolo Bonzini Subject: [build] Link with libstdc++ for libpwl test (PR bootstrap/48120) Date: Mon, 21 Mar 2011 12:48:23 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 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"