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: 65928 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5084F385841C for ; Thu, 2 Mar 2023 19:25:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5084F385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677785150; 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=c2icLPHYmYZeMXzRWTEKMZ1gQHP/JXAhTV8M7ASlfCaFM+vxpTJcmPlfw8Hw62cbp 4pmJBFh2OmY8bGhIJqRpcxOuK36YknDupB0MNUF0xxEn7KsxhT3UgiyVZmVKpy5FTU zCp7G9rNkf1eX4hfPc4HykTr6oeg+6PiOzcsySPc= 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-Google-Smtp-Source: AK7set87moNBedCepSU8Lew9pxNX6L3qjNA058en/dJsLwIoOaAuOea6HHYo4cdBDdGFHzo6CBSDVyKqdbtuWSvcRR0= 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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