* RFC: Adding a check to the top level configure script for a binary-mounted cygwin-hosted build directory
@ 2007-05-23 12:52 Nick Clifton
2007-05-23 13:04 ` Paolo Bonzini
0 siblings, 1 reply; 9+ messages in thread
From: Nick Clifton @ 2007-05-23 12:52 UTC (permalink / raw)
To: bonzini, aoliva; +Cc: binutils, gdb-patches
Hi Paolo, Hi Alex,
May I ask for your advice on a configure script matter ?
The Binutils bug PR 4334 has pointed out the problems of trying to
build a toolchain under Cygwin with a build directory mounted in
text mode. So, I think that it is agreed that toolchains should
only be built on bin-mounted drives and I would like the configure
script to make sure that this happens.
I am attaching a provisional patch which I think will do what I
want, but I would like to get your comments it. I tested the
patch under both Cygwin and Linux, and it does not appear to
introduce any new problems, so I am reasonably confident that it
works. But I am not at all sure that I have used the best approach
to the problem. Your comments ?
Cheers
Nick
ChangeLog
2007-05-23 Nick Clifton <nickc@redhat.com>
* configure.ac: Call ACX_CHECK_CYGWIN_MOUNTED_BUILDDIR for
Cygwin based hosts.
* configure: Regenerate.
config/ChangeLog
2007-05-23 Nick Clifton <nickc@redhat.com>
* acx.m4 (ACX_CHECK_CYGWIN_MOUNTED_BUILDDIR): Define.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: RFC: Adding a check to the top level configure script for a binary-mounted cygwin-hosted build directory
2007-05-23 12:52 RFC: Adding a check to the top level configure script for a binary-mounted cygwin-hosted build directory Nick Clifton
@ 2007-05-23 13:04 ` Paolo Bonzini
2007-05-24 9:47 ` Nick Clifton
0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2007-05-23 13:04 UTC (permalink / raw)
To: Nick Clifton; +Cc: bonzini, aoliva, binutils, gdb-patches
Nick Clifton wrote:
> Hi Paolo, Hi Alex,
>
> May I ask for your advice on a configure script matter ?
>
> The Binutils bug PR 4334 has pointed out the problems of trying to
> build a toolchain under Cygwin with a build directory mounted in
> text mode. So, I think that it is agreed that toolchains should
> only be built on bin-mounted drives and I would like the configure
> script to make sure that this happens.
>
> I am attaching a provisional patch which I think will do what I
> want, but I would like to get your comments it. I tested the
> patch under both Cygwin and Linux, and it does not appear to
> introduce any new problems, so I am reasonably confident that it
> works. But I am not at all sure that I have used the best approach
> to the problem. Your comments ?
I haven't looked at the patch yet, but as an aside, I think this should
also go into the main autoconf distribution; there is no reason why
somebody should build under a text-mode mounted directory.
Paolo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: RFC: Adding a check to the top level configure script for a binary-mounted cygwin-hosted build directory
2007-05-23 13:04 ` Paolo Bonzini
@ 2007-05-24 9:47 ` Nick Clifton
2007-05-24 14:27 ` DJ Delorie
0 siblings, 1 reply; 9+ messages in thread
From: Nick Clifton @ 2007-05-24 9:47 UTC (permalink / raw)
To: bonzini, aoliva; +Cc: binutils, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 571 bytes --]
Hi Paolo, Hi Alex,
> I haven't looked at the patch yet, but as an aside, I think this should
> also go into the main autoconf distribution; there is no reason why
> somebody should build under a text-mode mounted directory.
I agree, I think it would be very good to have this check available in
the main autoconf sources.
I am attaching an updated patch which fixes a couple of problems
uncovered in the first version:
* I was not escaping the square brackets in the awk script.
* The check for the "binmode" string needed to be stricter.
Cheers
Nick
[-- Attachment #2: pr4334.patch.2 --]
[-- Type: text/plain, Size: 1690 bytes --]
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/configure.ac,v
retrieving revision 1.10
diff -c -3 -p -r1.10 configure.ac
*** configure.ac 21 Mar 2007 20:11:06 -0000 1.10
--- configure.ac 24 May 2007 09:45:14 -0000
*************** case "${host}" in
*** 965,970 ****
--- 965,971 ----
host_makefile_frag="config/mh-djgpp"
;;
*-cygwin*)
+ ACX_CHECK_CYGWIN_BINMOUNTED_BUILDDIR
host_makefile_frag="config/mh-cygwin"
;;
*-mingw32*)
Index: config/acx.m4
===================================================================
RCS file: /cvs/src/src/config/acx.m4,v
retrieving revision 1.25
diff -c -3 -p -r1.25 acx.m4
*** config/acx.m4 26 Mar 2007 15:38:25 -0000 1.25
--- config/acx.m4 24 May 2007 09:45:14 -0000
*************** AC_DEFUN([ACX_BUGURL],[
*** 597,599 ****
--- 597,618 ----
AC_SUBST(REPORT_BUGS_TO)
AC_SUBST(REPORT_BUGS_TEXI)
])
+
+ dnl ####
+ dnl # ACX_CHECK_CYGWIN_BINMOUNTED_BUILDDIR
+ dnl # On Cygwin hosts, check that the build directory is mounted in
+ dnl # binmode as builds will not work if it is mounted in textmode.
+ dnl # See binutils PR 4334 for more details about why textmode is a problem.
+ AC_DEFUN([ACX_CHECK_CYGWIN_BINMOUNTED_BUILDDIR],[
+ AC_MSG_CHECKING([build directory to see if it is mounted in binmode])
+ build_dir=`pwd`
+ build_dir_mount_point=`df ${build_dir} | awk '/[[0-9]]%/{print $NF;}'`
+ is_binmode=`mount | grep "${build_dir_mount_point} " | grep binmode`
+ if test $? == 0 ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([The build directory is not mounted in binmode])
+ fi
+ ])
+
\ No newline at end of file
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: RFC: Adding a check to the top level configure script for a binary-mounted cygwin-hosted build directory
2007-05-24 9:47 ` Nick Clifton
@ 2007-05-24 14:27 ` DJ Delorie
2007-05-24 15:26 ` Nick Clifton
0 siblings, 1 reply; 9+ messages in thread
From: DJ Delorie @ 2007-05-24 14:27 UTC (permalink / raw)
To: nickc; +Cc: bonzini, aoliva, binutils, gdb-patches
> I agree, I think it would be very good to have this check available in
> the main autoconf sources.
Except that it would penalize MinGW and DJGPP since they don't have a
"binmode" concept. We've put a lot of work into keeping track of
binary vs text files, why give up on it now?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: RFC: Adding a check to the top level configure script for a binary-mounted cygwin-hosted build directory
2007-05-24 14:27 ` DJ Delorie
@ 2007-05-24 15:26 ` Nick Clifton
2007-05-24 15:43 ` DJ Delorie
2007-05-24 18:26 ` Eli Zaretskii
0 siblings, 2 replies; 9+ messages in thread
From: Nick Clifton @ 2007-05-24 15:26 UTC (permalink / raw)
To: DJ Delorie; +Cc: bonzini, aoliva, binutils, gdb-patches
Hi DJ,
>> I agree, I think it would be very good to have this check available in
>> the main autoconf sources.
>
> Except that it would penalize MinGW and DJGPP since they don't have a
> "binmode" concept. We've put a lot of work into keeping track of
> binary vs text files, why give up on it now?
Are the problems described in PR 4334 also present when building under
MinGW or DJGPP ? If not, then we can keep this new autoconf test as a
Cygwin specific test.
If those problems are also present then I would agree with you that we
need to fix the binutils build process.
Cheers
Nick
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: RFC: Adding a check to the top level configure script for a binary-mounted cygwin-hosted build directory
2007-05-24 15:26 ` Nick Clifton
@ 2007-05-24 15:43 ` DJ Delorie
2007-05-25 9:47 ` Corinna Vinschen
2007-05-24 18:26 ` Eli Zaretskii
1 sibling, 1 reply; 9+ messages in thread
From: DJ Delorie @ 2007-05-24 15:43 UTC (permalink / raw)
To: nickc; +Cc: bonzini, aoliva, binutils, gdb-patches
> Are the problems described in PR 4334 also present when building
> under MinGW or DJGPP ? If not, then we can keep this new autoconf
> test as a Cygwin specific test.
I don't have a djgpp build tree at the moment, but djgpp is like
*always* having text mounts. So, you can simulate it with a cygwin
install where everything is text mounted. However, DJGPP's tools know
about CR/LF so it may not expose this "bug".
> If those problems are also present then I would agree with you that
> we need to fix the binutils build process.
IMHO the bug is that cygwin's bash isn't dealing with `` line endings
properly. It's the responsibility of the shell to strip trailing line
endings (1003.2-1992 3.6.3, although it doesn't mention
platform-specific line endings) during command substitution.
Also, cygwin's bash should allow CR/LF pairs as word delimiters during
splitting, if it doesn't already. Cygwin supports mixed mounts, it
needs to deal with the ramifications itself.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: RFC: Adding a check to the top level configure script for a binary-mounted cygwin-hosted build directory
2007-05-24 15:43 ` DJ Delorie
@ 2007-05-25 9:47 ` Corinna Vinschen
2007-05-25 12:15 ` Eric Blake
0 siblings, 1 reply; 9+ messages in thread
From: Corinna Vinschen @ 2007-05-25 9:47 UTC (permalink / raw)
To: binutils, gdb-patches, Eric Blake; +Cc: nickc, bonzini, aoliva, DJ Delorie
On May 24 11:42, DJ Delorie wrote:
>
> > Are the problems described in PR 4334 also present when building
> > under MinGW or DJGPP ? If not, then we can keep this new autoconf
> > test as a Cygwin specific test.
>
> I don't have a djgpp build tree at the moment, but djgpp is like
> *always* having text mounts. So, you can simulate it with a cygwin
> install where everything is text mounted. However, DJGPP's tools know
> about CR/LF so it may not expose this "bug".
>
> > If those problems are also present then I would agree with you that
> > we need to fix the binutils build process.
>
> IMHO the bug is that cygwin's bash isn't dealing with `` line endings
> properly. It's the responsibility of the shell to strip trailing line
> endings (1003.2-1992 3.6.3, although it doesn't mention
> platform-specific line endings) during command substitution.
>
> Also, cygwin's bash should allow CR/LF pairs as word delimiters during
> splitting, if it doesn't already. Cygwin supports mixed mounts, it
> needs to deal with the ramifications itself.
Does that actually happen with the latest bash? It should work fine
on textmode mounts. See
http://cygwin.com/ml/cygwin-announce/2007-05/msg00003.html for more
details on the way bash works with different input files and mounty
modes.
Eric? Can you confirm or deny this problem for the latest bash?
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: RFC: Adding a check to the top level configure script for a binary-mounted cygwin-hosted build directory
2007-05-25 9:47 ` Corinna Vinschen
@ 2007-05-25 12:15 ` Eric Blake
0 siblings, 0 replies; 9+ messages in thread
From: Eric Blake @ 2007-05-25 12:15 UTC (permalink / raw)
To: binutils, gdb-patches, nickc, bonzini, aoliva, DJ Delorie
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Corinna Vinschen on 5/25/2007 3:47 AM:
>> IMHO the bug is that cygwin's bash isn't dealing with `` line endings
>> properly. It's the responsibility of the shell to strip trailing line
>> endings (1003.2-1992 3.6.3, although it doesn't mention
>> platform-specific line endings) during command substitution.
>>
>> Also, cygwin's bash should allow CR/LF pairs as word delimiters during
>> splitting, if it doesn't already. Cygwin supports mixed mounts, it
>> needs to deal with the ramifications itself.
>
> Does that actually happen with the latest bash? It should work fine
> on textmode mounts.
Currently, the only way to get cygwin to ignore \r inside `` pairs
(regardless of text or binary mount, since the text from `` is not coming
from the file system, but from a pipe) is to use the cygwin-specific igncr
shopt, or to add \r to IFS if the expansion of `` is subject to field
splitting. This is because with a cygwin-hosted build directory, the
default platform line ending is \n, not \r\n, for compatibility with
Linux. But ignoring \r is pretty easy; perhaps all that is needed is a
prep step in the cygwin-hosted build that does '(set -o igncr) 2>/dev/null
&& set -o igncr' before calling any djgpp processes inside ``.
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGVtNQ84KuGfSFAYARAiNUAJ91Pv9FvTfaNUxcDTXzXWnkQSj2DgCgm4+F
bKkCHboaSO9zkuQt7/s2Syg=
=wpI5
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: RFC: Adding a check to the top level configure script for a binary-mounted cygwin-hosted build directory
2007-05-24 15:26 ` Nick Clifton
2007-05-24 15:43 ` DJ Delorie
@ 2007-05-24 18:26 ` Eli Zaretskii
1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2007-05-24 18:26 UTC (permalink / raw)
To: Nick Clifton; +Cc: dj, bonzini, aoliva, binutils, gdb-patches
> Date: Thu, 24 May 2007 16:26:27 +0100
> From: Nick Clifton <nickc@redhat.com>
> CC: bonzini@gnu.org, aoliva@redhat.com, binutils@sourceware.org, gdb-patches@sourceware.org
>
> >> I agree, I think it would be very good to have this check available in
> >> the main autoconf sources.
> >
> > Except that it would penalize MinGW and DJGPP since they don't have a
> > "binmode" concept. We've put a lot of work into keeping track of
> > binary vs text files, why give up on it now?
>
> Are the problems described in PR 4334 also present when building under
> MinGW or DJGPP ? If not, then we can keep this new autoconf test as a
> Cygwin specific test.
I think such problems cannot happen with DJGPP or MinGW, so this test
should be kept as Cygwin-specific one.
I agree with DJ that the Cygwin tools had better handle this EOL
problem no matter what's the mount mode, but if Cygwin folks don't
feel like going that way, and think it's okay to force binmode mounts
in this situation, I don't see why we should object.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-05-25 12:15 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-23 12:52 RFC: Adding a check to the top level configure script for a binary-mounted cygwin-hosted build directory Nick Clifton
2007-05-23 13:04 ` Paolo Bonzini
2007-05-24 9:47 ` Nick Clifton
2007-05-24 14:27 ` DJ Delorie
2007-05-24 15:26 ` Nick Clifton
2007-05-24 15:43 ` DJ Delorie
2007-05-25 9:47 ` Corinna Vinschen
2007-05-25 12:15 ` Eric Blake
2007-05-24 18:26 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox