From patchwork Fri Dec 3 16:19:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Koning X-Patchwork-Id: 74162 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 5A95AB708B for ; Sat, 4 Dec 2010 03:19:53 +1100 (EST) Received: (qmail 14592 invoked by alias); 3 Dec 2010 16:19:50 -0000 Received: (qmail 14572 invoked by uid 22791); 3 Dec 2010 16:19:49 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausc60pc101.us.dell.com (HELO ausc60pc101.us.dell.com) (143.166.85.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Dec 2010 16:19:44 +0000 X-Loopcount0: from 10.152.240.141 From: Paul Koning Subject: [RFA] Fix libstdc++ configure failure on cross-builds Date: Fri, 3 Dec 2010 11:19:40 -0500 Message-Id: To: gcc-patches Mime-Version: 1.0 (Apple Message framework v1082) 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 This patch fixes failures of libstdc++ to configure when cross-building to NetBSD target. The issue is that there are two places that do link tests, which are disallowed in cross builds. The libtool.m4 change supplies values for netbsd similar to what's already done for selected other targets. The patch to libstdc++-v3/acinclude.m4 lets configure rely on the ld version number to determine support for --gc-sections if a cross-build is being done, rather than doing a double-check. Ok to commit? ChangeLog (top level): 2010-12-03 Paul Koning * configure.ac (LT_SYS_DLOPEN_SELF): Add settings for NetBSD. ChangeLog (libstdc++-v3): 2010-12-03 Paul Koning * acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Don't double-check --gc-sections support if cross-build. Index: gcc-4.5.1/libtool.m4 =================================================================== --- gcc-4.5.1/libtool.m4 (revision 147400) +++ gcc-4.5.1/libtool.m4 (working copy) @@ -1715,6 +1715,11 @@ lt_cv_dlopen_self=yes ;; + netbsd*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= Index: gcc-4.5.1/libstdc++-v3/acinclude.m4 =================================================================== --- gcc-4.5.1/libstdc++-v3/acinclude.m4 (revision 147400) +++ gcc-4.5.1/libstdc++-v3/acinclude.m4 (working copy) @@ -230,7 +230,8 @@ glibcxx_have_gc_sections=yes fi fi - if test "$glibcxx_have_gc_sections" = "yes"; then + if test "$glibcxx_have_gc_sections" = "yes" && + test x$gcc_no_link != xyes; then # Sufficiently young GNU ld it is! Joy and bunny rabbits! # NB: This flag only works reliably after 2.16.1. Configure tests # for this are difficult, so hard wire a value that should work.