Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Reply-To: Cygwin List Message-Id: <6.2.0.14.0.20050124092933.05593df0@pop.prospeed.net> Date: Mon, 24 Jan 2005 09:34:01 -0500 To: peter AT wyrmberg DOT co DOT uk, cygwin AT cygwin DOT com From: Larry Hall Subject: Re: TEXT mode, BINARY mode default file opening In-Reply-To: <1106555053.11795.26.camel@localhost.localdomain> References: <1106555053 DOT 11795 DOT 26 DOT camel AT localhost DOT localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 03:24 AM 1/24/2005, you wrote: >Hello, > >I am new to the list a have only been using CYGWIN for a few months. > >I would like to use the GNU compiler as a cross compiler for a Windoze >machine and I am having problems with the files being opened in BINARY >mode, I think. > >I have the whole system running on Windoze 2000 using an old version of >CYGWIN circa version 1.5.5, it all works perfectly but when I try and >install it on a Windoze XP machine it CYGWIN falls over with a heap >allocation error. So, looking at the FAQ etc I learn that I need the new >version of CYGWIN. > >I install the latest version of CYGWIN on my Windoze XP machine and I >have no heap problems but what I get now is 'Invalid token in >expression' errors from the compiler on lines of code that wrap past the >carriage return. I understand that this is due to the way in which MSDOS >and UNIX text files are stored. Anyway looking at the FAQ etc, I find >that there is an environmental variable CYGWIN which if I make >=nobinmode it will not open the files in BINARY. Well sure enough if I >run CYGWIN and type mount all my mounts are in TEXT mode. But the >compiler still doesn't work. Looking deeper, I find that the latest >versions of CYGWIN default to BINARY and older ones TEXT mode. This I >think explains it. But how do I get the compiler to open the files in >TEXT mode. > >This is what I think is happening. The compiler is being activated from >JAVA application which is creating an MSDOS shell. When the compiler is >called, the CYGWIN DLL loads, when this happens will the CYGWIN >environment variable be used? I also have found information that says is >the path called is explicit with a drive letter for example, then the >opening mode will be BINARY. Can this be changed to TEXT? > >Unfortunately I can't change all the files to remove the extra carriage >returns or line feeds as the files are used by other programs. So I >think my options are: > >1. Try and find a way of CYGWIN to open the files correctly (if indeed >it is caused by CYGWIN, note I don't say problem with CYGWIN) >2. Try and find an intermediate version of CYGWIN, I think 1.5.9 has the >XP heap fixed but not the default mount mode changed. >3. Recompile the compiler with --no-cygwin, will this allow it to work >in Windozes without CYGWIN? >4. Recompile the compiler with a windows compiler so as to make it a >native windoze application. > >Well, thanks for reading all that, I hope some of you out there have >some good thoughts, and ideas for me to try. Why don't you try mounting your source directory in cygwin as "text" and then use 'cygpath -u' on the files that you're passing to gcc? This will make Cygwin use the mode specified by mount. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 838 Washington Street (508) 893-9889 - FAX Holliston, MA 01746 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/