public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/meson] f44: add 0001-fix-gcc16-response-file.patch (PR16276)
Date: Tue, 17 Nov 2026 14:26:08 GMT	[thread overview]
Message-ID: <179492556834.1.3926725160868135236.rpms-meson-940780b5d0c9@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/meson
Branch : f44
Commit : 940780b5d0c92fcf3be6f1ff6c5760385e99325f
Author : Paolo Bonzini <pbonzini@redhat.com>
Date   : 2026-11-17T15:25:52+01:00
Stats  : +70/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/meson/c/940780b5d0c92fcf3be6f1ff6c5760385e99325f?branch=f44

Log:
add 0001-fix-gcc16-response-file.patch (PR16276)

---
diff --git a/0001-fix-gcc16-response-file.patch b/0001-fix-gcc16-response-file.patch
new file mode 100644
index 0000000..c7ce3f9
--- /dev/null
+++ b/0001-fix-gcc16-response-file.patch
@@ -0,0 +1,68 @@
+From fd94e39a7c274ccf87a8b8875b749666beec0e07 Mon Sep 17 00:00:00 2001
+From: Paolo Bonzini <pbonzini@redhat.com>
+Date: Tue, 20 Oct 2026 16:42:57 +0200
+Subject: [PATCH] ninjabackend: fix gcc_rsp_quote for GCC 16
+
+Up to GCC 15 (and in clang), a backslash *always* escapes the following
+character, even inside single quotes.  Starting with GCC 16, backslashes
+inside single quotes are literal as in sh.  Avoid quotes and escape every
+special character with a backslash, which works the same way in both cases;
+only newlines still have to be placed in single quotes, which is safe.
+
+This change was done in https://github.com/gcc-mirror/gcc/commit/a87954610f5e48a89b63a3194df9f5087bdc2f77:
+
+> 1. Backslashes within single quotes should not be treated as an
+> escape, thus: '\a' should split to \a, retaining the backslash.
+>
+> 2. Backslashes within double quotes should only act as an escape if
+> they are immediately before one of the characters $ (dollar),
+> ` (backtick), " (double quote), ` (backslash), or \n (newline).  In
+> all other cases a backslash should not be treated as an escape
+> character.  Thus: "\a" should split to \a, but "\$" should split to
+> $.
+>
+> 3. A backslash-newline sequence should be treated as a line
+> continuation, both the backslash and the newline should be removed.
+
+This fixes the failure in the MESON_RSP_THRESHOLD=0 CI job, which can
+be reproduced locally with:
+
+    MESON_RSP_THRESHOLD=0 ./run_single_test.py test\ cases/common/107*
+
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+---
+ mesonbuild/backend/ninjabackend.py | 18 ++++++++++++------
+ 1 file changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
+index 79a791a2fe20..d64a2250346e 100644
+--- a/mesonbuild/backend/ninjabackend.py
++++ b/mesonbuild/backend/ninjabackend.py
+@@ -90,15 +90,21 @@ def cmd_quote(arg: str) -> str:
+     execute_wrapper = []
+     rmfile_prefix = ['rm', '-f', '{}', '&&']
+ 
++GCC_RSP_UNSAFE_PAT = re.compile(r'[^\w@%+=:,./-]', re.ASCII)
++
+ def gcc_rsp_quote(s: str) -> str:
+     # see: the function buildargv() in libiberty
+     #
+-    # this differs from sh-quoting in that a backslash *always* escapes the
+-    # following character, even inside single quotes.
+-
+-    s = s.replace('\\', '\\\\')
+-
+-    return quote_func(s)
++    # Up to GCC 15 (and in clang), a backslash *always* escapes the following
++    # character, even inside single quotes.  Starting with GCC 16, backslashes
++    # inside single quotes are literal as in sh.  Avoid quotes and escape
++    # every special character with a backslash, which works the same way in
++    # both cases.  The exception is newlines, for which a backslash is a line
++    # continuation in sh; place them in single quotes instead.
++
++    if not s:
++        return "''"
++    return GCC_RSP_UNSAFE_PAT.sub(lambda m: "'\n'" if m.group() == '\n' else '\\' + m.group(), s)
+ 
+ # a conservative estimate of the command-line length limit
+ rsp_threshold = mesonlib.get_rsp_threshold()

diff --git a/meson.spec b/meson.spec
index 7718617..910c5a0 100644
--- a/meson.spec
+++ b/meson.spec
@@ -103,6 +103,8 @@ BuildRequires:  /usr/bin/wx-config
 BuildRequires:  /usr/bin/sdl2-config
 %endif
 
+Patch0001: 0001-fix-gcc16-response-file.patch
+
 %generate_buildrequires
 %pyproject_buildrequires
 

                 reply	other threads:[~2026-11-17 14:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=179492556834.1.3926725160868135236.rpms-meson-940780b5d0c9@fedoraproject.org \
    --to=pbonzini@redhat.com \
    --cc=git-commits@fedoraproject.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