* Cygwin and Windows Paths Leaking Through
@ 2011-05-26 19:33 sweinberger
2011-05-26 20:05 ` Charles Wilson
2011-06-01 0:09 ` allowed Linux characters (and windows substitutes) Linda Walsh
0 siblings, 2 replies; 6+ messages in thread
From: sweinberger @ 2011-05-26 19:33 UTC (permalink / raw)
To: cygwin
Hi,
I am using Cygwin 1.7.9-1 on my Windows desktop. I ran into a problem a few
weeks ago using the dmake.exe uiliy, wherein dmake wanted the project that I
was builing to be not in Linu convetion, but rather in a Windows notation.
Since ":" and "\" are not acceptable characters in a Linux path, I had to
work around the problem. I just put "/folder1/folder2/filename.extension".
This "trick" worked, so long as everything is on drive C, which in my case
it is.
I should have tried to solve the problem, but I worked around it and got
past the issue, so I left well enough alone, till yesterday.
Yesterday, I downloaded the source for binutils-2.21 and attempted to make
the project. I got as far as line 2374 of /ld/makefile.in. I got a
"missing file or directory" error, which threw me until I figured out that
the problem is not that the file is not there, it is, but rather that
./genscripts.sh expects a Windows path, which is not posslbe to give it and
would conflict with gcc and everything else.
For posterity sake, the binary utiliities source is available at:
ftp://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
Cygwin is supposed to provide an isolated environment totally shielding
applications that run on the inside from even knowing that a Windows
anything exists. That dmake and now something in genscripts does not, means
that the Cygwin wall has some holes.
How do I get around this problem and more importantly how to I put up a
shield such that things on the inside do not see the outside world.
/usr/local should be just that, not C:/cygwin/usr/local. Yes,
/cygwin/usr/local should work too, if on drive C to start. Just in case
anyone is interested, /cygdrive/c/... in these errors does not work. The
offending applets really want windows paths. Thankfully, Windows supports
both \ and / as the same thing.
My posting is on how to fix Cygwin, such that Cygwin acts like it was a real
Linux box and does not have "holes" to the outside world, but as an FYI,
here is the latest error capture:
mv -f .deps/ldmain.Tpo .deps/ldmain.Po
gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include -g -O2
-DENABLE_PLUGINS -DLOCALEDIR="\"/usr/local/share/locale\"" -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT
ldemul.o -MD -MP -MF .deps/ldemul.Tp
o -c -o ldemul.o ldemul.c
mv -f .deps/ldemul.Tpo .deps/ldemul.Po
gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include -g -O2
-DENABLE_PLUGINS -DLOCALEDIR="\"/usr/local/share/locale\"" -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT
ldfile.o -MD -MP -MF .deps/ldfile.Tp
o -c -o ldfile.o \
-DSCRIPTDIR='"/usr/local/mips-elf/lib"' -DBINDIR='"/usr/local/bin"'
-DTOOLBINDIR='"/usr/local/mips-elf/bin"' \
./ldfile.c
mv -f .deps/ldfile.Tpo .deps/ldfile.Po
LIB_PATH='' /bin/sh ./genscripts.sh "." "/usr/local/lib" "/usr/local"
"/usr/local" i686-pc-cygwin mips-unknown-elf mips-elf "elf32ebmip"
"/usr/local/lib /lib /usr/lib" no elf32ebmip "mips-elf"
: No such file or directory line 2: ./emulparams/elf32bmip.sh
make[4]: *** [eelf32ebmip.c] Error 1
make[4]: Leaving directory `/usr/local/binutils-2.21/ld'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/local/binutils-2.21/ld'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/binutils-2.21/ld'
make[1]: *** [all-ld] Error 2
make[1]: Leaving directory `/usr/local/binutils-2.21'
make: *** [all] Error 2
Thanks in advance,
Sarah
--
View this message in context: http://old.nabble.com/Cygwin-and-Windows-Paths-Leaking-Through-tp31711163p31711163.html
Sent from the Cygwin list mailing list archive at Nabble.com.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cygwin and Windows Paths Leaking Through
2011-05-26 19:33 Cygwin and Windows Paths Leaking Through sweinberger
@ 2011-05-26 20:05 ` Charles Wilson
2011-05-26 20:17 ` sweinberger
2011-06-01 0:09 ` allowed Linux characters (and windows substitutes) Linda Walsh
1 sibling, 1 reply; 6+ messages in thread
From: Charles Wilson @ 2011-05-26 20:05 UTC (permalink / raw)
To: cygwin
On 5/26/2011 3:32 PM, sweinberger wrote:
> Cygwin is supposed to provide an isolated environment totally shielding
> applications that run on the inside from even knowing that a Windows
> anything exists.
I don't know where you got that idea. It's perfectly fine to use w32api
functions in combination with cygwin/posix ones -- how do you think
mintty works? -- although you do need to be careful mixing stuff like
posix select() and w32 WaitFor*().
> That dmake and now something in genscripts does not, means
> that the Cygwin wall has some holes.
>
> gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include -g -O2
> -DENABLE_PLUGINS -DLOCALEDIR="\"/usr/local/share/locale\"" -W -Wall
> -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT
> ldemul.o -MD -MP -MF .deps/ldemul.Tp
> o -c -o ldemul.o ldemul.c
^^^^^^^^^^^^^^^^^
Here's your problem: binutils and gcc don't support compiling "in the
source tree". You need to create a separate, empty build directory
*outside* the src directory, and run configure/make in there.
Dunno about your dmake problems, someone else will have to address that.
--
Chuck
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cygwin and Windows Paths Leaking Through
2011-05-26 20:05 ` Charles Wilson
@ 2011-05-26 20:17 ` sweinberger
2011-05-26 20:24 ` Charles Wilson
0 siblings, 1 reply; 6+ messages in thread
From: sweinberger @ 2011-05-26 20:17 UTC (permalink / raw)
To: cygwin
Here's your problem: binutils and gcc don't support compiling "in the
> source tree". You need to create a separate, empty build directory
> *outside* the src directory, and run configure/make in there.
I did just that.
I downloaded binutils-2.21 and expanded everything into a new empty folder.
Here is where I downloaded everything to:
/usr/local/binutils-2.21.
/binutils-2.21 is a new folder.
I changed directories to that folder, executed the .configure line, in my
case,
./configure --target=mips-elf
and I then entered "make" (without the double quotes).
I got most of the way through, but keeled over in the ld subfolder with the
error message shown above.
The make file changed the active path to /usr/local/bin-utils-2.21/ld
The make file then executed:
LIB_PATH='' /bin/sh ./genscripts.sh "." "/usr/local/lib" "/usr/local"
"/usr/local" i686-pc-cygwin mips-unknown-elf mips-elf "elf32ebmip"
"/usr/local/lib /lib /usr/lib" no elf32ebmip "mips-elf"
You can type the above command line directly and get the same error, namely:
: No such file or directory line 2: ./emulparams/elf32bmip.sh
The shell script thinks that ./emulparams/elf32bmip.sh does not exist. From
its point of view it does not, because of Windows path / Cygwin path
differences. The shell script thinks of the path as C:/.../elf32bmip.sh for
whatever reason. The relative path does not matter.
Thanks,
Sarah
--
View this message in context: http://old.nabble.com/Cygwin-and-Windows-Paths-Leaking-Through-tp31711163p31711473.html
Sent from the Cygwin list mailing list archive at Nabble.com.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cygwin and Windows Paths Leaking Through
2011-05-26 20:17 ` sweinberger
@ 2011-05-26 20:24 ` Charles Wilson
2011-05-26 21:21 ` sweinberger
0 siblings, 1 reply; 6+ messages in thread
From: Charles Wilson @ 2011-05-26 20:24 UTC (permalink / raw)
To: cygwin
On 5/26/2011 4:17 PM, sweinberger wrote:
>
>
> Here's your problem: binutils and gcc don't support compiling "in the
>> source tree". You need to create a separate, empty build directory
>> *outside* the src directory, and run configure/make in there.
>
> I did just that.
>
> I downloaded binutils-2.21 and expanded everything into a new empty folder.
> Here is where I downloaded everything to:
>
> /usr/local/binutils-2.21.
>
> /binutils-2.21 is a new folder.
>
> I changed directories to that folder, executed the .configure line, in my
> case,
>
> ./configure --target=mips-elf
>
> and I then entered "make" (without the double quotes).
No, that's exactly what you should NOT do: you are attempting to build
inside the same folder where the source is.
You need to create a DIFFERENT (really empty, as opposed to full of a
bunch of source files) folder, say:
/usr/local/build-binutils/
and do this:
$ cd /usr/local/build-binutils/
$ /usr/local/binutils-2.21/configure (options)
$ make
--
Chuck
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cygwin and Windows Paths Leaking Through
2011-05-26 20:24 ` Charles Wilson
@ 2011-05-26 21:21 ` sweinberger
0 siblings, 0 replies; 6+ messages in thread
From: sweinberger @ 2011-05-26 21:21 UTC (permalink / raw)
To: cygwin
Hi Chuck,
You are right. I had to create a separate folder, which in my case I used
your advice and did /usr/local/build-binutils.
I also found out that the reason for my earlier problems with the make file
complaining about carriage returns was because I used WinZip to expand the
binutils-2.21.tar.bz file and not tar.
Creating a separate folder and doing make failed with the process saying
that some folder was already configured. Obviously, working in the same
folder corrupted things, so I decided to start off clean. I deleted my
source folder and used tar to create and expand things into the
/usr/local/binutils-2.21 folder. I got a complaint during the tar process
about unable to set 501 permission on files, but I ignored those.
I then went to the newly created build-binutils folder and did the tree
steps (configure line, make, make install) and everything completed with no
errors or warnings.
My problem was as you said. I built from the source folder rather than a
new folder.
I learnt something new.
Thank you Chuck!
Sarah
--
View this message in context: http://old.nabble.com/Cygwin-and-Windows-Paths-Leaking-Through-tp31711163p31711938.html
Sent from the Cygwin list mailing list archive at Nabble.com.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: allowed Linux characters (and windows substitutes)...
2011-05-26 19:33 Cygwin and Windows Paths Leaking Through sweinberger
2011-05-26 20:05 ` Charles Wilson
@ 2011-06-01 0:09 ` Linda Walsh
1 sibling, 0 replies; 6+ messages in thread
From: Linda Walsh @ 2011-06-01 0:09 UTC (permalink / raw)
To: cygwin
sweinberger wrote:
> Since ":" and "\" are not acceptable characters in a Linux path, I had to
> work around the problem.
----
I don't know where you got this idea, but on linux, you can put
: and "\" in filenames just fine. Only "/" and "\000" (ASCII NUL) can't
be in a _file_name ("/", obviously works fine in pathnames).
/home> uname --kernel-name --hardware-platform
/home> llg -d C*
drwsrwsr-x 4 lw devel 4096 May 29 10:38 CPAN-ishtar-build-cache/
drwxrwx--- 65 lw lwgrp 4096 Mar 2 2010 C:\Windows/
Note in my "C:\Windows" dir, that's a real colon and backslash,
Not the "full-width" or "presentation forms" one has to use to get a similar
filename on Windows...
Colon: "ï¼" U+FE13 (Presentation Form for Vertical Colon)
Backslash: "ï¼¼" U+FF3C (FullWidth Reverse Solidus)
There also also 'small colon and small reverse solidus' but I've not
used them but they would also appear to work to _display_ a colon and
backslash in a windows filename.
However, on Linux the 'ascii' versions work just fine. 0x3a(colon) &
0x5c(backslash/reverse solidus).
Note, : and \ have no special meaning on linux -- so they are not device or
directory separators if that was something you needed.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-06-01 0:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-26 19:33 Cygwin and Windows Paths Leaking Through sweinberger
2011-05-26 20:05 ` Charles Wilson
2011-05-26 20:17 ` sweinberger
2011-05-26 20:24 ` Charles Wilson
2011-05-26 21:21 ` sweinberger
2011-06-01 0:09 ` allowed Linux characters (and windows substitutes) Linda Walsh
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).