public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Coreutils' Build Fails After Linking rm.exe
@ 2011-02-15  7:58 L Anderson
  2011-02-15 15:19 ` Eric Blake
  2011-02-15 15:26 ` Coreutils' Build Fails After Linking rm.exe--Solved L Anderson
  0 siblings, 2 replies; 5+ messages in thread
From: L Anderson @ 2011-02-15  7:58 UTC (permalink / raw)
  To: cygwin

I'm trying to build coreutils and I've run into a problem that has me
puzzled. I'd greatly appreciate any ideas or pointers on what might be
causing the problem and steps I could take to figure it out.  The
problem is repeatable, stopping at the exact same place.

I'm running 'XpProSp3', 'cygcheck -c' shows all OK.

1st--I used setup to install 'coreutils-8.10-1' source and placed the
files in '/usr/src/coreutils-8.10-1'

2nd--From that directory, I did 'cygport coreutils-8.10-1 prep', which
completed successfully.

3rd--I ran 'cygport coreutils-8.10-1 compile', which appeared to work
ok until it exited with a "make error" as shown by the following last
few lines of the output:

   ...
   CCLD   pwd.exe
   CCLD   readlink.exe
   CCLD   rm.exe
   CCLD   rmdir.exe <<<---up to and including rmdir.exe have been linked
./rm: ./rm: cannot execute binary file
make[3]: *** [runcon.exe] Error 126 <<<--runcon.exe and on, not linked
make[3]: *** Waiting for unfinished jobs....
./rm: ./rm: cannot execute binary file
make[3]: *** [seq.exe] Error 126
make[3]: Leaving directory 
`/usr/src/coreutils-8.10-1/coreutils-8.10-1/build/src
'
make[2]: *** [all] Error 2
make[2]: Leaving directory 
`/usr/src/coreutils-8.10-1/coreutils-8.10-1/build/src
'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory 
`/usr/src/coreutils-8.10-1/coreutils-8.10-1/build'
make: *** [all] Error 2
*** ERROR: make failed

The above is output from 'make', chewing on the following 'makefile' lines:

...
pwd$(EXEEXT): $(pwd_OBJECTS) $(pwd_DEPENDENCIES)
	@rm -f pwd$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(pwd_OBJECTS) $(pwd_LDADD) $(LIBS)
readlink$(EXEEXT): $(readlink_OBJECTS) $(readlink_DEPENDENCIES)
	@rm -f readlink$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(readlink_OBJECTS) $(readlink_LDADD) $(LIBS)
rm$(EXEEXT): $(rm_OBJECTS) $(rm_DEPENDENCIES)
	@rm -f rm$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(rm_OBJECTS) $(rm_LDADD) $(LIBS)
rmdir$(EXEEXT): $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES)
	@rm -f rmdir$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS)
runcon$(EXEEXT): $(runcon_OBJECTS) $(runcon_DEPENDENCIES)
	@rm -f runcon$(EXEEXT) <<<-----error occurs at this point<<--
	$(AM_V_CCLD)$(LINK) $(runcon_OBJECTS) $(runcon_LDADD) $(LIBS)
seq$(EXEEXT): $(seq_OBJECTS) $(seq_DEPENDENCIES)
	@rm -f seq$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(seq_OBJECTS) $(seq_LDADD) $(LIBS)
...	

The problem is related to 'rm.exe' being created in '..../build/src'.
Up until that point, the 'rm.exe' in the recipe lines is executed out
of '/bin'. So what causes 'make' to hiccup, when another 'rm.exe' is
created in the build directory? Is this a problem related to timing,
path, permissions, configuration, or?

Any insight in to what might be causing this would be greatly appreciated.

Thanks,

Lowell Anderson


--
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] 5+ messages in thread

* Re: Coreutils' Build Fails After Linking rm.exe
  2011-02-15  7:58 Coreutils' Build Fails After Linking rm.exe L Anderson
@ 2011-02-15 15:19 ` Eric Blake
  2011-02-15 15:33   ` L Anderson
  2011-02-15 19:52   ` Karl M
  2011-02-15 15:26 ` Coreutils' Build Fails After Linking rm.exe--Solved L Anderson
  1 sibling, 2 replies; 5+ messages in thread
From: Eric Blake @ 2011-02-15 15:19 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 831 bytes --]

On 02/15/2011 12:58 AM, L Anderson wrote:
> 3rd--I ran 'cygport coreutils-8.10-1 compile', which appeared to work
> ok until it exited with a "make error" as shown by the following last
> few lines of the output:

All those steps match what I do when building coreutils.

>   CCLD   pwd.exe
>   CCLD   readlink.exe
>   CCLD   rm.exe
>   CCLD   rmdir.exe <<<---up to and including rmdir.exe have been linked
> ./rm: ./rm: cannot execute binary file

Hmm.  Does your $PATH include '.' somewhere near the beginning?  That
may be the culprit; I _never_ run with '.' at the beginning (too much
risk of a trojan horse executable taking over); running with '.' at the
end or not in PATH at all would be safer.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Coreutils' Build Fails After Linking rm.exe--Solved
  2011-02-15  7:58 Coreutils' Build Fails After Linking rm.exe L Anderson
  2011-02-15 15:19 ` Eric Blake
@ 2011-02-15 15:26 ` L Anderson
  1 sibling, 0 replies; 5+ messages in thread
From: L Anderson @ 2011-02-15 15:26 UTC (permalink / raw)
  To: cygwin

L Anderson wrote:
> I'm trying to build coreutils and I've run into a problem that has me
> puzzled. I'd greatly appreciate any ideas or pointers on what might be
> causing the problem and steps I could take to figure it out. The
> problem is repeatable, stopping at the exact same place.
>
> I'm running 'XpProSp3', 'cygcheck -c' shows all OK.
>
> 1st--I used setup to install 'coreutils-8.10-1' source and placed the
> files in '/usr/src/coreutils-8.10-1'
>
> 2nd--From that directory, I did 'cygport coreutils-8.10-1 prep', which
> completed successfully.
>
> 3rd--I ran 'cygport coreutils-8.10-1 compile', which appeared to work
> ok until it exited with a "make error" as shown by the following last
> few lines of the output:
>
> ...
> CCLD pwd.exe
> CCLD readlink.exe
> CCLD rm.exe
> CCLD rmdir.exe <<<---up to and including rmdir.exe have been linked
> ./rm: ./rm: cannot execute binary file
> make[3]: *** [runcon.exe] Error 126 <<<--runcon.exe and on, not linked
> make[3]: *** Waiting for unfinished jobs....
> ./rm: ./rm: cannot execute binary file
> make[3]: *** [seq.exe] Error 126
> make[3]: Leaving directory
> `/usr/src/coreutils-8.10-1/coreutils-8.10-1/build/src
> '
> make[2]: *** [all] Error 2
> make[2]: Leaving directory
> `/usr/src/coreutils-8.10-1/coreutils-8.10-1/build/src
> '
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory
> `/usr/src/coreutils-8.10-1/coreutils-8.10-1/build'
> make: *** [all] Error 2
> *** ERROR: make failed
>
> The above is output from 'make', chewing on the following 'makefile' lines:
>
> ...
> pwd$(EXEEXT): $(pwd_OBJECTS) $(pwd_DEPENDENCIES)
> @rm -f pwd$(EXEEXT)
> $(AM_V_CCLD)$(LINK) $(pwd_OBJECTS) $(pwd_LDADD) $(LIBS)
> readlink$(EXEEXT): $(readlink_OBJECTS) $(readlink_DEPENDENCIES)
> @rm -f readlink$(EXEEXT)
> $(AM_V_CCLD)$(LINK) $(readlink_OBJECTS) $(readlink_LDADD) $(LIBS)
> rm$(EXEEXT): $(rm_OBJECTS) $(rm_DEPENDENCIES)
> @rm -f rm$(EXEEXT)
> $(AM_V_CCLD)$(LINK) $(rm_OBJECTS) $(rm_LDADD) $(LIBS)
> rmdir$(EXEEXT): $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES)
> @rm -f rmdir$(EXEEXT)
> $(AM_V_CCLD)$(LINK) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS)
> runcon$(EXEEXT): $(runcon_OBJECTS) $(runcon_DEPENDENCIES)
> @rm -f runcon$(EXEEXT) <<<-----error occurs at this point<<--
> $(AM_V_CCLD)$(LINK) $(runcon_OBJECTS) $(runcon_LDADD) $(LIBS)
> seq$(EXEEXT): $(seq_OBJECTS) $(seq_DEPENDENCIES)
> @rm -f seq$(EXEEXT)
> $(AM_V_CCLD)$(LINK) $(seq_OBJECTS) $(seq_LDADD) $(LIBS)
> ...
>

I think I figured it out!  I had `.' in my path and it came before
`/bin'. Consequently, while 'rm.exe' was being linked in the build
directory(`.'), bash, searching it first while trying to execute
@rm -f runcon$(EXEEXT), found 'rm.exe' but it was busy being built.
Hence, the slight variation in the error messages I got at that
point.  Removing `.' from the search path, where it shouldn't
have been in the first place, solved the problem.

I have now successfully build coreutils!

Sorry for all the noise.

Regards,

Lowell Anderson


--
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] 5+ messages in thread

* Re: Coreutils' Build Fails After Linking rm.exe
  2011-02-15 15:19 ` Eric Blake
@ 2011-02-15 15:33   ` L Anderson
  2011-02-15 19:52   ` Karl M
  1 sibling, 0 replies; 5+ messages in thread
From: L Anderson @ 2011-02-15 15:33 UTC (permalink / raw)
  To: cygwin

Eric Blake wrote:
> On 02/15/2011 12:58 AM, L Anderson wrote:
>> 3rd--I ran 'cygport coreutils-8.10-1 compile', which appeared to work
>> ok until it exited with a "make error" as shown by the following last
>> few lines of the output:
>
> All those steps match what I do when building coreutils.
>
>>    CCLD   pwd.exe
>>    CCLD   readlink.exe
>>    CCLD   rm.exe
>>    CCLD   rmdir.exe<<<---up to and including rmdir.exe have been linked
>> ./rm: ./rm: cannot execute binary file
>
> Hmm.  Does your $PATH include '.' somewhere near the beginning?  That
> may be the culprit; I _never_ run with '.' at the beginning (too much
> risk of a trojan horse executable taking over); running with '.' at the
> end or not in PATH at all would be safer.

Yes, I'm afraid so :-(.  I finally figured it out about an hour ago. 
Thanks for your confirming reply! I have fixed it and have now 
successfully build coreutils--yea!

Regards,

LA


--
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] 5+ messages in thread

* RE: Coreutils' Build Fails After Linking rm.exe
  2011-02-15 15:19 ` Eric Blake
  2011-02-15 15:33   ` L Anderson
@ 2011-02-15 19:52   ` Karl M
  1 sibling, 0 replies; 5+ messages in thread
From: Karl M @ 2011-02-15 19:52 UTC (permalink / raw)
  To: cygwin


> Date: Tue, 15 Feb 2011 08:19:20 -0700
> From: eblake
> Subject: Re: Coreutils' Build Fails After Linking rm.exe
>
> Hmm. Does your $PATH include '.' somewhere near the beginning? That
> may be the culprit; I _never_ run with '.' at the beginning (too much
> risk of a trojan horse executable taking over); running with '.' at the
> end or not in PATH at all would be safer.
>
Just for the archive, a dot in $PATH can be caused by a double ; in the windows
path. A ";;" in the windows path creates a null entry that gets interpreted
as a ".". 		 	   		  

--
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] 5+ messages in thread

end of thread, other threads:[~2011-02-15 19:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-15  7:58 Coreutils' Build Fails After Linking rm.exe L Anderson
2011-02-15 15:19 ` Eric Blake
2011-02-15 15:33   ` L Anderson
2011-02-15 19:52   ` Karl M
2011-02-15 15:26 ` Coreutils' Build Fails After Linking rm.exe--Solved L Anderson

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