Cygwin aarch64 command-line weirdness with PowerShell?
Jon Turney
jon.turney@dronecode.org.uk
Tue Nov 10 16:30:15 GMT 2026
On 10/11/2026 09:45, Johannes Schindelin wrote:
> Hi Jon & Aswin,
>
> On Tue, 10 Nov 2026, Jon Turney wrote:
>
>> I've made some progress on plumbing support for aarch64 into the Cygwin
>> packaging system.
>>
>> We're now providing a very minimal set of aarch64 packages in our
>> package repository (i.e. just cygwin and bash (statically linked and
>> without readline), at the moment).
>>
>> Assuming you have a Windows 11 arrch64 machine, you can install those
>> aarch64 packages using the x86_64 build of the very latest Cygwin setup
>> (2.941), and providing the '--arch aarch64' option.
>>
>> But I don't have any aarch64 hardware, so I can't usefully test or debug
>> any of it.
>>
>>
>> In brief experiments with a GitHub aarch64 runner, 'bash --login' from
>> powershell fails bizarrely [1] with "/usr/bin/bah: --loginn: invalid
>> option" [sic], but the same thing succeeds from cmd [2].
>>
>> Which maybe suggests something strange going on with the handling of the
>> command line?
>
> I was able to reproduce and diagnose it. It's Cygwin's source code itself,
> which removes the quotes that PowerShell (but not CMD) adds around the
> executable name; That logic uses `strcpy()` on overlapping regions, which
> isn't correct, but the generic x86_64 implementation seems to paper over
> that.
>
> Patch incoming.
Ha!
I'd a vague suspicion that strcpy/memcpy chunking/alignment might be
involved, but I was completely unaware that PS actually quotes it's
arguments differently.
Thanks very much for the patch!
(I guess the assumption that this usage is ok might have slipped in in
other places as well...)
More information about the Cygwin-developers
mailing list