From patchwork Fri Nov 11 15:50:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 693782 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 3tFksT1d9Fz9t1F for ; Sat, 12 Nov 2016 02:50:52 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="DcBkLw0c"; 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 :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=nr1PRcA7vMFxGMbanyOrWs8JgkVUJrEXFrPqjIv3FEb pYBYuOGC4fjbk0kB54K2g7EWjUMkw2YxxaahnAcrUcL+3i+5Rv+BVy5deUlzJ11o 7TJxQQEirP3pdq8Nf0d4ALswvSMLfBDLU8FuAoGv3P4mKHOU3faEI/D0dtI+JrCI = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=cMU9SWjQhNTOuAyAF07BFPvb34c=; b=DcBkLw0ccffn6Mw+s 84AuU/Fcts9T06m2e3rPcYJJI83ukT5JK662YHwo+TF5Qw0WuW4g+LpEWOB2SDDO dxrhXP2LogBwQu0H3JbW3kv5lfvLeVNTqiPpiiS4YvP3KaBI6mJ9oizvFqg2mhp0 0KNifcp+Rj0d7eZ/MssaJ5iLrk= Received: (qmail 17636 invoked by alias); 11 Nov 2016 15:50:42 -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 17625 invoked by uid 89); 11 Nov 2016 15:50:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*free-electrons.com, concerns, 20161111 X-HELO: EUR01-DB5-obe.outbound.protection.outlook.com Received: from mail-db5eur01on0073.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (104.47.2.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Nov 2016 15:50:31 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Received: from [10.2.206.73] (217.140.96.140) by HE1PR0802MB2155.eurprd08.prod.outlook.com (10.172.126.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Fri, 11 Nov 2016 15:50:27 +0000 Message-ID: <5825E8BF.3020501@arm.com> Date: Fri, 11 Nov 2016 15:50:23 +0000 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: , Rich Felker , , Jakub Jelinek , Uros Bizjak Subject: [PATCH][i386][musl] Add cpuinfo to static libgcc only on *-musl* X-ClientProxiedBy: DB5PR0101CA0001.eurprd01.prod.exchangelabs.com (10.165.200.139) To HE1PR0802MB2155.eurprd08.prod.outlook.com (10.172.126.15) X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2155; 2:VLlL6RAKqV6Jgl+MgeyLDND3icP8SAouhn+LbQcSab61DERE7TpOIutpbbrLxYJ8ygARbl3/pjCSrM5U7pTY/LMk/2DJeR/isAK9gbrxwrrignOuhvcSEM99weTzwMQKaxkdqmwVv0gmhcqTtEO9qIBcR2ajzEVINQliF84RVyY=; 3:ucQKlrTascbzgONb7hHx7JPIBBSKDGYHiVPM4ZczX3V4Xfl1fnVH5ZlnR3xNIHSvOV59Q7WdwhnFTft6+g5tvEVjHlhZwV7y+aCMqCDNOBo4iQlG1QH1TiUnaOYGfA6sjgSe/MQoPlUHoCL+4vH3Y9ktuIq+1wyrWqYFfJlnpUc=; 25:Yv/zIbPZgxH5Pqd2iucmgVggkjva+t4WbL4jq9Up6piH9H7NwTPhtOtxlAMubfyxj4l40c5gnVgePDEi7QvxaufLL52OqNUA257RDp2DhJCpYXflCplrFm743Eiga61FFWnWRLzxAofNGBkFEYjFKlZGodxwRRIk4SCTbKA9XIhvOUuuRrgvMaLcLJKn/wmJjtbX2ct9nyS94T2WLYTPM3NMICMKrpWLIX5+Xf7BjS1l/SMPLOv7FdpfDRa0F61emRQ6Eq0AD0Gijv2RaGLFnQaVpGPcSQ3gYbKP31YbbvbmhnlaMBTTzQzCzJwhlIw1BFUejhP1EGmnp9Fe2pDaaz48skmNNTGX2nm/VRErgzIS6fvSTWmglyY5YBJTqHNJbToxzpZSiSo5EbzHqKSKC8vCt6G19xMgiS7gS6DkiMVqkPFB0peLYIsJzLkHA52uqQIW7HyDiBZP8rxATZEs/msln1/p3DZWdy4Z3NUeFASNigaX8nCSV/0IRA2U9ArB X-MS-Office365-Filtering-Correlation-Id: 416025ee-141a-4c43-59d8-08d40a4a7558 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:HE1PR0802MB2155; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2155; 31:0PRKo2VySmkjlxwVVCmNaJ3Kwj91k0TaPW6x43cPo6+sgyLa3OwdxEbVa5n5ufVXKcX8V7oV0TPvmALt0ED5eWcwqsXz/fJ2o31AG3zTiiiZfo7Ppfhd4Nic2Iyo/si18A6gxPjuQ+yuPsLcn0zCHRWxGvkVJLXPpaER0sozrZRV3KUZLYJzt88zkm9/XzAmbp+1e51FDZc7z9RPDD9PIrfeU6Kc2LL7O77wS1mkju+BurcsABbDlDenyNgF+cPKA2a/I2CyhK8bkZn66affEg==; 20:Oz9Z8J4L5rgDyzADmpd88CWsFtV0GE+nrJkYJbfchwTmxCB/Wsx1G7q1J/Ti7w68dGV2Nsa2YXf4eH+YNWVqzEx5y1U4XooBLSNS46pS1aeYPxuhElkcL5UpkP/8jfT1kPq8S5pycjP1XaNxCkFzyfJ1PjRqdGfiYHkB52y5StQ=; 4:x9XB33LpY+sgL3FYQMG5VTFF1nTjriNrQyD0wP3Zfp5vqQRyaaQx/oV4d9y71Mh+5vdwi3fU6Zreg90/z3pksMJ0hvn0ggCxG8OsiHaOltZpIoaWq4YCHR+HOYvc8aQDE76MuYkmnZXxRLZGe36s70BexFdpEAeH04P46t+n0zp5ZnyW76A/VtK2SZXNISzWx/WiRhR8/JuRfahByGMrQpGF3V03ZUHZKnRSZPPwFYzWWhguQXwqGGFi4Ltc4Ydmvm83GlWypF4y7PGivGMdpRBkRhVDRlJIeVeF+Z+NvvlfgYpy/Z9NJswomm18iopCyQAZK4dTcOZW4A2DVjj2drqKPM749aBWQQrafwdBCytKPnupikG2l2d7CrpdeNXj+vjPADT/3xcmrHSdWK8ndWGMsAPPwLjmcvJiapOSGcYbzFgDQDCRovRpl0aMU+bPtisf4L4aGN6S+AfNzXYBpfV98CVtZJCMc3++YqU4+dw= NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:HE1PR0802MB2155; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0802MB2155; X-Forefront-PRVS: 012349AD1C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(189002)(199003)(377424004)(54534003)(68736007)(81156014)(66066001)(2906002)(92566002)(4610100001)(81166006)(568964002)(65806001)(65956001)(8676002)(270700001)(6666003)(586003)(83506001)(4326007)(2476003)(84326002)(86362001)(77096005)(6116002)(6916009)(3846002)(50986999)(65816999)(101416001)(4001350100001)(80316001)(42186005)(54356999)(33656002)(189998001)(64126003)(305945005)(106356001)(7736002)(87266999)(5660300001)(2351001)(21490400002)(5000100001)(59896002)(97736004)(5890100001)(36756003)(110136003)(2501003)(105586002)(7846002)(4001150100001)(512874002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0802MB2155; H:[10.2.206.73]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0802MB2155; 23:Uie9UtFmyHn76O+LsnE3XkktaeNuS2iFLnvFEgQ?= =?us-ascii?Q?CdAQ8EJ7IqxQyE0HlpYkBptJatk5MOB0Tj1crKaHjgkVWpcSUtoGGnKU6Lrt?= =?us-ascii?Q?svj1W/rdQXhkyJEu+fSQHrIgtHOy/6yLaqAtqlyaNqCCfttuNB/4vl7P30lf?= =?us-ascii?Q?jnO2l6Nn2a83BgtuwQZNjEpV8HzQW7jeSkPKNl3fNtzlCdSRRwYSLElAi8N/?= =?us-ascii?Q?gsX1OkAwmpRvQbPUW9Xda3nRIpLFSCbGRlvDnzZTlQVAJl3YLmfodBa4EsUA?= =?us-ascii?Q?QpMplOUxMHtZiM7S1VtcQTxBfkjnmaC17kLq+k9KI+csG4JsKLpjm296gxVj?= =?us-ascii?Q?LRNhAo1CWuXICAbkCvUVHEnZrsIy53DPlKvs0Oz5bgJH6oFue21LciSOWQw9?= =?us-ascii?Q?nJ8ekJ2tyS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YF8X0OtS0?= =?us-ascii?Q?aXNiSxqQq6du0jwRQEk5JSRlrJOjkWtkwB2Np03WFP6aLB+Ix62LynPtpPRd?= =?us-ascii?Q?CDUPtAuVhk1ECzk+1aT4PSHaiJsBF53SMmAzawix/dZciH8bHygdtnJXgo+I?= =?us-ascii?Q?egzV58ApWaiHPGe9BZVgArMRX8Ih/DY40o/iNU7eCFfizUgpOFVHp?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2155; 6:lQn0f+FMY7AWsrr9ynfDp8HlNcuYOfGOhMlto6OMSBWTyg/Tvdw0bFQF9I66RdhXLGbTUvqSECwC/bAA/6vxEIPbkj+q5cR1g6ddyfc6k+/nnv2kvGGspIvBP4AQnp5QnWC4esJN1LoS814N3L2dAOf1QBqGDv2fEKjUfThdWy4+bGgbe2rfa8zxeAVZRp3fO0j/paX2Zw259F9zGkU9vhat0OPa0rEEfoslY8QC6clfd+j3byQZ3r67eiCI94tx33Y+Wy4KMYHwZLhxJh+NZQLM1CBXV4265iVs36JMcDVTrBLQ43nFvQHH8giv7lF7fVzuPpckSe9O0BUClP5nP9e6kW9yYn09F36Otd20JiE=; 5:IiT4NOhrhJ/qvLnQvqHDvkTkbO1U16yme20NFxpFJavWAbTHODnB6KTQga4EYRJl/mXOk+QQXpk16VAh2TNKYvg+aK/TLM9lyiXNGl+WVUvterV6rpsmvAgs/yGZl3r2CP9c9xaqHxE2IokIuzISLg==; 24:9ruNdAnP2GlNpBZi3zN7HpfzDVN3anvkq95whhnNSDgFccZBSHvn9bOZRXPeYSnW+XCOX3+Odm6gcrnzRG/OMNkRh7LT3X4TG2mpiHJ+EQo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2155; 7:yLSl9apveOQEjU93WzAVYLzA01T5Dv6P5+WdwELnuv5sifBLY2oftsInEg/7+fQR5tmUok+QNlZT5cmtkASvPmUO3kXzT6o56cdbprHUdoXcFSV5tC/9sb0gA85vE7Bgvfo0UVfCNEH7DTeb1If0w0Aq2LhTIwKhY1jiiCDiN8i0mN5BSwH3ARIoWKfAskSmnpJyTAzJpMkTLxvQHggVImNbwOCDH4lcwKiVAHGtV1QRhcg68yoJ0pTZxRBb2u+g4ELJ0VhtrEzvR5Xzzki80IVPns5pXAIfvwIYB6Sxsj7+AAgjKOaZYC7lkps7EYw8AGslfuD1DYgxNBxn/yO0V4DVPDPVvZsAnBae0ty1z98= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2016 15:50:27.2809 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2155 X-IsSubscribed: yes The __cpu_indicator_init and __cpu_model symbols are not safe to use from shared libgcc_s.so from ifunc resolvers, so since gcc-6, only the definitions from static libgcc.a are used, however the symbols are kept in libgcc_s as well for backward compatibility (with appropriate symbol version). On targets without such backward compatibility concern add cpuinfo to the static library only (this avoids running the ctor, reduces libgcc_s size and elf abi concerns because of gnu symbol versions). build tested on x86_64-linux-gnu and x86_64-linux-musl. ok to commit? i'd like to back port this to gcc-6 because musl dynamic linker cannot load the libgcc_s.so.1 with the versioned symbols (not an abi break: those symbols were never used on musl and the current code does not work). libgcc/ChangeLog: 2016-11-11 Szabolcs Nagy * config.host (i[3456]86-*-musl*, x86_64-*-musl*): Use i386/t-cpuinfo-static instead of i386/t-cpuinfo. * config/i386/t-cpuinfo-static: New. diff --git a/libgcc/config.host b/libgcc/config.host index 4291cfe..64beb21 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1320,7 +1320,14 @@ esac case ${host} in i[34567]86-*-* | x86_64-*-*) - tmake_file="${tmake_file} i386/t-cpuinfo" + case ${host} in + *-musl*) + tmake_file="${tmake_file} i386/t-cpuinfo-static" + ;; + *) + tmake_file="${tmake_file} i386/t-cpuinfo" + ;; + esac ;; esac diff --git a/libgcc/config/i386/t-cpuinfo-static b/libgcc/config/i386/t-cpuinfo-static new file mode 100644 index 0000000..504307d --- /dev/null +++ b/libgcc/config/i386/t-cpuinfo-static @@ -0,0 +1,4 @@ +# If the compatibility cpuinfo symbols in shared libgcc_s are not needed +# then they can be added to the static library only. + +LIB2ADD_ST += $(srcdir)/config/i386/cpuinfo.c