public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Costas Argyris <costas.argyris@gmail.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] driver: Treat include path args the same way between cpp_unique_options and asm_options. [PR71850]
Date: Thu, 2 Mar 2023 19:25:08 +0000	[thread overview]
Message-ID: <CAHyHGCnvvm=9dvGFYebmKw_jo+S7NfmWERb0ZWNOsYiCaX+ynA@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 121 bytes --]

This is a proposal to fix PR71850 by applying the existing logic for
passing include paths to cc1 to as.

Thanks,
Costas

[-- Attachment #2: 0001-driver-Treat-include-path-args-the-same-way-between-.patch --]
[-- Type: text/x-patch, Size: 1511 bytes --]

From 393aff0d006ee9372cc8b9321c612c2dfb4b0a31 Mon Sep 17 00:00:00 2001
From: Costas Argyris <costas.argyris@gmail.com>
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


             reply	other threads:[~2023-03-02 19:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 19:25 Costas Argyris [this message]
2023-03-09 13:39 ` Costas Argyris
2023-03-20  9:47   ` Costas Argyris
2023-03-27  9:36     ` Costas Argyris
2023-03-27  9:59       ` Xi Ruoyao
2023-03-27 10:11         ` Costas Argyris
2023-04-17  8:29           ` Costas Argyris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHyHGCnvvm=9dvGFYebmKw_jo+S7NfmWERb0ZWNOsYiCaX+ynA@mail.gmail.com' \
    --to=costas.argyris@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).