From: Eli Zaretskii <eliz@gnu.org>
To: Pedro Alves <pedro@palves.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/Windows testsuite: Embed asInvoker manifest in test executables
Date: Sat, 11 Jul 2026 09:07:40 +0300 [thread overview]
Message-ID: <86ldbijbyr.fsf@gnu.org> (raw)
In-Reply-To: <17aacd11-cc42-43eb-8328-bdcedcc0dfb5@palves.net> (message from Pedro Alves on Fri, 10 Jul 2026 19:59:17 +0100)
> Date: Fri, 10 Jul 2026 19:59:17 +0100
> Cc: gdb-patches@sourceware.org
> From: Pedro Alves <pedro@palves.net>
>
> It's curious that you bring up patch.exe. In the downstream testcase
> I mention, the initial comment that I wrote there mentioned "patch" as "bad"
> word too (as some docs somewhere mention it), and then after the initial fix,
> I noticed that "patch" is actually OK, and so I dropped it from the comment
> in a follow up patch.
It used to be a problem in some older builds of Windows 11 (and nasty
one not even a manifest could work around it), but ceased to be a
problem a few system updates ago. I have no idea what is the
situation on Windows 10, though.
> $ mv update.exe patch.exe
> $ ./patch.exe
> Hello!
>
> So looks like Microsoft decided that "patch" wasn't a bad word after all
> at some point more recently...
Yes. But do we want to rely on the test suite being run only on the
latest builds of Windows?
> Also, I noticed that executables produced by the GCC 16 that comes with
> MSYS2 do not have the issue. (??!) Digging a bit, it turns out that both MSYS2 and
> Cygwin ship a default-manifest.o object file that GCC pulls in via a spec file.
> This default-manifest.o file is in a separate optional package, which may be
> removed, and GCC keeps working, just won't link in the default manifest.
>
> https://gcc.gnu.org/legacy-ml/gcc-patches/2014-04/msg01378.html
> https://sourceforge.net/p/mingw-w64/wiki2/default_manifest/
Thanks, that's good to know.
> Find below the new patch adding a manifest to every executable in the testsuite. WDYT of this one?
LGTM.
> + # Embed our manifest file. Pass it in Windows-native form.
> + # MSYS2's argument conversion treats a "/foo:/bar" argument as a
> + # colon-separated list of POSIX paths and mistakenly rewrites it
> + # to a semicolon-separated list of Windows paths. E.g.:
> + #
> + # "/manifestinput:/c/gdb/.../windows.manifest"
> + # =>
> + # "C:\msys64\manifestinput;C:\gdb\...\windows.manifest"
> + #
> + # I.e., the flag name itself gets converted as if it were a path,
> + # and the ":" becomes ";".
> + #
> + # What triggers the conversion is the value after the colon looking
> + # like an absolute POSIX path (a leading "/"). "/manifest:embed"
> + # above is left alone because "embed" doesn't. Passing the value
> + # as a native "C:/..." path likewise avoids it.
> + set manifest [host_file_normalize ${srcdir}/lib/windows.manifest]
> + lappend ldflags ldflags=-Wl,/manifestinput:${manifest}
IME, you can work around this incorrect conversion by setting
MSYS_NO_PATHCONV=1.
next prev parent reply other threads:[~2026-07-11 6:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 17:43 [PATCH] gdb/Windows testsuite: Avoid "bad" words in exe names Pedro Alves
2026-07-10 5:18 ` Eli Zaretskii
2026-07-10 18:59 ` [PATCH] gdb/Windows testsuite: Embed asInvoker manifest in test executables Pedro Alves
2026-07-10 19:09 ` Pedro Alves
2026-07-11 6:07 ` Eli Zaretskii [this message]
2026-07-22 14:16 ` Pedro Alves
2026-07-10 14:41 ` [PATCH] gdb/Windows testsuite: Avoid "bad" words in exe names Andrew Burgess
2026-07-10 19:14 ` Pedro Alves
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=86ldbijbyr.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
/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