From patchwork Fri Oct 15 18:54:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 46293 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 117993858436 for ; Fri, 15 Oct 2021 18:54:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 117993858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1634324098; bh=FiQoc/Zh65XTRaJ3I96e4FWHaIeATBI3KwW24MG/hvs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=UlmmsmvCxrS013gFaz9mfMOH3FjushxHIGYp54vbSx5yRo4MD3aIBlNVweKv6CoE2 2tyu9ZvuXkpPu3K5GIkcNZm91t5VTcQYN/2lI9DVg89fBygfeDB13wqFvLXeWjPLJQ IL+ZMbmEOonlBAosyEQbRHhStng+APF5j5u/bzg4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 3D7AF3858C60 for ; Fri, 15 Oct 2021 18:54:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3D7AF3858C60 Received: by mail-wm1-x333.google.com with SMTP id a196so3245039wme.0 for ; Fri, 15 Oct 2021 11:54:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:reply-to :mime-version:content-transfer-encoding; bh=FiQoc/Zh65XTRaJ3I96e4FWHaIeATBI3KwW24MG/hvs=; b=xZ+z+ctczePckiNx9haSLcQOW+bf+SWN0ol6Lg7+kk5Sxje6X/ESQm4mqv83Ss6zOt It1iBjSviC9OyDx44Jm7NZ9yycO3Wv+62t8/6G4c249rmMOc8YbSzPWIV0IpB1AL99hf 6gT5Km+vXvfaRQbWui2sP0NYKLJakPr7u5ZM7AGIg9QsVeiy/26U/0OYIJ3Jb2fbmRUU 7dw7BOsE3O1/O7gcrSxhXvXv9MTOlteEdNWMySjTFOOquXN5JlBVB5B3Rcn+Q00ZN1mp s1XqnuKhuBVpVgoIBMlxhrOZMaOBj+uzsgt/amo/pidhgirt/yVMfjltrsDjctElMkbe cfOQ== X-Gm-Message-State: AOAM533QpvYFVe44b16zN5KumknfKZm/qSAKXOzdNY6gmw1hFyG+UlIk 4WT+apo15rV68r5S9of654Txjidq3Nsh8g== X-Google-Smtp-Source: ABdhPJz+aaSKqybSAo071mwS7UIyHrrbNMUOWmrXl6VgwtKGZSdbzEFDkBvLOpuyJwhMNu8qdoiIXA== X-Received: by 2002:a7b:c4c8:: with SMTP id g8mr14221513wmk.101.1634324067365; Fri, 15 Oct 2021 11:54:27 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id n7sm5444718wra.37.2021.10.15.11.54.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Oct 2021 11:54:27 -0700 (PDT) X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Darwin: Update specs handling '-r'. Date: Fri, 15 Oct 2021 19:54:20 +0100 Message-Id: <20211015185420.31664-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" We were not wrapping all the default libraries in checks for whether they should be used. We were also wasting a process launch calling dsymutil for 'r' link lines (a NOP in practice). Order the checks that exclude linking from most likely to occur, downwards. tested on powerpc, i686, x86_64, arm64 darwin, pushed to master, thanks. Iain Signed-off-by: Iain Sandoe gcc/ChangeLog: * config/darwin.h (LINK_COMMAND_SPEC_A): Update 'r' handling to skip gomp and itm when r or nodefaultlibs is given. (DSYMUTIL_SPEC): Do not call dsymutil for '-r' link lines. Update ordering of exclusions, remove duplicate 'v' addition (collect2 will add this from the main command line). --- gcc/config/darwin.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 4aedf467c17..27cb3e4bb30 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -349,7 +349,7 @@ extern GTY(()) int darwin_ms_struct; linkers, and for positional arguments like libraries. */ #define LINK_COMMAND_SPEC_A \ - "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ + "%{!c:%{!E:%{!S:%{!M:%{!MM:%{!fsyntax-only:%{!fdump=*: \ %(linker)" \ LINK_PLUGIN_SPEC \ "%{flto*:%< 10.6 10.7 mmacosx-version-min= -ld10-uwfef) \ %(link_gcc_c_sequence) \ }}}\ - %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} %{F*} "\ + %{!r:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} "\ DARWIN_PIE_SPEC \ DARWIN_NOPIE_SPEC \ DARWIN_RDYNAMIC \ @@ -384,12 +387,12 @@ extern GTY(()) int darwin_ms_struct; enabled). */ #define DSYMUTIL_SPEC \ - "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ - %{v} \ - %{g*:%{!gctf:%{!gbtf:%{!gstabs*:%{%:debug-level-gt(0): -idsym}}}}}\ - %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm|.s|.f|.f90|\ - .f95|.f03|.f77|.for|.F|.F90|.F95|.F03|.d: \ - %{g*:%{!gctf:%{!gbtf:%{!gstabs*:%{%:debug-level-gt(0): -dsym}}}}}}}}}}}}}" + "%{!c:%{!E:%{!S:%{!r:%{!M:%{!MM:%{!fsyntax-only:%{!fdump=*:\ + %{g*:%{!gctf:%{!gbtf:%{!gstabs*:%{%:debug-level-gt(0): -idsym \ + %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm|.s|.f|.f90|\ + .f95|.f03|.f77|.for|.F|.F90|.F95|.F03|.d: -dsym }\ + }}}}}\ + }}}}}}}}" #define LINK_COMMAND_SPEC LINK_COMMAND_SPEC_A DSYMUTIL_SPEC