From patchwork Thu Nov 3 09:52:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 14790 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp424228wru; Thu, 3 Nov 2022 02:54:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5xtOprlVU8uASD9BNpRCPd+hrMHHZb0uKqOzoqkGJ4y573bCrdE33JNBFhN0f0QoUtKjAg X-Received: by 2002:a17:906:846b:b0:7ad:88f8:469a with SMTP id hx11-20020a170906846b00b007ad88f8469amr27965629ejc.519.1667469262747; Thu, 03 Nov 2022 02:54:22 -0700 (PDT) Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id y9-20020a056402270900b0046013b7e7efsi724333edd.631.2022.11.03.02.54.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 02:54:22 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=jK4sMSih; arc=fail (signature failed); 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 86039385840D for ; Thu, 3 Nov 2022 09:54:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 86039385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667469261; bh=cI6XZ3PFgOsqd3CPBOLRVP1J+wtK2vbU7B7TyukXrxw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=jK4sMSihsURvabjNBPKEZnRQnYza8uK2MhqHT+KF3JTN5IDsskXD3xwJ7NmGDOzK4 Oaew795wKXVUofDPBqz4QosmwAbnmrk0rRzwwAdXuZ2n/peRgDB0Gn1FQ8gQ7GkIP1 96LZ40D3UaG/UkEWZ4+JCfuJrHRF/Ln2x45SXt5U= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2069.outbound.protection.outlook.com [40.107.20.69]) by sourceware.org (Postfix) with ESMTPS id 61E043858C60 for ; Thu, 3 Nov 2022 09:53:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 61E043858C60 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Es+QxFjpsYuQLg39p8Zsw0TFdwshVCRdtStjCx9W6mJfWr6FxMKXAEOWh6I9dX3jFqQ3uR0SuH3mqShmephvfa6qReswc5sKhDxT9qPgZzXtixfPM/7C6mrczgDtf++Pc5LwI27wEqb9LTHU2QZF96afFTC5CC/idqG+G8Y+nuiVNbU5+kim0R63iDyu0JECcvtkKpxHCMFt9iQEZUVz6qtnxaPMu4dbaRcXlZBsCDKSU+V9NMxVqGnbc8rB6iE89M91niOmsmFwfWh6d1xPwcOAao2W89qQWCHRCIhdqt8eLxDEikNzy5CiIAeM2j/ZV0HU2JHjf2pz8VnQ2KnvXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cI6XZ3PFgOsqd3CPBOLRVP1J+wtK2vbU7B7TyukXrxw=; b=aGVqXTTOdrIvEhKIdOFzFG3bJV5zKEFSXpAp4gYBdqOZS4UlBWGJ3/jyrkawP+1cB5u32KcGBTCk7Ewf6u3CzxgapIl7Hqf2+LO6dCUTOUgCOevYnIjvp1CO4ZYehTGrNNcPL4k3uqhPgtgRxsi5Fk2WNg9iwixpiUY6Nme/GnANDV/ooMXsxUbHApKJXkIGBokmc2JboPtOiTerIbj8R+W1kWtQKS9Aqa2M/fzrYGLPuCJGTXjll9Lld2sT180YZ4MRm4h81nAqJ8ymvk8vYCT6qjTFlUJP9CpWahVf3kLtk7WxI/SB3u/Bsn3drUABiveT5gJ8WWYnathfnReNeQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from DB6PR0802CA0037.eurprd08.prod.outlook.com (2603:10a6:4:a3::23) by PAWPR08MB10305.eurprd08.prod.outlook.com (2603:10a6:102:367::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Thu, 3 Nov 2022 09:53:28 +0000 Received: from DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:a3:cafe::50) by DB6PR0802CA0037.outlook.office365.com (2603:10a6:4:a3::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20 via Frontend Transport; Thu, 3 Nov 2022 09:53:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT040.mail.protection.outlook.com (100.127.142.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20 via Frontend Transport; Thu, 3 Nov 2022 09:53:28 +0000 Received: ("Tessian outbound 58faf9791229:v130"); Thu, 03 Nov 2022 09:53:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d30a3cd82cca19b1 X-CR-MTA-TID: 64aa7808 Received: from 656f99c71e98.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7BE616C4-1169-428D-B483-5581F77925C8.1; Thu, 03 Nov 2022 09:53:17 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 656f99c71e98.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 03 Nov 2022 09:53:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=do1pkC/Z/k8asFU7gqn5MJXVe8tu8ItN3UlJuaixX75zNoltoDdfIb7fxW4WKXF50b3usEN4/aywc/OIOzRy0Xmq3lpL6EHEfN7nxjHHY6dHjA0iRcy5DSSzix/Q46T2lQfwbEPWScFe9JU2bdTHzy82+s4WG0iky9agdYrVDnXc+9dZ8iSJvjN5OFrWPkK/oEnuShHrv97BF8R0PNOW6vGad/QEPLK6/XWQdZTQHgF6gue4rWR2xGr9QJ+YpcV9GK9+9dGEeA/nAt6+ZEcXNZFozko98DVp9/ibGxV4fpskhvRLqmgOaWsKndT2yDWZCedra2+SHYFx1lfpYH2N9w== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cI6XZ3PFgOsqd3CPBOLRVP1J+wtK2vbU7B7TyukXrxw=; b=XZisdGDMCC+ZWuJSl32hA7WvFiCfAYRM2uOYgr+D1JVym65k0k7UX8fEJ0dTDaBzqA9n2Fq3l79PxQ0WHPhMWXkDSCSHaOK166z36abk4WObEdQQ4vZXL3XpvAqumm5iNskB2tjXrVxQY2iSpyk56rIyp8owIAGC01sOb6LqYgEdAtoRR1syhlDU1xKNhT0eugKxm/JWqdAIXd0sD7ttMTdb2V//Z8x7f1lLIkaer50DHoak9xWHJj3Udn7F3NjonmQ+rxMTzsJhFcgczM4herVWbW4Ce0w57jTO6fL3GEpnBQ3FpSaI7f1YX22N/HUWcIGpcOr4lDCjGeFyBNE4GA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from DU2P250CA0013.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:231::18) by AS2PR08MB8951.eurprd08.prod.outlook.com (2603:10a6:20b:5fa::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.19; Thu, 3 Nov 2022 09:53:15 +0000 Received: from DBAEUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:231:cafe::6a) by DU2P250CA0013.outlook.office365.com (2603:10a6:10:231::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22 via Frontend Transport; Thu, 3 Nov 2022 09:53:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT041.mail.protection.outlook.com (100.127.142.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5791.20 via Frontend Transport; Thu, 3 Nov 2022 09:53:14 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Thu, 3 Nov 2022 09:53:14 +0000 Received: from gnu-x86-64-dev-02-dev.lab.cambridge.arm.com (10.7.24.25) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Thu, 3 Nov 2022 09:53:14 +0000 To: Subject: [PATCH v2] genmultilib: Add sanity check Date: Thu, 3 Nov 2022 09:52:59 +0000 Message-ID: <20221103095259.4095606-1-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <5fd04651-5fab-e1d1-ea01-9fc39a1cb207@arm.com> References: <5fd04651-5fab-e1d1-ea01-9fc39a1cb207@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT041:EE_|AS2PR08MB8951:EE_|DBAEUR03FT040:EE_|PAWPR08MB10305:EE_ X-MS-Office365-Filtering-Correlation-Id: 717bb6ce-f5f7-4061-1767-08dabd81420b x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: B25vSa9aUFyYmhv7mCtQyZrP+3C+YiihqQvYV6/bxtkqGGdOJ5Bw/FyvSmJbOWr8XjtU4jeeH+FaecjV0c4E8AsNFOn7lbK3d6tGpB1HjIOhD/9Q9rP5Ew32vZ9os4gD9RAWOJssjWKv9VjB+NNEibHWh/k4FDVIEAnY+mHhwaKDiTBNV+akiLIWLbGim8W2ouBr1r35nZUuxwRr2H2aKJLBR67nj9NdyfLez9Gce1T4gpdpCTKQOwSgpnNRVkxdojw+oOzkmNTgthnTGNK5WvXZpLnVqHWjRRAyDIgMHOgbOcf6+CHk7SQIDjVJS2ReoxmTWktqb1fkshpiYf9GxBaLxyBvaULJs4N2eTDJ/fXQbwRgnFeEIv/gacU8EIqzl2RAVpk3GFw3Wo8XWVhqvnpFw5Str6pQmESA3DHP5Tumg84UVNyV8zAuA0yFEG+o5TV7TqkW6hyWAyvhgqWSfhHBMhoYKROGww/vWn6kqugJBfVMJs/qJnQ5abD6nscOsgB9Q0OJ8InIhe9GEgrRLz4xHdjyf+UWBX21B4Q9otkwPwZxiWNwGT2p1l7gQybOiJ5BE1RGwWNLdrezfIgCXaeFMCNBgS375MnHQLvtVDetlYdcZsl70y/PoLLqGBtjvh7Jf2UYKhL+Vp2i0vgRAwa3qd5ga5aqHL/uPHQrVeCmScomkX+eweMV+KppOBnjvLJu+V9/GmZ3LYghm/qULN8//UwJqeXaoub93/lexlJiNbW7SPuGmjJYetkZTQFbCiTJjfrWYwglqe3qhtVE5PPKdLn2gSYvD1jN1G1Jy92XS0O3bzTplhPQTRkYdc8d X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(39860400002)(136003)(376002)(346002)(451199015)(46966006)(40470700004)(36840700001)(7696005)(6666004)(2616005)(6916009)(316002)(26005)(478600001)(82310400005)(40460700003)(40480700001)(4326008)(41300700001)(36756003)(8936002)(8676002)(70206006)(5660300002)(44832011)(356005)(86362001)(81166007)(36860700001)(82740400003)(2906002)(336012)(426003)(47076005)(1076003)(186003)(70586007)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8951 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: be31003d-9782-45ce-6fb4-08dabd8139f7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wJQj+MgvCMgShJO7vMCgG6Fv982TqDOrwFqSU75pWaBq0a6uOhE1bzo0ZtvFViYbajoIrQFZbb+/IPSNxWlyL862okg18B47K9sYhmepW3QnKk/8nFRvP95SqIMw/1Dx3A8b5ok529Iu3KxO6g332mgKwu+9gEOpPoR1fLFJ0fUjfc/V3UxWE/Z5H3i0gp7M7oc9yRrvvfk/5lPkK+/eg9s9IZ/tXEu+LHufJ1PQMZWiv1T5Ul+hYbZUjBmzjUmF8XwU4UuK8hSNS1Ws7KARb6pTIQA3DANZWdNwaav7dx+NFMx0GKaFMvZasdUHLwpvbVkoAlL20N+1m+nKAg+g60gVmq13tXMpgkZ+WhiJHfvJS+e47c7NH6/m3ZAjtoSsULoVGFLCW1HAgTkw0Rrl1Qzz9lg+W24wWennSmshiI4teBABNbfmQnGmwI7xTgQf0gGClKmfD7RaYtyVNFWztgpd3Tdz818Eaq8g7M1Q2bfibvWPzCC4Box9ynPOXH7gRAC0uprCwNwXvRKoEnOUEk+OvV59TazAAcqEkAg17OFPOZ6JtzLwHUfp0DJAiMhTr+BXEIbWkihsyg5nr9ZwSURcu1RfECRr8F+LvCHm+oPhz1SfNc2y4osWENXlnYkJLuGkHZ3dhJTfmRytgEso79HPxfnGCJmlo4K4JG92fCyDMZPhxIY3otNpbPt4pLQlUxGF+Jdz6uK8UPOZeUNMdzzR43uUYluK5YZsqwsslz+iaX0z1Uv8SyyHCSKu0DMtfZt9isJ97Z0eqIYEUFnykQ== 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:(13230022)(4636009)(376002)(396003)(346002)(136003)(39860400002)(451199015)(46966006)(40470700004)(36840700001)(336012)(1076003)(2616005)(426003)(186003)(7696005)(26005)(47076005)(36860700001)(2906002)(82310400005)(70206006)(70586007)(40460700003)(4326008)(82740400003)(36756003)(6666004)(478600001)(8676002)(81166007)(44832011)(86362001)(41300700001)(8936002)(6916009)(5660300002)(40480700001)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 09:53:28.2644 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 717bb6ce-f5f7-4061-1767-08dabd81420b 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: DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10305 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY 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: , X-Patchwork-Original-From: Christophe Lyon via Gcc-patches From: Christophe Lyon Reply-To: Christophe Lyon 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?1748390054049499020?= X-GMAIL-MSGID: =?utf-8?q?1748468249607220413?= When a list of dirnames is provided to genmultilib, its length is expected to match the number of options. If this is not the case, the build fails later for reasons not obviously related to this mistake. This patch adds a sanity check to help diagnose such cases. Tested by adding an option to t-aarch64 and no corresponding dirname, with both bash and dash. v2: do not use arrays (bash feature). OK for trunk? gcc/ChangeLog: * genmultilib: Add sanity check. --- gcc/genmultilib | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gcc/genmultilib b/gcc/genmultilib index 1e387fb1589..b5f372c8358 100644 --- a/gcc/genmultilib +++ b/gcc/genmultilib @@ -141,6 +141,20 @@ multiarch=$9 multilib_reuse=${10} enable_multilib=${11} +# Sanity check: make sure we have as many dirnames as options +if [ -n "${dirnames}" ]; then + set x $options + nboptions=$# + set x $dirnames + nbdirnames=$# + if [ $nbdirnames -ne $nboptions ]; then + echo 1>&2 "Error calling $0: Number of dirnames ($nbdirnames) does not match number of options ($nboptions)" + echo 1>&2 "options: ${options}" + echo 1>&2 "dirnames: ${dirnames}" + exit 1 + fi +fi + echo "static const char *const multilib_raw[] = {" mkdir tmpmultilib.$$ || exit 1