From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112622 invoked by alias); 31 Mar 2015 16:39:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 112609 invoked by uid 89); 31 Mar 2015 16:39:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ob0-f179.google.com Received: from mail-ob0-f179.google.com (HELO mail-ob0-f179.google.com) (209.85.214.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 31 Mar 2015 16:39:25 +0000 Received: by obcjt1 with SMTP id jt1so35643502obc.2 for ; Tue, 31 Mar 2015 09:39:23 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.158.130 with SMTP id wu2mr34044403oeb.64.1427819957143; Tue, 31 Mar 2015 09:39:17 -0700 (PDT) Received: by 10.76.129.71 with HTTP; Tue, 31 Mar 2015 09:39:17 -0700 (PDT) In-Reply-To: References: <20150330022527.GA4148@gmail.com> <20150331053855.GB2121@tucnak.redhat.com> Date: Tue, 31 Mar 2015 16:39:00 -0000 Message-ID: Subject: Re: PATCH] PR target/65612: Multiversioning doesn't work with DSO nor PIE From: Jack Howarth To: "H.J. Lu" Cc: Ian Lance Taylor , Jakub Jelinek , GCC Patches , Uros Bizjak , Iain Sandoe , Mike Stump Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg01682.txt.bz2 On Tue, Mar 31, 2015 at 12:14 PM, H.J. Lu wrote: > On Tue, Mar 31, 2015 at 9:09 AM, Jack Howarth wrote: >> H.J., >> Did you attach the correct version of the patch? I don't see >> anything conditional on linux. >> Jack > > My patch will build and install libgcc_nonshared.a for all targets. If you > don't link against it, nothing is changed. On Linux, it is used via the > init_spec change. Isn't... diff --git a/gcc/gcc.c b/gcc/gcc.c index d956c36..3fbd549 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1566,6 +1566,7 @@ init_spec (void) if (in_sep && *p == '-' && strncmp (p, "-lgcc", 5) == 0) { init_gcc_specs (&obstack, + "-lgcc_nonshared " "-lgcc_s" #ifdef USE_LIBUNWIND_EXCEPTIONS " -lunwind" @@ -1591,6 +1592,7 @@ init_spec (void) /* Ug. We don't know shared library extensions. Hope that systems that use this form don't do shared libraries. */ init_gcc_specs (&obstack, + "libgcc_nonshared.a%s " "-lgcc_s", "libgcc.a%s", "libgcc_eh.a%s" problematic for Solaris? I am unfamiliar with the Solaris spec handling but sol2.h doesn't seem to have any instances of -lgcc which might imply they use the stock compiler invocation which will now have a non-existent libgcc_nonshared static library. Also, are you leaving the cpu symbols in libgcc.a on non-linux targets? If not, the linkage failure reported in https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01668.html will occur, no? Jack > > -- > H.J.