From patchwork Thu Mar 2 19:25:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Costas Argyris X-Patchwork-Id: 63524 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp29874wrd; Thu, 2 Mar 2023 11:26:07 -0800 (PST) X-Google-Smtp-Source: AK7set9Jh6J2pUlLVw3+IFZHTB+eBajFi/nIdHnHcTdoygLo17hFSdO48SuA+cmbsSw1OCOs2TDZ X-Received: by 2002:aa7:d68f:0:b0:4c0:57b:47a9 with SMTP id d15-20020aa7d68f000000b004c0057b47a9mr3714382edr.35.1677785167000; Thu, 02 Mar 2023 11:26:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677785166; cv=none; d=google.com; s=arc-20160816; b=SbOl/dZwzpv0Yk5G2KxZcvgV3uYVmF/RfX8z/VEKj1coF41frPLkC8S7uc0YbxtMI2 nmDO5NBjX6AE3HoGRHI7cK90Rn9h8GTBJKf3sJinubrgj29xp3CpWfyaLBrLL6v8i0F7 MYxzKiHATSoc5ihnFYlo0bFD4GhQHZI4DQQzDjxm4pK0xye2k+T/1P/YnEeFqoq0+KnM 7HMkflFU+tUfvb/46eA2Ww9pGZhBYVzxdSRlmNlMpGiREF9uwVqUjsd4Th3XbdH2Tyg7 0kTCmkztaD+cyxN/eByn6+o15/+ef4+UDaJDzkylw3ESkMod0j7t70I0ook0w9xlYDhB aXag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:to:subject :message-id:date:mime-version:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=UzByK9LLcqZWr4sktGGC/b0OJWbcWSI/RCPzWok20f0=; b=ipWeNFGp2rIVDlIEOmGioBeyAVWyIfZvrbyCnMeebZk6q1kLIniv3liuN3HlEcF6of afepzxMK3y1w5R0MjuWJy35hdhCcfrozef3pzF+xQZfm+JnLt8OgNvGx/eIiiOjFkl4y rmTh377lgs6ZF+suRJPRgTFm2H/zBxUGUCSQBNnHW0riIDGH13pgGfa34WkWsD26CzJa LT5/ZJ4WhXpOS2+mNwwU9HV+pf3S6F/7fMVedoZCW2Byt+x6QxmrnW/6HgOKzbZAYj+h BNJthY7A9PzLuCFi5DzArxbqAbEPWnG5zaHLJJqdBbz+mhVZVFe2e7Vd5MdK8S4EvosO 35Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jLfpJGff; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 sourceware.org ([2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id g16-20020a170906349000b008b85ed1bbc1si87509ejb.206.2023.03.02.11.26.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 11:26:06 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jLfpJGff; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 B56493858296 for ; Thu, 2 Mar 2023 19:26:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B56493858296 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677785165; bh=UzByK9LLcqZWr4sktGGC/b0OJWbcWSI/RCPzWok20f0=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=jLfpJGffP8GOlKcFDjJdoRoA1j919DBjsynLFrUsDs3nt8/4Nfd7XskPN7b8b2DGi 2RR3Q/jJTU8Z9KoTpRuRzbcFP5BmZAzixs20rQbJsq7v3DikOFPujg8UlRWQoWxobG ktbj/ZbFhNlWivma2QN5rFcZir1WjYiLn2Z9iZBE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by sourceware.org (Postfix) with ESMTPS id 7A3363858C83 for ; Thu, 2 Mar 2023 19:25:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A3363858C83 Received: by mail-ed1-x52e.google.com with SMTP id i34so1279493eda.7 for ; Thu, 02 Mar 2023 11:25:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677785120; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=T5TvHHuE8yD11I80zuH1GRumQrYGAdIeYwYhTLF1SY8=; b=4HiQgAAa8xscIzZRBQlRBMWakE2Xo2FkSNu+X6cTB6okSuUL/3l5eyauwbhD72RqPL Q/e7nj+6JD1+U13mSQt3joi1wWRGqbqCpuYrkP36NYmSb+TiETIhTSPv8VWhWvMgTdEq dzzhxXhBCe0ynJMgHK9zC3tO6TkD3aS9rbV8lhg6J1UJOxof41H9ldU1oPydHHbSCfU3 cWgTuzPR15MmfclaJxg9bdBdNflHDOHe81y41rUuHHC1RUHFegfZzuFZ+Wu/pmF+m/0B Jabc9yrXYiOjaBOEcHLj7iAuidKuTUD6s35CxQenXlhOFIufIG5y9sQZkjMRZyD0F9n3 mw1Q== X-Gm-Message-State: AO0yUKXKQCpSsAqB0chL5ZJC0/oU58TWkiL+7PR5C18joBKmZmz/BDCQ bKWS3DYKIBksYmHkyAReFZRlk80Gt08XO0fR8kN2tuuqRh2MYQ== X-Received: by 2002:a17:906:14c5:b0:877:747d:4a85 with SMTP id y5-20020a17090614c500b00877747d4a85mr5902742ejc.3.1677785119849; Thu, 02 Mar 2023 11:25:19 -0800 (PST) MIME-Version: 1.0 Date: Thu, 2 Mar 2023 19:25:08 +0000 Message-ID: Subject: [PATCH] driver: Treat include path args the same way between cpp_unique_options and asm_options. [PR71850] To: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Costas Argyris via Gcc-patches From: Costas Argyris Reply-To: Costas Argyris 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?1759285259463073983?= X-GMAIL-MSGID: =?utf-8?q?1759285259463073983?= This is a proposal to fix PR71850 by applying the existing logic for passing include paths to cc1 to as. Thanks, Costas From 393aff0d006ee9372cc8b9321c612c2dfb4b0a31 Mon Sep 17 00:00:00 2001 From: Costas Argyris Date: Thu, 2 Mar 2023 18:27:22 +0000 Subject: [PATCH] driver: Treat include path args the same way between cpp_unique_options and asm_options. [PR71850] On Windows, when a @file with many include paths is passed to gcc, it forwards those include paths to cc1 through a temporary @file as well, so they don't end up in the command line. This is because cpp_unique_options has %@{I* which passes -I args in a temporary file, if a temporary file was passed to the driver in the first place. The same logic is not applied in asm_options, and this leads to the include paths being passed as command line arguments to the assembler, which causes the failure on Windows seen in PR71850. Treating the -I args to the assembler the same way as to the compiler (that is, through a @tempfile if @file was passed to gcc) solves the issue, allowing a large number of include paths to be passed to gcc on Windows through a @file. --- gcc/gcc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/gcc.cc b/gcc/gcc.cc index becc56051a8..b1fa80cde4f 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc @@ -1278,7 +1278,7 @@ static const char *asm_options = #if HAVE_GNU_AS /* If GNU AS is used, then convert -w (no warnings), -I, and -v to the assembler equivalents. */ -"%{v} %{w:-W} %{I*} " +"%{v} %{w:-W} %@{I*} " #endif "%(asm_debug_option)" ASM_COMPRESS_DEBUG_SPEC -- 2.30.2