From patchwork Tue Mar 31 16:39:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Howarth X-Patchwork-Id: 456694 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 819DF1400B6 for ; Wed, 1 Apr 2015 03:39:34 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=D0CVNZ1v; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=EfwFsMOu2o/bOObnJH P2p9uW985R27x6tz2EIPHAtZrb1vmIhicWIKzFSFmJkGmui5EXjIAqNIl3kFFcg6 y7+KRO2qgi/1Yh3mYeORQUtm/zDjsDdClOh7I+sWzUv/gwHUy2UehXfBp9HBXFkF lIok6tFb+aTDyfM1MF2Jn18Z0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=uaR6ZFILsg8CsO2rRAW1uZtp Zbo=; b=D0CVNZ1vpxgE2Kon6w/VRIMO5M8VqLb8G08D1oElZLSsY2keyxWmveML yFvXQoCi9FyPsgUt8usXKcUwARPpfgtC/YAkeEEzb9kAF3wLqZN5t6/pFtBMQXDZ Ae6z/1Ysm6zdLJU910uKI/rHaWt+hKBj5EgEFMeZJQ7tmGduozA= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 12:39:17 -0400 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 X-IsSubscribed: yes 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... 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. 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"