This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [BUG] Cygwin default mounts in 1.7


marco atzeri <marco.atzeri <at> gmail.com> writes:

> 
> On 9/21/2012 10:48 AM, Jiri Engelthaler wrote:
> > Hello Cygwin developers
> > I have a problem with cygwin default mounts
> > I have compiled gcc cross compiler for powerpc (some problem with arm
> > cross) and installed to destination directory. Installed directory
> > structure is (truncated)
> >
> > +bin
> > |   +powerpc-unknown-linux-gnu-gcc.exe
> > +include
> > +lib
> > +libexec
> > |   +gcc
> > |      +powerpc-unknown-linux-gnu
> > |          +4.4.7
> > |               +cc1.exe
> > +powerpc-unknown-linux-gnu
> > +share
> >
> > When I start âpowerpc-unknown-linux-gnu-gcc.exe a.câ in âbinâ
> > directory from windows command line, compiler fails with
> > âpowerpc-unknown-linux-gnu-gcc: error trying to exec 'cc1': execvp: No
> > such file or directoryâ. Starting compiler from bash shell works fine
> > and a.c is compiled.
> > âpowerpc-unknown-linux-gnu-gcc --print-search-dirsâ says that one of
> > search paths for programs is
> > â/usr/bin/../libexec/gcc/powerpc-unknown-linux-gnu/4.4.7/â so all
> > should work.
> > But problem is with â/usr/binâ prefix. I have made tests with âlsâ and
> > âpwdâ copied do âbinâ directory and found that:
> > - âpwdâ is â/usr/binâ
> > - âlsâ shows âbinâ directory content
> > - âls ..â shows âls: cannot access ..: No such file or directoryâ
> > - âls /â shows âbin  cygdrive  dev  etc  include  lib  libexec
> > powerpc-unknown-linux-gnu  proc  shareâ
> >
> > Core of problem is that pwd for âbinâ directory is â/usr/binâ, but
> > â/usr/bin/..â is not accessible.
> > How to mount current directory as "/cygdrive/c/foo/bar/...../bin"
> > while executing pwd or ls?
> >
> >    Thank you for your answer and have a nice day.
> >        Jiri Engelthaler
> >
> 
> Jiri,
> I tried to follow up your mail and I am confused and not really
> sure what is you problem.
> On cygwin "/bin" and "/usr/bin" are the same directory
> (see http://cygwin.com/cygwin-ug-net/using.html#mount-table)
> 
> $ mount
> E:/cygwin/bin on /usr/bin type ntfs (binary,auto)
> E:/cygwin/lib on /usr/lib type ntfs (binary,auto)
> 
> as /usr/bin is a mount of /bin.
> 
> Pwd works in both the two cases:
> $ cd /bin
> $ pwd
> /bin
> 
> $ cd /usr/bin
> $ pwd
> /usr/bin
> 
> Most of the compilers/programs expect to find themself in /usr/bin,
> and some are referring their libraries relative to such position
> in this way
> ../libexec/gcc/powerpc-unknown-linux-gnu/4.4.7/
> is correctly targeting
> /usr/bin/../libexec/gcc/powerpc-unknown-linux-gnu/4.4.7/
> 
> for this reason you should have in the PATH "/usr/bin" before "/bin"
> ( /bin not defined at all)
> to avoid that these programs looks for
> 
> /bin/../libexec/gcc/powerpc-unknown-linux-gnu/4.4.7/
> 
> that does not exist.
> 
> What is your PATH ?
> 
> On /etc/profile it is defined as:
> PATH="/usr/local/bin:/usr/bin:${PATH}"
> 
> Regards
> Marco
> 
> 


Hello Marco.
  You didn't understood me fully. In bash shell all works as expected but
calling programs directly from windows command line don't. I wont to have gcc
compiler with cygwin-1.dll only which can be run directly from windows command
line or GNU make or Eclipse without need to have installed whole cygwin or need
to run from bash.
  Here https://docs.google.com/file/d/0B3P4bLGf7ME1OFZhY0pVd3V6YVk/edit?pli=1
are ls,pwd and minimal set of dll's. Try to run testcmd.cmd from bin which will
have wrong result:
C:\tmp\Cyg\foo\bar\bin>pwd
/usr/bin

C:\tmp\Cyg\foo\bar\bin>ls.exe -al ..
ls: cannot access ..: No such file or directory

C:\tmp\Cyg\foo\bar\bin>ls.exe -al ../libexec
ls: cannot access ../libexec: No such file or directory

C:\tmp\Cyg\foo\bar\bin>

Then rename bin to bix and run testcmd.cmd again which will have correct result:
C:\tmp\Cyg\foo\bar\bix>pwd
/bix

C:\tmp\Cyg\foo\bar\bix>ls.exe -al ..
total 0
drwxrwxrwt+ 1 j-e mkpasswd 0 Sep 22 23:00 .
drwxrwxrwt+ 1 j-e mkpasswd 0 Sep 22 23:00 ..
drwxrwxrwt+ 1 j-e mkpasswd 0 Sep 22 22:43 bix
dr-xr-xr-x  1 j-e mkpasswd 0 Sep 22 23:00 cygdrive
dr-xr-xr-x  1 j-e mkpasswd 0 Sep 22 23:00 dev
drwxrwxrwt+ 1 j-e mkpasswd 0 Sep 22 22:41 libexec
dr-xr-xr-x  7 j-e mkpasswd 0 Sep 22 23:00 proc

C:\tmp\Cyg\foo\bar\bix>ls.exe -al ../libexec
total 1
drwxrwxrwt+ 1 j-e mkpasswd  0 Sep 22 22:41 .
drwxrwxrwt+ 1 j-e mkpasswd  0 Sep 22 23:00 ..
-rwxrwxrwx  1 j-e mkpasswd 21 Sep 22 22:41 file_in_libexec.txt

C:\tmp\Cyg\foo\bar\bix>

Regards
 Jiri Engelthaler


--
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]