From patchwork Tue Oct 27 21:14:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 1388962 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gcc.gnu.org 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=YIl5XaKJ; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4CLPcR1lFGz9sV7 for ; Wed, 28 Oct 2020 08:15:18 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 039EB3851C0B; Tue, 27 Oct 2020 21:15:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 039EB3851C0B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1603833313; bh=8K6ZatVDlIpz4IZ633996N0hUyqhpQh140bsqDnrbmQ=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=YIl5XaKJoGWsy5k6XPVf/sZYnrIOLPus1tl5ZdULvW8eiypTdzjQkJBlsI00fBP6g iI08ZI5duAo7qaKjbREWc8WWSgpd9Suq8qvYdyHMjUI2LXF4xMCeY/T0URuNAsaV+0 BAqIDc5ETgtvNxIHwdPxyPjDuGo8MJA/qG1thNFE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150042.outbound.protection.outlook.com [40.107.15.42]) by sourceware.org (Postfix) with ESMTPS id 631DD3857C4D for ; Tue, 27 Oct 2020 21:15:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 631DD3857C4D Received: from AM6P193CA0079.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::20) by AM6PR08MB5285.eurprd08.prod.outlook.com (2603:10a6:20b:a3::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Tue, 27 Oct 2020 21:15:07 +0000 Received: from AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:88:cafe::3c) by AM6P193CA0079.outlook.office365.com (2603:10a6:209:88::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Tue, 27 Oct 2020 21:15:07 +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 AM5EUR03FT008.mail.protection.outlook.com (10.152.16.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Tue, 27 Oct 2020 21:15:07 +0000 Received: ("Tessian outbound d5e343850048:v64"); Tue, 27 Oct 2020 21:15:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d2a2cf7e832a1013 X-CR-MTA-TID: 64aa7808 Received: from 68059c8aa4bb.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4A8821F6-3310-4027-92CA-2E2FED31C772.1; Tue, 27 Oct 2020 21:15:00 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 68059c8aa4bb.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 27 Oct 2020 21:15:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QamGtJ7e2PYox1VgyJeLL7rPIz9s8CjNMu7ohW0+YMNnLMVQvTVuy5FlKY32HGVoaqaFQTfEpmYAOd93MsTNgOW1/vEyZH7cLsJRfDwflt2VeS6zR81ZzrCbzYbmX8SHPR9qJmDqrOkNsExqWBo03eefmJaDaQqQbGlvHtcGcMvqOowrl4uMvvj6B9HSty4stN6V5/dw6MwEQQ38phLpipfo6H+xpuNPDM8LwG+L1NyxOBsxoi5ccC7hhOgZ2jRvbFYIKZbrpBW3J992vr9IErXWrRz1QECoyvB1qpWQh6R+mRSWOpoLX+T7dziw4gNXcPMU5/X4t3xQjgvdnMe7Cg== 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=8K6ZatVDlIpz4IZ633996N0hUyqhpQh140bsqDnrbmQ=; b=gil9w2f055wsCDL2TQm+HNoj7u3qmlMS8xkI2RFLS/2rWeBoMBn9D+zR2A6+47vn5q9yA8tjyA1FV22CnnajLz4GbcgTy/rfe3pv3p8CpRQSSwegpHHkqi45dePd0f7syv24x+AhW2WNMbvWc6kMj/xDu3FiqpgXADrrbOVaOTDRLEyKlUYr6gTz089wniPrLip/ESHQdQmKLvMMM3Eqb6jH699oJQmlZfYnWpn54w2xzlRtUfp/GbmuoNNDYXzEw2ko0EPwyXzNjC35pc1RB+MeXK6DSIK7xhIJB6VUpYzmYgjJxed7Ghd9I6KyPOqvX/eyV1wuesWhR5WmwLOJxg== 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 VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by VE1PR08MB4864.eurprd08.prod.outlook.com (2603:10a6:802:aa::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Tue, 27 Oct 2020 21:14:58 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::d0e7:49cd:4dae:a2a2]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::d0e7:49cd:4dae:a2a2%6]) with mapi id 15.20.3455.037; Tue, 27 Oct 2020 21:14:58 +0000 Date: Tue, 27 Oct 2020 21:14:55 +0000 To: gcc-patches@gcc.gnu.org Subject: [PATCH][driver] Don't add suffix for non-files Message-ID: Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [217.140.106.53] X-ClientProxiedBy: LNXP265CA0030.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::18) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.53) by LNXP265CA0030.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Tue, 27 Oct 2020 21:14:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 68a731e5-de2d-4279-2ece-08d87abd613e X-MS-TrafficTypeDiagnostic: VE1PR08MB4864:|AM6PR08MB5285: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Ml1B2uXTVgRgrGY7Bqi3lfxMrBsxE+OGz+i1SCjwALAxdUauj8t7HBnQA7sqj+sX1mcWKcBVmEjG0kVVg1TYpvty1ycm+DSvDp7pY9XxJGlgEIF28AWZKMnJPjwqm6xE/VCcb6Erv7TErbx5yDmgKVVWz5owoPbgNCovIXuj8WKoCvV/FB4b0UWDDbdCcmeuQxlD5NewoO2ZTgeqcYxtyDLF5G24S6j9HmHw1M8hS4aR0xRx+UyGEOCY0bUwyPZoD+AvXIpsAxeDNlboBlxwXck/VfdoGXp/xnDdrlWZQEx5WfIW3YgXhq4y2/IjS6/CvfbIKPm/66CFQNX+q1fgsHRA6hJi0Qx+K1DcgxQRgzLuMdOrv1dPWPnSv2k5vfX18MdmdP0Jgn5VA3Td4JHavdT2Lxo1+ZHIFxtvi9NNhXqHItC03hEGcZj6tmVomQiVer0HrqKHRmTac7cA/8dwBZxi90zx+rEeveC8AfCtZjM= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB5325.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(136003)(346002)(396003)(366004)(39860400002)(83380400001)(66556008)(8886007)(186003)(52116002)(86362001)(2906002)(235185007)(44832011)(8936002)(36756003)(316002)(26005)(956004)(44144004)(7696005)(5660300002)(33964004)(8676002)(66476007)(66616009)(16526019)(66946007)(478600001)(2616005)(6916009)(6666004)(55016002)(966005)(4326008)(4216001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wTxda0UYNjgudC8oGzR080W6H6fmM+5JmOzgvRpXEyMvwXk8tXy23GwdgJ6CB8J5ShuTYvKmc1oA74zyaLBXM9H2nmfJpukGZ61hfv5ytzvWjq1q1nZMdZuQzBX9w/zVm4HGp6Xioa2HEY9Wbte0uvMnjk359wHlAGVEzLsLk7NLsG1gRDfZz8Ej+B1dfaWAZ4eL1XH/82bychW/QD0pSvHdDEaPvQUWlWAMVRNNngPefeTtnMv1IaZK7tGljssumSyswP88hbNjrCPvxrW4PC6bgox+i7qTct7iwkQbmtTe2/4VccTsB03K1FA+flxmkltWS1iYmtpWXpCTuN22JyYh/woUYqN6+xr4CeSxM1mmXHjfutBv4AZoGt7+pg6P7eaALdXKDSKoxypxxzThjlyxFOgVtoN4hKYYRi10f+gPWJs89L5tp2a63S1ToLGcq8ssdB2IZovGFsCFidI6kuSQqV233925oyNDyUyJtPNnlmW4hGOsNp/jO486Ai5nBOH+a9MfX2TebaK2YgYaR5cH6Ye7vTFO+8x8Ez5aKZhKUkTmvYs2J+zBzpQddXWQL9t0ky3+fDiDbMOitW+m0i2vvXKvXEtZsmjb1ORy1+OmrjZnMq/pMsKe5QjJJM+75iO3V1jGyDRbnVjraS2pMg== X-MS-Exchange-Transport-Forked: True X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4864 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: AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 0b268382-ce54-49d4-7256-08d87abd5c01 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RbhNejJo4f+jsBzi5dXNa0bAJP4yfCfGWOmNvbh0mpsxnn4Pu7NpSD4p5qyA7yVGZ6aQUM4S1LqFQnk30BO5Li+OJ6/zrpfYZmCKnSGlqXA6AX/313+TJ4/1yRSb2m6dHdNAOCNsGzRfozbCWEDt5Aj5fQYO6Um12CqijrtMk85Mu2u+YCT9t55SxF+8qTIdx5peQVeFJaXfE0a4gplvIMGI9v//EsA4CzK6gwNtw6QWA1ITkqNvoL1tae6UKkdB35IGcdsO7L4eDyHoGG0ZB4ToXj2JaFqv5Qvxu991PpuEDA7lnEMgL2+jC5hi10ZYxowoUglJPZBeXXtHv4x/Klow/DU96zKSK6dALBFHydLX5RAtiBBkZLtslRjAWsxccrM7uMCrKZ1rpDanTZ1UZjgKJ0cpJYJiXGkqO/i4d3HuqDsXmh8QCswhvwpTFpvtTlw3p/HP+iZu0C9b5ZcR5Im76iRNi/XEDsmnpqPptS+pViT4xjgmKcLCqZJ9VBRKVjAX6UjhwQam3xh16a8yEg== 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)(346002)(376002)(39860400002)(396003)(46966005)(316002)(966005)(70206006)(66616009)(4326008)(70586007)(26005)(44832011)(6666004)(86362001)(8936002)(36756003)(6916009)(356005)(478600001)(107886003)(235185007)(2906002)(956004)(55016002)(82310400003)(336012)(8676002)(16526019)(83380400001)(5660300002)(8886007)(33964004)(36906005)(44144004)(47076004)(186003)(82740400003)(2616005)(81166007)(7696005)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2020 21:15:07.1208 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68a731e5-de2d-4279-2ece-08d87abd613e 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: AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5285 X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, 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: Tamar Christina via Gcc-patches From: Tamar Christina Reply-To: Tamar Christina Cc: nd@arm.com, joseph@codesourcery.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi All, This patch fixes an issue where on systems that are HAVE_TARGET_EXECUTABLE_SUFFIX the driver calls convert_filename in order to add the suffix to the filename. However while it excludes `-` it doesn't exclude the null device. This patches changes the check to exclude anything that is not a file by calling not_actual_file_p instead. This also fixes a bug in not_actual_file_p which was accidentally testing a the global variable output_file instead of the supplied argument. This hasn't been an issue so far because because not_actual_file_p was only used on output_file till now. This fixes the adding of an extension to the nul device which is against the recommendations on msdn[0] and makes it harder for the next tool in line to detect it. Bootstrapped Regtested on x86_64-w64-mingw32 and no issues. Did do a bootstrap on x86_64-pc-linux-gnu but no regtest as it's not a HAVE_TARGET_EXECUTABLE_SUFFIX system. [0] https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file Ok for master? and backport to GCC 8, 9 and 10. Thanks, Tamar gcc/ChangeLog: PR driver/97574 * gcc.c (convert_filename): Don't add suffix to things that are not files. (not_actual_file_p): Use supplied argument. diff --git a/gcc/gcc.c b/gcc/gcc.c index cdf4d4f2403e6236ff0f33c4def95bc445a51dee..1dae98f81da8ce39ec27554d11904efafffaa2cb 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -3653,7 +3653,7 @@ convert_filename (const char *name, int do_exe ATTRIBUTE_UNUSED, #if defined(HAVE_TARGET_EXECUTABLE_SUFFIX) /* If there is no filetype, make it the executable suffix (which includes the "."). But don't get confused if we have just "-o". */ - if (! do_exe || TARGET_EXECUTABLE_SUFFIX[0] == 0 || (len == 2 && name[0] == '-')) + if (! do_exe || TARGET_EXECUTABLE_SUFFIX[0] == 0 || not_actual_file_p (name)) return name; for (i = len - 1; i >= 0; i--) @@ -10544,7 +10544,7 @@ static bool not_actual_file_p (const char *name) { return (strcmp (name, "-") == 0 - || strcmp (output_file, HOST_BIT_BUCKET) == 0); + || strcmp (name, HOST_BIT_BUCKET) == 0); } /* %:dumps spec function. Take an optional argument that overrides