libtool with mingw hangs building openocd in func_convert_core_msys_to_w32

René Berber rene.berber@gmail.com
Mon Jun 28 14:49:01 GMT 2021


On 6/28/2021 8:56 AM, Dietmar May via Cygwin wrote:

> Thanks for submitting the bug report.
> 
>> I can now see what may be a duplicate report under:
>>
>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=10949
>>
>> responding that //c is deliberate so MSYS does not convert a posix path,
>> so in the Cygwin Mingw build case, the response may be "Don't Do That"! 
> 
> I just re-installed msys2 and tried a few things, with interesting result.
> 
> First, "ls /usr//bin" as well as "ls /usr/////bin" complete successfully 
> under both cygwin and msys2, demonstrating slash compaction.
> 
> However, "ls //usr/bin" hangs, as both apparently evaluate the leading 
> // as a server path.

Well documented here:

https://cygwin.com/cygwin-ug-net/using.html#unc-paths

> For testing libtool's construct, I tried:
> 
> $ cmd //c echo hello
> hello
> 
> which works, and this, which doesn't:
> 
> $ cmd /c echo hello
> 
> Microsoft Windows [Version 10.0.blah]
> (c) Microsoft Corporation. All rights reserved.
> 
> C:\msys64\home\myname>

Your example seems to be inverted, the first form doesn't work, the 
second does with the same results you show (but inverted).

It would be better if you document how you executed those commands, 
we're assuming a mintty terminal running a bash shell, but I haven't 
followed all your messages and it might be a cmd window; results 
shouldn't change anyway, but for completeness sake.

> Interestingly,
> 
> ls //c
> 
> hangs under msys2 (as well as cygwin),

Expected as the documentation link describes, //c is taken as a path to 
a server, you already knew that.

> whereas
> 
> cmd //c
> 
> does not; so it almost seems like msys2 has a hack to recognize that 
> cmd.exe is being invoked ...

No, wrong, cmd is getting an argument which it interprets as it seems 
fit, no hack there.  The same applies to the ls example before, ls 
receives an argument which is expected to be a path, nothing strange.

> However, both of the following also complete successfully under msys2, 
> WITHOUT the double-slash hack:
> 
> $ cmd /c "echo hello"
> hello
> 
> $ cmd "/c" "echo hello"
> hello
> 
> Both seem preferable to bad syntax.
> 
> Of course, there's always the question of why libtool is using cmd.exe 
> instead of /bin/echo, which seems to work just fine ...
> 
> $ /bin/echo "hello world"
> hello world
-- 
R.Berber


More information about the Cygwin mailing list