Re: RFC: Issue about assumption of DOSish file-system for cygwin

Kai Tietz
2011-03-22T18:11:41Z

2011/3/22 Dave Korn <dave.korn.cygwin@gmail.com>:
> On 22/03/2011 11:00, Kai Tietz wrote:
>
>> I noticed this issue while working on those directory-separator thing
>> for DOSish file-systems, and somehow this looks odd to me. For some
>> reason the filenames.h header assumes for cygwin DOSish file-system,
>> but in fact cygwin uses POSIXish file-system. I assume this definition
>> was caused by the times cygwin compiler had -mno-cygwin option, but
>> well I think we should correct this by following patch.
>> Dave, might it be that I am overlooking here something obvious, why
>> cygwin should assume DOSish filesystem?
>
>  Cygwin works in mixed mode, it can use both dos and posix paths; it'll even
> preserve them into e.g. things like debug info:
>
>> $ as C:/hello.s -o C:/hello2.o -g
>>
>> $ ls C:/hello.s C:/hello2.o -la
>> -rw-r--r-- 1 DKAdmin None  437 Mar 22 17:56 C:/hello.s
>> -rw-r--r-- 1 DKAdmin None 1084 Mar 22 17:57 C:/hello2.o
>>
>> $ nm C:/hello2.o
>> 00000000 b .bss
>> 00000000 d .data
>> 00000000 r .rdata
>> 00000000 N .stab
>> 00000000 N .stabstr
>> 00000000 t .text
>>          U ___main
>> 00000000 T _main
>>          U _puts
>>
>> $ objdump -g C:/hello2.o
>>
>> C:/hello2.o:     file format pe-i386
>>
>> C:/hello.s:
>> /* file C:/hello.s line 10 addr 0x0 */
>> /* file C:/hello.s line 11 addr 0x4 */
>> /* file C:/hello.s line 12 addr 0x7 */
>> /* file C:/hello.s line 13 addr 0xa */
>> /* file C:/hello.s line 14 addr 0xb */
>> /* file C:/hello.s line 15 addr 0xd */
>> /* file C:/hello.s line 16 addr 0xe */
>> /* file C:/hello.s line 17 addr 0x11 */
>> /* file C:/hello.s line 18 addr 0x16 */
>> /* file C:/hello.s line 19 addr 0x1d */
>> /* file C:/hello.s line 20 addr 0x22 */
>> /* file C:/hello.s line 21 addr 0x27 */
>> /* file C:/hello.s line 22 addr 0x2a */
>> /* file C:/hello.s line 23 addr 0x2b */
>> /* file C:/hello.s line 24 addr 0x2c */
>> /* file C:/hello.s line 25 addr 0x2f */
>>
>> $ as /cygdrive/c/hello.s -o C:/hello3.o -g
>>
>> $ objdump -g C:/hello3.o
>>
>> C:/hello3.o:     file format pe-i386
>>
>> /cygdrive/c/hello.s:
>> /* file /cygdrive/c/hello.s line 10 addr 0x0 */
>> /* file /cygdrive/c/hello.s line 11 addr 0x4 */
>> /* file /cygdrive/c/hello.s line 12 addr 0x7 */
>> /* file /cygdrive/c/hello.s line 13 addr 0xa */
>> /* file /cygdrive/c/hello.s line 14 addr 0xb */
>> /* file /cygdrive/c/hello.s line 15 addr 0xd */
>> /* file /cygdrive/c/hello.s line 16 addr 0xe */
>> /* file /cygdrive/c/hello.s line 17 addr 0x11 */
>> /* file /cygdrive/c/hello.s line 18 addr 0x16 */
>> /* file /cygdrive/c/hello.s line 19 addr 0x1d */
>> /* file /cygdrive/c/hello.s line 20 addr 0x22 */
>> /* file /cygdrive/c/hello.s line 21 addr 0x27 */
>> /* file /cygdrive/c/hello.s line 22 addr 0x2a */
>> /* file /cygdrive/c/hello.s line 23 addr 0x2b */
>> /* file /cygdrive/c/hello.s line 24 addr 0x2c */
>> /* file /cygdrive/c/hello.s line 25 addr 0x2f */
>>
>> $
>
>    cheers,
>      DaveK
>
>

Ok, thanks for explaining it. I am just a bit concerned here about the
ABSOLUTE path detection. As then for cygwin this will be for UNIXish
path never true. So it might be necessary here for cygwin case to
allow \|/ and <drive>':/ for absolute path detection.

Cheers,
Kai