Re: [PATCH] ld: testsuite: Fix a few backslash-related issues on MinGW.

"Maciej W. Rozycki" <[email protected]> Sat, 18 Jul 2026 18:53:21 +0100 (BST)
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>
On Fri, 17 Jul 2026, Jan Dubiec wrote:

> >   This doesn't answer my question; we know from your report that it happens
> > "somewhere in the linker" already.  Please point me at the source code
> > line this happens at.  I have no MinGW host system available to track it
> > down myself.
> I don't know the exact line number, but look at ld/ldfile.c. Near the top it
> has the following definition:
> 
> [...]
> #ifdef VMS
> static char *slash = "";
> #else
> #if defined (_WIN32) && !defined (__CYGWIN32__)
> static char *slash = "\\";
> #else
> static char *slash = "/";
> #endif
> #endif
> [...]

 Thanks for looking into it.  A reference to this arrangement would IMO 
serve as the correct justification in the commit description and while I 
could not approve such a change I would back out my objection.  However...

> But does it really matter? The definition of slash appears to be 30+ years
> old, and the binutils tools have been working successfully on Windows for many
> years. The issue clearly lies with the test cases.

 It does matter to me, I find the inconsistency resulting in a mixture of 
forward and backward slashes a mess.

 And I'm not alone, as GDB has literally just cleaned up that mess; cf.
<https://inbox.sourceware.org/gdb-patches/[email protected]/> 
and especially the discussion downthread for the rationale.  Perhaps we 
should too?

 FWIW the possibility of a cleanup analogous to that was the motivation 
for my objection even though I wasn't aware of the GDB effort at the time, 
as I continue being a little behind with mailing list traffic after a 
recent disruption.  Also interesting timing indeed.

 I think a reasonable course of action would be accepting your change in 
the interim for the upcoming release with the commit description amended 
as requested, and then cleaning up the mess with slashes targetting 2.48.

  Maciej