From patchwork Wed Feb 22 12:23:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yash Shinde X-Patchwork-Id: 60516 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp545538wrd; Wed, 22 Feb 2023 04:24:22 -0800 (PST) X-Google-Smtp-Source: AK7set/jG/2rMd2CDJKzGx4gH0YjV1REoxPAnt6RcKxEUdW/4CDjt0kkQrzBdcGyIZd4gxHYx66c X-Received: by 2002:a17:906:9255:b0:88a:cbd1:e663 with SMTP id c21-20020a170906925500b0088acbd1e663mr16804395ejx.6.1677068662046; Wed, 22 Feb 2023 04:24:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677068662; cv=none; d=google.com; s=arc-20160816; b=uQz3aXH/FgkObv0vVRPBlmwbUHNVqnuTq/lC+P34xdDstt4ARD2nagPsJiX8uxlLFR KDSAume6aBo+e1pt4vt6P/oITA1O5jtyLk5M8rRiYHtW5Fppm90fn+cGNektKJP09tbr 89m3jIPJzp9RYxY9OGdX5n/XqXTb7qpw493mGTgCgzEU21DK2GTdBNJlNbRx8IpTdG2h oG9qEHqxbPSYeRQpMZUE9m9/oQg4fzScZARgN/GltcPe3DH9OWEROWJ+fn17Qqjcppod yWse9XYaYkB5lvyecpjGGh3WZxbA25xb3z0NvZCiC8I4hL81z4Ovge3RaKcPS6OF6+mS VGBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dmarc-filter:delivered-to; bh=2XuFX7S73/CfT5hwsgA35KiacO8AkbOtQtfeeD/Esus=; b=eoPyARlkYXRBl8kEZTdd2ZuxZPX20pzTM7MAJPKNom24b9iWMPGbx45b93xb4RiZN3 Q/1kT9hCxYhoHIqr+jWfcLqZRpUNOSIPdhpQG0v9QPDqxPa1lFNTd4lNB4aTz3E4DKv9 cI2iDfGY3b/BHqcnGfWsIWRvVEEiPmE51q3Gx5rJL0eaLA+hm9UKMRI+wJz7IMxK/tyS xFwTTPXn3b4RMvcOBvofPz3sMYjQypO1PiT8cbSbEAIUnzKZLw4OSOfMDFDTIu5V1IWP 30gx0xSOwxHsyO93rgu8bveuooj1ap3ul3xyLe/sne4DvQXZG+q9BGINxM3B13mq82wu Q37w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=eDoW2vI3; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=windriver.com Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id fq30-20020a1709069d9e00b008c85af719fasi13421280ejc.435.2023.02.22.04.24.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 04:24:22 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=eDoW2vI3; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=windriver.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA0913858C52 for ; Wed, 22 Feb 2023 12:24:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by sourceware.org (Postfix) with ESMTPS id 31BCD3858D33 for ; Wed, 22 Feb 2023 12:23:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31BCD3858D33 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=windriver.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=ala-lpggp3.wrs.com Received: from pps.filterd (m0250812.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31MBcqZu006521; Wed, 22 Feb 2023 12:23:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PPS06212021; bh=2XuFX7S73/CfT5hwsgA35KiacO8AkbOtQtfeeD/Esus=; b=eDoW2vI3i8mOBI/BqssxuqVs5HRxoruZ4acTaxjljX3pSehKVDrxR6nTSdahfYbvvwdD nPL9Z1KEiRnwof0Hgksd2uw6RXtfLs8tdyVHFMJpF+B7iQMw8cHr+ak1bCL0ZMtrq10w FNwDOB/uFEwpblMDG++I488VstO1vNo3P3aIEYOFSa5PUY9EU5ESjnfdOzJQkuT1pPuN i7P5Mg71HAy/gyOxSQomHQDAIQlNGxJo7UMgLiUrul8IeyVgbcNRkyqni0jTvUyVZ3CE 4LuOn98aEKipi/TfW5x7rh0jOyA2EXDrhcC+J23a1zFnbMGGHKNJmhSMG4Mlnz57Rfhu pg== Received: from ala-exchng01.corp.ad.wrs.com (unknown-82-252.windriver.com [147.11.82.252]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3ntpem3qq5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 22 Feb 2023 12:23:44 +0000 Received: from ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Wed, 22 Feb 2023 04:23:43 -0800 Received: from ala-lpggp3.wrs.com (147.11.136.210) by ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) with Microsoft SMTP Server id 15.1.2507.18 via Frontend Transport; Wed, 22 Feb 2023 04:23:43 -0800 Received: by ala-lpggp3.wrs.com (Postfix, from userid 23306) id 03082903411; Wed, 22 Feb 2023 04:23:42 -0800 (PST) From: Yash Shinde To: CC: , , Subject: [PATCH] libgcc_s: Use alias for __cpu_indicator_init instead of symver Date: Wed, 22 Feb 2023 04:23:33 -0800 Message-ID: <20230222122333.28218-1-Yash.Shinde@windriver.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: VKX6cNDvpQjWgbM11f8Ngge8F0L8Jik3 X-Proofpoint-GUID: VKX6cNDvpQjWgbM11f8Ngge8F0L8Jik3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-22_05,2023-02-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=465 bulkscore=0 spamscore=0 malwarescore=0 impostorscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302220109 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_SHORT, NO_DNS_FOR_FROM, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758533949132321754?= X-GMAIL-MSGID: =?utf-8?q?1758533949132321754?= From: Khem Raj Adapter from https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00899.html This fix was debated but hasnt been applied gcc upstream since they expect musl to support '@' in symbol versioning which is a sun/gnu versioning extention. This patch however avoids the need for the '@' symbols at all libgcc/Changelog: 2015-05-11 Szabolcs Nagy * config/i386/cpuinfo.c (__cpu_indicator_init_local): Add. (__cpu_indicator_init@GCC_4.8.0, __cpu_model@GCC_4.8.0): Remove. * config/i386/t-linux (HOST_LIBGCC2_CFLAGS): Remove -DUSE_ELF_SYMVER. gcc/Changelog: 2015-05-11 Szabolcs Nagy * config/i386/i386-expand.c (ix86_expand_builtin): Make __builtin_cpu_init call __cpu_indicator_init_local instead of __cpu_indicator_init. Signed-off-by: Khem Raj Signed-off-by: Yash Shinde --- gcc/config/i386/i386-expand.cc | 4 ++-- libgcc/config/i386/cpuinfo.c | 6 +++--- libgcc/config/i386/t-linux | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc index 3eddbc94360..aee05e813cc 100644 --- a/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc @@ -12647,10 +12647,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, { case IX86_BUILTIN_CPU_INIT: { - /* Make it call __cpu_indicator_init in libgcc. */ + /* Make it call __cpu_indicator_init_local in libgcc.a. */ tree call_expr, fndecl, type; type = build_function_type_list (integer_type_node, NULL_TREE); - fndecl = build_fn_decl ("__cpu_indicator_init", type); + fndecl = build_fn_decl ("__cpu_indicator_init_local", type); call_expr = build_call_expr (fndecl, 0); return expand_expr (call_expr, target, mode, EXPAND_NORMAL); } diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c index dab1d98060f..cf824b4114a 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -63,7 +63,7 @@ __cpu_indicator_init (void) __cpu_features2); } -#if defined SHARED && defined USE_ELF_SYMVER -__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0"); -__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0"); +#ifndef SHARED +int __cpu_indicator_init_local (void) + __attribute__ ((weak, alias ("__cpu_indicator_init"))); #endif diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux index 8506a635790..564296f788e 100644 --- a/libgcc/config/i386/t-linux +++ b/libgcc/config/i386/t-linux @@ -3,5 +3,5 @@ # t-slibgcc-elf-ver and t-linux SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver -HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS) +HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS) CRTSTUFF_T_CFLAGS += $(CET_FLAGS)