public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RFC: Issue about assumption of DOSish file-system for cygwin
@ 2011-03-22 11:00 Kai Tietz
  2011-03-22 18:01 ` Dave Korn
  0 siblings, 1 reply; 6+ messages in thread
From: Kai Tietz @ 2011-03-22 11:00 UTC (permalink / raw)
  To: GCC Patches, gdb-patches, Binutils; +Cc: Dave Korn

Hello,

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?

Regards,
Kai

Index: filenames.h
===================================================================
--- filenames.h (revision 171281)
+++ filenames.h (working copy)
@@ -30,7 +30,8 @@
 extern "C" {
 #endif

-#if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) ||
defined (__CYGWIN__)
+#if (defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__)) \
+    && !defined (__CYGWIN__)
 #  ifndef HAVE_DOS_BASED_FILE_SYSTEM
 #    define HAVE_DOS_BASED_FILE_SYSTEM 1
 #  endif

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RFC: Issue about assumption of DOSish file-system for cygwin
  2011-03-22 11:00 RFC: Issue about assumption of DOSish file-system for cygwin Kai Tietz
@ 2011-03-22 18:01 ` Dave Korn
  2011-03-22 18:11   ` Kai Tietz
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Korn @ 2011-03-22 18:01 UTC (permalink / raw)
  To: Kai Tietz; +Cc: GCC Patches, gdb-patches, Binutils

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RFC: Issue about assumption of DOSish file-system for cygwin
  2011-03-22 18:01 ` Dave Korn
@ 2011-03-22 18:11   ` Kai Tietz
  2011-03-22 18:24     ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Kai Tietz @ 2011-03-22 18:11 UTC (permalink / raw)
  To: Dave Korn; +Cc: GCC Patches, gdb-patches, Binutils

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RFC: Issue about assumption of DOSish file-system for cygwin
  2011-03-22 18:11   ` Kai Tietz
@ 2011-03-22 18:24     ` Pedro Alves
  2011-03-22 18:32       ` Kai Tietz
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2011-03-22 18:24 UTC (permalink / raw)
  To: gdb-patches; +Cc: Kai Tietz, Dave Korn, GCC Patches, Binutils

On Tuesday 22 March 2011 18:11:28, Kai Tietz wrote:
> 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.

IS_ABSOLUTE_PATH already allows that when HAVE_DOS_BASED_FILE_SYSTEM is true.

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RFC: Issue about assumption of DOSish file-system for cygwin
  2011-03-22 18:24     ` Pedro Alves
@ 2011-03-22 18:32       ` Kai Tietz
  2011-03-22 18:57         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Kai Tietz @ 2011-03-22 18:32 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Dave Korn, GCC Patches, Binutils

2011/3/22 Pedro Alves <pedro@codesourcery.com>:
> On Tuesday 22 March 2011 18:11:28, Kai Tietz wrote:
>> 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.
>
> IS_ABSOLUTE_PATH already allows that when HAVE_DOS_BASED_FILE_SYSTEM is true.
>
> --
> Pedro Alves
>

Hmm, interesting.  I look in more detail. As for DOSish file-system a
leading slash/backslash isn't necessarily an absolute path. So code is
somewhat broken for native windows.

But well, we can live by this for now.

Thanks for your time.

Kai

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RFC: Issue about assumption of DOSish file-system for cygwin
  2011-03-22 18:32       ` Kai Tietz
@ 2011-03-22 18:57         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2011-03-22 18:57 UTC (permalink / raw)
  To: Kai Tietz; +Cc: pedro, gdb-patches, dave.korn.cygwin, gcc-patches, binutils

> Date: Tue, 22 Mar 2011 19:31:58 +0100
> From: Kai Tietz <ktietz70@googlemail.com>
> Cc: gdb-patches@sourceware.org, Dave Korn <dave.korn.cygwin@gmail.com>, 	GCC Patches <gcc-patches@gcc.gnu.org>, Binutils <binutils@sourceware.org>
> 
> > IS_ABSOLUTE_PATH already allows that when HAVE_DOS_BASED_FILE_SYSTEM is true.
> 
> Hmm, interesting.  I look in more detail. As for DOSish file-system a
> leading slash/backslash isn't necessarily an absolute path.

Yes, it is, for all practical purposes in the context of this
discussion.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-22 18:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-22 11:00 RFC: Issue about assumption of DOSish file-system for cygwin Kai Tietz
2011-03-22 18:01 ` Dave Korn
2011-03-22 18:11   ` Kai Tietz
2011-03-22 18:24     ` Pedro Alves
2011-03-22 18:32       ` Kai Tietz
2011-03-22 18:57         ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).