From patchwork Mon Jun 14 14:29:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinath Parvathaneni X-Patchwork-Id: 1491693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=AF3yMFld; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G3Z0b6ZPJz9sW7 for ; Tue, 15 Jun 2021 00:42:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 275073939C37 for ; Mon, 14 Jun 2021 14:42:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 275073939C37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1623681724; bh=Co6lmtKCB1t9qZsIogKotKGy0RRZfP0u6W96E95NtWQ=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=AF3yMFldUkYINGxD4ZNrZieOTnAYA5ScOWyBQUojTcQP9S3pp2L9vTTFAC0nuQri5 bCdYlQF8k8E1UH7GJkRzJI79e7A3O9F+oAgHouHTkjiYIOby9d4ib5G5a8DWE0qxm6 IsO4HC4biUf9M/ndKaPF/R2WBz6FWe9QzfMAA+5E= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) by sourceware.org (Postfix) with ESMTPS id 7B43A384843F for ; Mon, 14 Jun 2021 14:41:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7B43A384843F Received: from AM5PR0402CA0011.eurprd04.prod.outlook.com (2603:10a6:203:90::21) by HE1PR08MB2699.eurprd08.prod.outlook.com (2603:10a6:7:2b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Mon, 14 Jun 2021 14:41:08 +0000 Received: from AM5EUR03FT038.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:90:cafe::f1) by AM5PR0402CA0011.outlook.office365.com (2603:10a6:203:90::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Mon, 14 Jun 2021 14:41:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;gcc.gnu.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT038.mail.protection.outlook.com (10.152.17.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Mon, 14 Jun 2021 14:41:07 +0000 Received: ("Tessian outbound d8701fbbf774:v93"); Mon, 14 Jun 2021 14:41:07 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f8dba95351dd0dcc X-CR-MTA-TID: 64aa7808 Received: from f4fb614009da.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8BCD4664-0541-46AD-856E-7B0F6FC632E4.1; Mon, 14 Jun 2021 14:41:00 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f4fb614009da.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 14 Jun 2021 14:41:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X27K/5IhFokTlv6hwdM3vsAppAfZ9iHL7YSKkWNxPHYVYAo4d+RN7SaU4Ur/+0JwEVLvkqzCMeqoToarnncjeZHu+T1oDNpDcsA8EOozzXU2xw9lOd8w7Rz6558UUNdMGP+Ii4E0wDYKCUG/oS8bPtP18xzwSitEyj8bdmZg7Oiui7c1Uj1d0QUhPra7KxNjVQ/vfd3B9Buc//xpzhjClcsn6PeJ6qmsA+MXYbyVQ0OW0Nq3TzK6//a7E6tcb6rMTjsYwM4cPf/vQs6+C16kzrYGrr5KiYmpCpNyiBjnM0/zLTXlDgRtd8XGRutAcmtCRxEUxGX8NT56mEl19gjF9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Co6lmtKCB1t9qZsIogKotKGy0RRZfP0u6W96E95NtWQ=; b=I7d3T+RUtenS6tT7AD9Qzz+rxn+57apCNEYxPA/obFUmvFEoMFUTg0opcXQRrrXC8rDqkKpuT7+62xh21+qaGQQdh6OAZ99/3KwJlqGpWqpPeYPlLLW2giYxD7JLkC/IWUgIMCg53VMzYj80DW7aW07UIyD4zCD8MnLhAiYWuFWLmcqLPF+Jo3EhQpYmHvBBNR2Wl5QyV+DawzhunSFOHz1iNnft+d6mAlDLHcgXbIOntG3o5Rvz6pZrVyb7okyIR875gQHylPzKeWuxm1FoPSfRuoc1pDA6rQcHt8aX8lXpuCdhttcDLQYu1FPsfwsBVJJv0wWfYa3NPzXVxxfT/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; Received: from VI1PR0802MB2368.eurprd08.prod.outlook.com (2603:10a6:800:9d::10) by VI1PR0802MB2541.eurprd08.prod.outlook.com (2603:10a6:800:b1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20; Mon, 14 Jun 2021 14:40:57 +0000 Received: from VI1PR0802MB2368.eurprd08.prod.outlook.com ([fe80::44e5:2f6b:2aa1:ff11]) by VI1PR0802MB2368.eurprd08.prod.outlook.com ([fe80::44e5:2f6b:2aa1:ff11%11]) with mapi id 15.20.4195.030; Mon, 14 Jun 2021 14:40:57 +0000 Date: Mon, 14 Jun 2021 15:29:02 +0100 To: gcc-patches@gcc.gnu.org Subject: [GCC][PATCH] arm: Fix multilib mapping for CDE extensions [PR100856]. X-Originating-IP: [217.140.106.52] X-ClientProxiedBy: SN7PR04CA0035.namprd04.prod.outlook.com (2603:10b6:806:120::10) To VI1PR0802MB2368.eurprd08.prod.outlook.com (2603:10a6:800:9d::10) Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from e120703-lin.cambridge.arm.com (217.140.106.52) by SN7PR04CA0035.namprd04.prod.outlook.com (2603:10b6:806:120::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Mon, 14 Jun 2021 14:40:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f421800-8ccd-40cf-46a5-08d92f427210 X-MS-TrafficTypeDiagnostic: VI1PR0802MB2541:|HE1PR08MB2699: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 1gZSDng5z+JEJzqdpUaYQAXURDI0GgqWynU5oeDY5STujaDWEMWp6CMcV85jjoSa/cm6RKQ8dxL9o8BLaKS2k8xH3Pr+kZmQujkteU6MTcjsZ6wmSxpxTb6gaFVYjUkkpRsPy/1oM3CzQCpgBud2YA24wOBSzA7sbCzfXUKUjlcxktBVElTDyz70LJvbLTAt+6TsoKbz2Q8c4CtnMjajIGq/gun3hGcwqnWYjuORueQdjJP0xFCtHXg6LLsZ+Dl4JKR+SOl5bFuhmzdLcB4LIZvXTpHAI1a4R6TcuD9QWs58A4RbskMTc/B5s0b+ACg5IvYn+xJV3oef53qVAAfD/Yb+TEmfmwlXveNdBRG6j+k3bwz1kMHeBlKmG6QVOgCdPLI/K9BLP/VgRxj5b3xbn6lrid649Y/+xrry9P2MTJJyZjJX/ZO+H4g34vAi1z+S9UMOUmjTpmzAao5P+prVc/3zesxOlG9Bk9TKjkbm7vTIJHjBZDmQ16SmIDOCMhcgfQtfaHmjXjxeig443msPb+QedG8n4F4BYufn1tJBmiZ93FrauLE6HopM/v42YbSASmduE9lJsWIVmlZEAYE7jnb6vJgR//ijx0MvoPZp9wpar5jBwHvMlu2L1Whr/kN+spMiPeU+xM5GQImSGb4dOGWD6bc+IPN01DWjF0npyZb63toE37apDQs9F1E9eTze36b2DqaWg2SkevF+LjC48GbxO7m/q4OvtzzuoUCXNVoMDG4gA/zrW9baF2oYZNAMK9z6tWiOgAHPQvc1o9hbcw== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0802MB2368.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39850400004)(366004)(376002)(396003)(136003)(346002)(66476007)(6916009)(66556008)(966005)(316002)(6666004)(235185007)(4326008)(66946007)(66616009)(478600001)(83380400001)(26005)(956004)(33964004)(16526019)(186003)(6486002)(52116002)(38350700002)(38100700002)(86362001)(6512007)(33656002)(30864003)(44832011)(52536014)(8936002)(8676002)(2906002)(5660300002)(9686003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qap2Wftx2roK/ZEMHEKscoNe2E5QWZdv6RRe9Y1KrxEWnr+9hCyEYTAvXvXtCR4qGPvVLHq7OUquX1pHYtVVA+EUr11C9s6VxX+wDVVbIEF0lCH21aAc/Vr5NzIw413Lk1cVaTFjj6FGoqV3jvVHeHTF0NJiAK9w+4z1eaEYcRvNIDPg7+fYPr+Qa51uLsTm/ce0A8D4rbow6SdN8ckxkB6YdPrSbsF4Ly1gYz6tydngLy0f+qCeL5f5J2K9AObtfJ4pxwujO+D1R/xEqpO4OwIkpH+bFHKCmFZvywTdBsLEWbgCbX9sVTKYVC2IqvMIg9d677r+bsy4u6AaSR23OY4Yvg593YB305FrG78nnauJzha7rEKwVJDqcBDJ8/g6ygUOZfjWGB5PfSHzni9yh9i0wdNJ0cX61wm7OonfkI6N48b1GHF8d3oeqLZWEVaVG9Niw7+Y2hZIjZxuYgQVw9cDs6074lzbPbH/5bbM+u0h3Ymsm69g2HKFHkwdwSzi9v9Z0jEST1eXepevUBru0ksKyRw8scvjU/0wsIjHE5fT6VdC0q4VZiH8yqmg/tOGaAdyBH8vy1PCSArEU9bJJtqyrEUq0ti1rqxR0CcMESYETCu5KI5T0cE5osl4Vmdt3Sb3H4GoBmQzpuDAwUlycNhum/sXBgL6rHqGXpM4USiz86dR78dizS8RK2J18PfohypnsrvZGr2r3dHfrXD05Sj1uh6kdKITM5poFgYJIDUjy+r5pSu+uGjkD2IHwkCJyo7n6nb98ZVLFj27uTPGUEKpuL7BhnB1GtUqkMPaH1duHJzyhdoI6tXuLDTJiglDOe0yzo0+KNJ5MQfkELy7v84UX3TpOL5TPwmYKpC8HHaU7yH1lRGKU8smMxSFClKyXm8OHlWYBPnLKKD7DPKEaiR/N1wD52poIDlXIV9z7bFPIg35GfdFuh99uLSNJofrubuAHjDzcc5VChO21oY60hyXzrCwZ83dRRopkn/7/cEwpTvNDxx82vSlgQwskpqwGSNYUX+bcSMTfJHu5FXMAwYFF3/fHfjD8V02bJ8LqDZZBAkq8jNyYbJbViUO7cF3ybAAjGa4Zmz9CzAv3XS28nALdRLyuARYRFmPe1NX7I2J4+YaC5gqBBrmva7Tx2RDVZAmU6GEpIYFw1+2raMDPh0AF+vfEhDqvrTvDrnMLWRikGsc+ShpUgeS/SCCZb0rm12pdxvMSeOr5JfrplaIiqqrhRMXNs0hFGv+2f67mMT44rSpYCoc2u+hGxk9jGlubzXzoLDnshXp4NQpx6uEwW4rEeavRSCe9xxY/PfOZq5C3cVz3LoYSPZ+2W/p+uVa X-MS-Exchange-Transport-Forked: True X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2541 Original-Authentication-Results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT038.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b666cabc-5e63-4211-8b34-08d92f426be1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sN/0jWc6cEmVlfdG9mPIO6HqAEcwUSPFSeR8C1BO+0ujDnwQjEfyBQULKIR2dmqDS3Zql6o5yx7MUCrq3glHBIy2+rsMORjKwL7LSHongfjakBkkGJnad4c35GbHTsXflDlAmGssrUSt9ezsZaH/KQzItoSc4RlDMTqSagPAakbHVx4EsBeGn63tpYsAU6jRil03mvfJOjUJ73tpdm0AdVprmT+3ZEsj4xB/gIonoNrqIWLvNXUH54VvrqWTDAB/kUoxEd3NInYfCfqADPYWndWFKrnGmyhit9LYAcRHz680wyKUUa/KP5Qq1WbZHTR/YQsCdP/4IwPu3TSSOAuJ00yZJ33BW+AyHwpS1yhjFvzql+9xPDu2t4B/9a6D7rS9vhAaGLAWt64vEiX+7v10Inc88UttcpqbLAbFOSE+UDf+KR8m3f0QRDt8yhPQhaF2iXZVkBg3qlRStVPlEpkZAOlbBUMJ6Hs/ZL48+Dj6rBGttfqxa5Om0p7rIcYNLgeH8S6mLRbEv0W8fbvO9luSejctrSBANzr6eCComjDQMD1/x9q1vbFJ/QWA6aU16mT4KDjuencxrd6/v5nrumPZb1+TqO7k73jBvpHYmoKyGFfz7SDRezkAMxCDXm+b/DKjkWR6pXgCrcFkbtQVmOnlFJDQLCQopDkN7cjpZCRA5onmkav9KZ2tMUGPmkaNc8hlIu4AvOOrX0R9l1Nq6kw+3mwh9ykErC8zJx7G77620f15YwdJ1xqNJuq4MjSOyRSbpyCyVaWWhPTBfitqB+rw1g== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(136003)(396003)(39850400004)(376002)(346002)(36840700001)(46966006)(44832011)(66616009)(81166007)(4326008)(52536014)(82740400003)(356005)(478600001)(82310400003)(86362001)(30864003)(83380400001)(5660300002)(70206006)(70586007)(316002)(235185007)(2906002)(26005)(6666004)(47076005)(956004)(33964004)(6512007)(9686003)(33656002)(966005)(6486002)(36860700001)(6916009)(8676002)(16526019)(186003)(336012)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2021 14:41:07.6872 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7f421800-8ccd-40cf-46a5-08d92f427210 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT038.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB2699 X-Spam-Status: No, score=-14.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_LOTSOFHASH, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Srinath Parvathaneni via Gcc-patches From: Srinath Parvathaneni Reply-To: Srinath Parvathaneni Cc: nd@arm.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi Richard, I have all addressed all your review comments (in [1]) in the below patch. On passing +cdecp[0-7] extension to the -march string in command line options, multilib linking is failing as mentioned in PR100856. This patch fixes this issue by generating a separate canonical string by removing compiler options which are not required for multilib linking from march string and assign the new string to mlibarch option. This mlibarch string is used for multilib comparison. Regression tested on arm-none-eabi and found no regressions. Ok for master? [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571731.html Regards, Srinath. gcc/ChangeLog: 2021-06-14 Srinath Parvathaneni PR target/100856 * common/config/arm/arm-common.c (arm_canon_arch_option_1): New function derived from arm_canon_arch. (arm_canon_arch_option): Call it. (arm_canon_arch_multilib_option): New function. * config/arm/arm-cpus.in (IGNORE_FOR_MULTILIB): New fgroup. * config/arm/arm.h (arm_canon_arch_multilib_option): New prototype. (CANON_ARCH_MULTILIB_SPEC_FUNCTION): New macro. (MULTILIB_ARCH_CANONICAL_SPECS): New macro. (DRIVER_SELF_SPECS): Add MULTILIB_ARCH_CANONICAL_SPECS. * config/arm/arm.opt (mlibarch): New option. * config/arm/t-rmprofile (MULTILIB_MATCHES): For armv8*-m, replace use of march on RHS with mlibarch. gcc/testsuite/ChangeLog: 2021-06-14 Srinath Parvathaneni PR target/100856 * gcc.target/arm/acle/pr100856.c: New test. * gcc.target/arm/multilib.exp: Add tests for cde options. ############### Attachment also inlined for ease of reply ############### diff --git a/gcc/common/config/arm/arm-common.c b/gcc/common/config/arm/arm-common.c index 9980af6885c3dfe68f61fa0f39b23022b4e59c19..481aa9e43d9c73e464e1e992ad7d94c30d2db001 100644 --- a/gcc/common/config/arm/arm-common.c +++ b/gcc/common/config/arm/arm-common.c @@ -627,9 +627,15 @@ public: The options array consists of couplets of information where the first item in each couplet is the string describing which option name was selected (arch, cpu, fpu) and the second is the value - passed for that option. */ -const char * -arm_canon_arch_option (int argc, const char **argv) + passed for that option. + + arch_for_multilib is boolean variable taking value true or false. + arch_for_multilib is false when the canonical representation is for -march + option and it is true when canonical representation is for -mlibarch option. + On passing arch_for_multilib true the canonical string generated will be + without the compiler options which are not required for multilib linking. */ +static const char * +arm_canon_arch_option_1 (int argc, const char **argv, bool arch_for_multilib) { const char *arch = NULL; const char *cpu = NULL; @@ -694,8 +700,8 @@ arm_canon_arch_option (int argc, const char **argv) /* First build up a bitmap describing the target architecture. */ if (arch) { - selected_arch = arm_parse_arch_option_name (all_architectures, - "-march", arch); + selected_arch = arm_parse_arch_option_name (all_architectures, "-march", + arch, !arch_for_multilib); if (selected_arch == NULL) return ""; @@ -703,6 +709,15 @@ arm_canon_arch_option (int argc, const char **argv) arm_initialize_isa (target_isa, selected_arch->common.isa_bits); arm_parse_option_features (target_isa, &selected_arch->common, strchr (arch, '+')); + if (arch_for_multilib) + { + const enum isa_feature removable_bits[] = {ISA_IGNORE_FOR_MULTILIB, + isa_nobit}; + sbitmap isa_bits = sbitmap_alloc (isa_num_bits); + arm_initialize_isa (isa_bits, removable_bits); + bitmap_and_compl (target_isa, target_isa, isa_bits); + } + if (fpu && strcmp (fpu, "auto") != 0) { /* We assume that architectures do not have any FPU bits @@ -719,7 +734,8 @@ arm_canon_arch_option (int argc, const char **argv) else if (cpu) { const cpu_option *selected_cpu - = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu); + = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu, + !arch_for_multilib); if (selected_cpu == NULL) return ""; @@ -1069,3 +1085,22 @@ arm_asm_auto_mfpu (int argc, const char **argv) #define TARGET_EXCEPT_UNWIND_INFO arm_except_unwind_info struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; + +/* Returns a canonical representation of the -march option from the current + -march string (if given) and other options on the command line that might + affect the architecture. */ +const char * +arm_canon_arch_option (int argc, const char **argv) +{ + return arm_canon_arch_option_1 (argc, argv, false); +} + +/* Returns a canonical representation of the -mlibarch option from the current + -march string (if given) and other options on the command line that might + affect the architecture after removing the compiler extension options which + are not required for multilib linking. */ +const char * +arm_canon_arch_multilib_option (int argc, const char **argv) +{ + return arm_canon_arch_option_1 (argc, argv, true); +} diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in index 0becb4385b675d0e08ea08c97785cabfa8cf7026..ab4b6acf5ea47b1c788dea8f7878141f2a4018cc 100644 --- a/gcc/config/arm/arm-cpus.in +++ b/gcc/config/arm/arm-cpus.in @@ -324,6 +324,8 @@ define implied vfp_base MVE MVE_FP ALL_FP # need to ignore it for matching purposes. define fgroup ALL_QUIRKS quirk_no_volatile_ce quirk_armv6kz quirk_cm3_ldrd xscale quirk_no_asmcpu +define fgroup IGNORE_FOR_MULTILIB cdecp0 cdecp1 cdecp2 cdecp3 cdecp4 cdecp5 cdecp6 cdecp7 + # Architecture entries # format: # begin arch diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 8e5bd5793237e531aa83d998f5756b459dbcb6a7..015299c15346f1bea59d70fdcb1d19545473b23b 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2444,10 +2444,14 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #endif const char *arm_canon_arch_option (int argc, const char **argv); +const char *arm_canon_arch_multilib_option (int argc, const char **argv); #define CANON_ARCH_SPEC_FUNCTION \ { "canon_arch", arm_canon_arch_option }, +#define CANON_ARCH_MULTILIB_SPEC_FUNCTION \ + { "canon_arch_multilib", arm_canon_arch_multilib_option }, + const char *arm_be8_option (int argc, const char **argv); #define BE8_SPEC_FUNCTION \ { "be8_linkopt", arm_be8_option }, @@ -2456,6 +2460,7 @@ const char *arm_be8_option (int argc, const char **argv); MCPU_MTUNE_NATIVE_FUNCTIONS \ ASM_CPU_SPEC_FUNCTIONS \ CANON_ARCH_SPEC_FUNCTION \ + CANON_ARCH_MULTILIB_SPEC_FUNCTION \ TARGET_MODE_SPEC_FUNCTIONS \ BE8_SPEC_FUNCTION @@ -2476,12 +2481,22 @@ const char *arm_be8_option (int argc, const char **argv); " %{mfloat-abi=*: abi %*}" \ " %common.isa_bits); arm_parse_option_features (target_isa, &selected_arch->common, strchr (arch, '+')); + if (arch_for_multilib) + { + const enum isa_feature removable_bits[] = {ISA_IGNORE_FOR_MULTILIB, + isa_nobit}; + sbitmap isa_bits = sbitmap_alloc (isa_num_bits); + arm_initialize_isa (isa_bits, removable_bits); + bitmap_and_compl (target_isa, target_isa, isa_bits); + } + if (fpu && strcmp (fpu, "auto") != 0) { /* We assume that architectures do not have any FPU bits @@ -719,7 +734,8 @@ arm_canon_arch_option (int argc, const char **argv) else if (cpu) { const cpu_option *selected_cpu - = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu); + = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu, + !arch_for_multilib); if (selected_cpu == NULL) return ""; @@ -1069,3 +1085,22 @@ arm_asm_auto_mfpu (int argc, const char **argv) #define TARGET_EXCEPT_UNWIND_INFO arm_except_unwind_info struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; + +/* Returns a canonical representation of the -march option from the current + -march string (if given) and other options on the command line that might + affect the architecture. */ +const char * +arm_canon_arch_option (int argc, const char **argv) +{ + return arm_canon_arch_option_1 (argc, argv, false); +} + +/* Returns a canonical representation of the -mlibarch option from the current + -march string (if given) and other options on the command line that might + affect the architecture after removing the compiler extension options which + are not required for multilib linking. */ +const char * +arm_canon_arch_multilib_option (int argc, const char **argv) +{ + return arm_canon_arch_option_1 (argc, argv, true); +} diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in index 0becb4385b675d0e08ea08c97785cabfa8cf7026..ab4b6acf5ea47b1c788dea8f7878141f2a4018cc 100644 --- a/gcc/config/arm/arm-cpus.in +++ b/gcc/config/arm/arm-cpus.in @@ -324,6 +324,8 @@ define implied vfp_base MVE MVE_FP ALL_FP # need to ignore it for matching purposes. define fgroup ALL_QUIRKS quirk_no_volatile_ce quirk_armv6kz quirk_cm3_ldrd xscale quirk_no_asmcpu +define fgroup IGNORE_FOR_MULTILIB cdecp0 cdecp1 cdecp2 cdecp3 cdecp4 cdecp5 cdecp6 cdecp7 + # Architecture entries # format: # begin arch diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 8e5bd5793237e531aa83d998f5756b459dbcb6a7..015299c15346f1bea59d70fdcb1d19545473b23b 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2444,10 +2444,14 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #endif const char *arm_canon_arch_option (int argc, const char **argv); +const char *arm_canon_arch_multilib_option (int argc, const char **argv); #define CANON_ARCH_SPEC_FUNCTION \ { "canon_arch", arm_canon_arch_option }, +#define CANON_ARCH_MULTILIB_SPEC_FUNCTION \ + { "canon_arch_multilib", arm_canon_arch_multilib_option }, + const char *arm_be8_option (int argc, const char **argv); #define BE8_SPEC_FUNCTION \ { "be8_linkopt", arm_be8_option }, @@ -2456,6 +2460,7 @@ const char *arm_be8_option (int argc, const char **argv); MCPU_MTUNE_NATIVE_FUNCTIONS \ ASM_CPU_SPEC_FUNCTIONS \ CANON_ARCH_SPEC_FUNCTION \ + CANON_ARCH_MULTILIB_SPEC_FUNCTION \ TARGET_MODE_SPEC_FUNCTIONS \ BE8_SPEC_FUNCTION @@ -2476,12 +2481,22 @@ const char *arm_be8_option (int argc, const char **argv); " %{mfloat-abi=*: abi %*}" \ " %