This is the mail archive of the cygwin@sources.redhat.com 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]

Cygwin 1.1.4: gcc uses wrong search path for as


Hi
Here's the description of a bug I seem to have found. Thanks in advance
for any suggestions to resolve this problem.


Platform:
---------
   Cygwin 1.1.4 installed on an x86 PC running Windows NT 4.0 
   See cygcheck.out for more information.


Problem:
--------
I was trying to compile hello.c. The current directory contained a script
called "as". gcc used this script instead of the assembler.  

I tried the exact same thing on Cygwin b20 (with the rest of the platform
identical). It worked correctly (gcc did not use the as script in . )

How to reproduce the problem:
----------------------------
The attachment is a shell-archive. Save the attachment in a text file
called "bug.shar". In Cygwin, do
sh bug.shar

This will create a directory called "bug" with the files hello.c, a script
called "as", a README file and cygcheck.out. Here is what I did and the
output I got:

$cd bug
$echo $PATH
/usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINNT/system32:cygdrive/c/WINNT
$gcc hello.c

********************************************
*                                          *
* as script in local directory got called  *
*                                          *
********************************************
/cygdrive/c/TEMP/ccivebeD.o: file not recognized: File truncated
collect2: ld returned 1 exit status

#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2000-10-20 12:23 PDT by <horti@shortikar2>.
# Source directory was `/home/horti/tmp'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#    991 -rw-r--r-- bug/README
#    260 -rwxr-xr-x bug/as
#   4359 -rw-r--r-- bug/cygcheck.out
#     46 -rw-r--r-- bug/hello.c
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
  shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$2 "$8"'
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh19649; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= bug/README ==============
if test ! -d 'bug'; then
  $echo 'x -' 'creating directory' 'bug'
  mkdir 'bug'
fi
if test -f 'bug/README' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'bug/README' '(file already exists)'
else
  $echo 'x -' extracting 'bug/README' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'bug/README' &&
Platform:
---------
X   Cygwin 1.1.4 installed on an x86 PC running Windows NT 4.0 
X   See cygcheck.out for more information.
X
X
Problem:
--------
I was trying to compile hello.c. The current directory contained a script
called as gcc used this script instead of the assembler.  
X
How to reproduce the problem:
----------------------------
The attachment is a shell-archive. In Cygwin, do
sh bug.shar
X
This will create a directory called bug with the files hello.c, a script
called as, a REAME file and cygcheck.out. Here is what I did and the output
I got:
X
$cd bug
$echo $PATH
/usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINNT/system32:cygdrive/c/WINNT
$gcc hello.c
X
********************************************
*                                          *
* as script in local directory got called  *
*                                          *
********************************************
/cygdrive/c/TEMP/ccivebeD.o: file not recognized: File truncated
collect2: ld returned 1 exit status
X
SHAR_EOF
  (set 20 00 10 20 12 19 31 'bug/README'; eval "$shar_touch") &&
  chmod 0644 'bug/README' ||
  $echo 'restore of' 'bug/README' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'bug/README:' 'MD5 check failed'
045c25ecac8eb68bcccfb13c0fe4b9fb  bug/README
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'bug/README'`"
    test 991 -eq "$shar_count" ||
    $echo 'bug/README:' 'original size' '991,' 'current size' "$shar_count!"
  fi
fi
# ============= bug/as ==============
if test -f 'bug/as' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'bug/as' '(file already exists)'
else
  $echo 'x -' extracting 'bug/as' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'bug/as' &&
echo "********************************************"
echo "*                                          *"
echo "* as script in local directory got called  *"
echo "*                                          *"
echo "********************************************"
SHAR_EOF
  (set 20 00 10 20 12 15 24 'bug/as'; eval "$shar_touch") &&
  chmod 0755 'bug/as' ||
  $echo 'restore of' 'bug/as' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'bug/as:' 'MD5 check failed'
1c886c6ee0536b7cd3ad44c19a8b436a  bug/as
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'bug/as'`"
    test 260 -eq "$shar_count" ||
    $echo 'bug/as:' 'original size' '260,' 'current size' "$shar_count!"
  fi
fi
# ============= bug/cygcheck.out ==============
if test -f 'bug/cygcheck.out' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'bug/cygcheck.out' '(file already exists)'
else
  $echo 'x -' extracting 'bug/cygcheck.out' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'bug/cygcheck.out' &&
X
Cygnus Win95/NT Configuration Diagnostics
Current System Time: Fri Oct 20 11:57:28 2000
X
WinNT Ver 4.0 build 1381 Service Pack 5
X
Path:	/usr/local/bin
X	/usr/bin
X	/usr/bin
X	/cygdrive/c/WINNT/system32
X	/cygdrive/c/WINNT
X
SysDir: C:\WINNT\System32
WinDir: C:\WINNT
X
HOME = `/home/administrator'
MAKE_MODE = `unix'
PWD = `/home/administrator/win'
USER = `administrator'
X
!C: = `C:\cygwin\bin'
CLASSPATH = `C:\Program Files\Exceed.nt\hcljrcsv.jar;C:\Program Files\Exceed.nt\;'
COMPUTERNAME = `SHORTIKAR1'
COMSPEC = `C:\WINNT\system32\cmd.exe'
HOMEDRIVE = `C:'
HOMEPATH = `\'
HOSTNAME = `SHORTIKAR1'
HOSTTYPE = `i686'
LOGONSERVER = `\\SHORTIKAR1'
MACHTYPE = `i686-pc-cygwin'
NUMBER_OF_PROCESSORS = `1'
OLDPWD = `/home/administrator'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
OS = `Windows_NT'
OSTYPE = `cygwin'
PATHEXT = `.COM;.EXE;.BAT;.CMD'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 6 Stepping 5, GenuineIntel'
PROCESSOR_LEVEL = `6'
PROCESSOR_REVISION = `0605'
PROMPT = `$P$G'
PS1 = `\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$ '
SHELL = `/bin/sh'
SHLVL = `1'
SYSTEMDRIVE = `C:'
SYSTEMROOT = `C:\WINNT'
TEMP = `/cygdrive/c/TEMP'
TERM = `cygwin'
USERDOMAIN = `SHORTIKAR1'
USERNAME = `administrator'
USERPROFILE = `C:\WINNT\Profiles\Administrator'
WINDIR = `C:\WINNT'
_ = `/usr/bin/cygcheck'
TZ = `PST8PDT7,M4.1.0/2,M10.5.0/2'
X
HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
X  (default) = `/cygdrive'
X  cygdrive flags = 0x00000020
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/usr/lynx
X  (default) = `z:'
X  flags = 0x00000012
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
X  (default) = `C:/cygwin'
X  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
X  (default) = `C:/cygwin/bin'
X  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
X  (default) = `C:/cygwin/lib'
X  flags = 0x0000000a
X
a:  fd           N/A    N/A                    
c:  hd  NTFS    4000Mb  25% CP CS UN PA FC     
d:  cd           N/A    N/A                    
z:  net Samba    563Mb  87% CP    UN           lynx
X
C:\cygwin\bin  /usr/bin  system  binmode
C:\cygwin\lib  /usr/lib  system  binmode
C:\cygwin  /        system  binmode
z:    /usr/lynx  user    binmode,exec
X
Found: C:\cygwin\bin\bash.exe
Found: C:\cygwin\bin\cat.exe
Found: C:\cygwin\bin\cpp.exe
Found: C:\cygwin\bin\find.exe
Found: C:\cygwin\bin\gcc.exe
Found: C:\cygwin\bin\gdb.exe
Found: C:\cygwin\bin\ld.exe
Found: C:\cygwin\bin\ls.exe
Found: C:\cygwin\bin\make.exe
Found: C:\cygwin\bin\sh.exe
X
X   83k 2000/06/11 C:\cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
X                  "cygitcl30.dll" v0.0 ts=2000/6/10 20:34
X   35k 2000/06/11 C:\cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
X                  "cygitk30.dll" v0.0 ts=2000/6/10 20:34
X  402k 2000/06/11 C:\cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
X                  "cygtcl80.dll" v0.0 ts=2000/6/10 20:30
X    5k 2000/06/11 C:\cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
X   10k 2000/06/11 C:\cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
X                  "cygtclreg80.dll" v0.0 ts=2000/6/10 20:30
X  639k 2000/06/11 C:\cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
X                  "cygtk80.dll" v0.0 ts=2000/6/10 20:34
X  586k 2000/08/04 C:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
X                  "cygwin1.dll" v0.0 ts=2000/8/3 17:53
X    Cygwin DLL version info:
X        dll major: 1001
X        dll minor: 4
X        dll epoch: 19
X        dll bad signal mask: 19005
X        dll old termios: 5
X        api major: 0
X        api minor: 26
X        shared data: 3
X        dll identifier: cygwin1
X        mount registry: 2
X        cygnus registry name: Cygnus Solutions
X        cygwin registry name: Cygwin
X        program options name: Program Options
X        cygwin mount registry name: mounts v2
X        build date: Thu Aug 3 20:53:46 EDT 2000
X        CVS tag: cygwin-1-1-4
X        shared id: cygwin1S3
X
Use -h to see help about each section
SHAR_EOF
  (set 20 00 10 20 12 15 25 'bug/cygcheck.out'; eval "$shar_touch") &&
  chmod 0644 'bug/cygcheck.out' ||
  $echo 'restore of' 'bug/cygcheck.out' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'bug/cygcheck.out:' 'MD5 check failed'
57a027504b6ab1d6649d1c47cbe1c2b9  bug/cygcheck.out
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'bug/cygcheck.out'`"
    test 4359 -eq "$shar_count" ||
    $echo 'bug/cygcheck.out:' 'original size' '4359,' 'current size' "$shar_count!"
  fi
fi
# ============= bug/hello.c ==============
if test -f 'bug/hello.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'bug/hello.c' '(file already exists)'
else
  $echo 'x -' extracting 'bug/hello.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'bug/hello.c' &&
int main()
{
X printf("hello\n");
X return 0;
}
SHAR_EOF
  (set 20 00 10 20 12 15 26 'bug/hello.c'; eval "$shar_touch") &&
  chmod 0644 'bug/hello.c' ||
  $echo 'restore of' 'bug/hello.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'bug/hello.c:' 'MD5 check failed'
794d9ed0f0da05f1ab92a4f20a4d7ce3  bug/hello.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'bug/hello.c'`"
    test 46 -eq "$shar_count" ||
    $echo 'bug/hello.c:' 'original size' '46,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh19649
exit 0
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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