From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29336 invoked by alias); 10 Dec 2004 17:02:14 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 29299 invoked from network); 10 Dec 2004 17:02:05 -0000 Received: from unknown (HELO rwcrmhc12.comcast.net) (216.148.227.85) by sourceware.org with SMTP; 10 Dec 2004 17:02:05 -0000 Received: from lucon.org ([24.6.212.230]) by comcast.net (rwcrmhc12) with ESMTP id <2004121017020401400eh705e>; Fri, 10 Dec 2004 17:02:05 +0000 Received: by lucon.org (Postfix, from userid 1000) id 15BFC640F5; Fri, 10 Dec 2004 09:02:02 -0800 (PST) Date: Fri, 10 Dec 2004 17:02:00 -0000 From: "H. J. Lu" To: Matthias Klose Cc: gcc-patches@gcc.gnu.org Subject: Patch ping Message-ID: <20041210170201.GA8142@lucon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-SW-Source: 2004-12/txt/msg00757.txt.bz2 Could someone please take a look at patch for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18153 > > PR18153 has a wrong AC_MSG_RESULT line, should be: > > AC_MSG_RESULT($gcc_cv_ld_static_dynamic) Thanks. Here is an updated one. H.J. ---- 2004-12-10 H.J. Lu PR target/18153 * configure.ac: Define HAVE_LD_STATIC_DYNAMIC if linker supports -Bstatic/-Bdynamic option. * config.in: Regenerated. * configure: Likewise. * gcc.c (init_spec): Pass -Bstatic/-Bdynamic to ld for static -lunwind if possible. --- gcc/config.in.static 2004-10-25 17:37:13.000000000 -0700 +++ gcc/config.in 2004-10-26 10:06:38.270754696 -0700 @@ -322,6 +322,9 @@ a read-write section. */ #undef HAVE_LD_RO_RW_SECTION_MIXING +/* Define if your linker supports -Bstatic/-Bdynamic option. */ +#undef HAVE_LD_STATIC_DYNAMIC + /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H --- gcc/configure.ac.static 2004-10-25 17:37:13.000000000 -0700 +++ gcc/configure.ac 2004-10-26 10:11:49.451512210 -0700 @@ -2645,6 +2645,25 @@ if test x"$gcc_cv_ld_pie" = xyes; then fi AC_MSG_RESULT($gcc_cv_ld_pie) +AC_MSG_CHECKING(linker -Bstatic/-Bdynamic option) +gcc_cv_ld_static_dynamic=no +if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10; then + gcc_cv_ld_static_dynamic=yes + fi +elif test x$gcc_cv_ld != x; then + # Check if linker supports -Bstatic/-Bdynamic option + if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \ + && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then + gcc_cv_ld_static_dynamic=yes + fi +fi +if test x"$gcc_cv_ld_static_dynamic" = xyes; then + AC_DEFINE(HAVE_LD_STATIC_DYNAMIC, 1, +[Define if your linker supports -Bstatic/-Bdynamic option.]) +fi +AC_MSG_RESULT($gcc_cv_ld_static_dynamic) + if test x"$demangler_in_ld" = xyes; then AC_MSG_CHECKING(linker --demangle support) gcc_cv_ld_demangle=no --- gcc/gcc.c.static 2004-09-08 08:17:29.000000000 -0700 +++ gcc/gcc.c 2004-10-26 10:21:48.880992852 -0700 @@ -1647,7 +1647,11 @@ init_spec (void) "-lgcc", "-lgcc_eh" #ifdef USE_LIBUNWIND_EXCEPTIONS +# ifdef HAVE_LD_STATIC_DYNAMIC + " %{!static:-Bstatic} -lunwind %{!static:-Bdynamic}" +# else " -lunwind" +# endif #endif );