Bug 18508 - [3.4/4.0 Regression] "basename: too few arguments" when building without bootstrap
Summary: [3.4/4.0 Regression] "basename: too few arguments" when building without boot...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 3.4.4
Assignee: H.J. Lu
URL:
Keywords: build, patch
Depends on:
Blocks:
 
Reported: 2004-11-15 23:35 UTC by Andreas Schwab
Modified: 2005-05-14 16:30 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc-*-linux
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-11-17 05:44:35


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schwab 2004-11-15 23:35:58 UTC
When building the compiler without bootstrapping, ie. with make all-gcc, the 
file libgcc_s_nof.so.1 is always rebuilt and a bogus libgcc_s_nof.so.1. (with 
a trailing dot) is created.  During this rebuild basename is called without  
argument because $(STAGE_PREFIX) is empty.
Comment 1 H.J. Lu 2004-11-16 16:50:49 UTC
What is the real problem? Is my patch causes libgcc_s_nof.so.1 to be rebuilt or
my patch doesn't work with bogus libgcc_s_nof.so.1 rebuild?
Comment 2 Andreas Schwab 2004-11-16 20:22:32 UTC
Sorry for being imprecise.  The fact that libgcc_s_nof.so.1 is always rebuilt 
is an older bug not caused by your patch.  The new problem is that basename is 
called without arguments due to $(STAGE_PREFIX) being empty. 
Comment 3 H.J. Lu 2004-11-16 20:57:29 UTC
How hard to fix the older bug?
Comment 4 Andreas Schwab 2004-11-16 21:45:09 UTC
I haven't yet found out why, and it's completely independent of this bug 
anyway.  There can always be legitimate reasons to rebuild libgcc_s_nof.so.1 
in repeated executions of make all-gcc if you modify some sources inbetween. 
Comment 5 H.J. Lu 2004-11-17 05:44:35 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01352.html
Comment 6 H.J. Lu 2004-12-15 19:31:19 UTC
Hi Mark, can you take a look at the patch? Thanks.
Comment 7 Mark Mitchell 2004-12-15 19:49:46 UTC
This patch is OK.
Comment 8 GCC Commits 2004-12-16 19:14:41 UTC
Subject: Bug 18508

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	hjl@gcc.gnu.org	2004-12-16 19:14:29

Modified files:
	gcc            : ChangeLog 
	gcc/config     : t-libunwind-elf t-slibgcc-darwin 
	                 t-slibgcc-elf-ver t-slibgcc-sld 
	gcc/config/alpha: t-osf4 
	gcc/config/arm : t-netbsd 
	gcc/config/i386: t-nwld 
	gcc/config/mips: t-slibgcc-irix 
	gcc/config/pa  : t-hpux-shlib 
	gcc/config/sh  : t-linux 

Log message:
	2004-12-14  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR other/18508
	* config/alpha/t-osf4 (SHLIB_LINK): Use `.backup' as the suffix
	to back up the existing shared library.
	* config/arm/t-netbsd (SHLIB_LINK): Likewise.
	* config/mips/t-slibgcc-irix (SHLIB_LINK): Likewise.
	* config/pa/t-hpux-shlib (SHLIB_LINK): Likewise.
	* config/sh/t-linux (SHLIB_LINK): Likewise.
	* config/t-libunwind-elf (SHLIBUNWIND_LINK): Likewise.
	* config/t-slibgcc-darwin (SHLIB_LINK): Likewise.
	* config/t-slibgcc-elf-ver (SHLIB_LINK): Likewise.
	* config/t-slibgcc-sld (SHLIB_LINK): Likewise.
	
	* config/i386/t-nwld (SHLIB_LINK): Don't use the temporary
	file.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6857&r2=2.6858
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/t-libunwind-elf.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/t-slibgcc-darwin.diff?cvsroot=gcc&r1=1.7&r2=1.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/t-slibgcc-elf-ver.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/t-slibgcc-sld.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/alpha/t-osf4.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/t-netbsd.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/t-nwld.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/mips/t-slibgcc-irix.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/pa/t-hpux-shlib.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sh/t-linux.diff?cvsroot=gcc&r1=1.15&r2=1.16

Comment 9 GCC Commits 2004-12-16 19:16:31 UTC
Subject: Bug 18508

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	hjl@gcc.gnu.org	2004-12-16 19:16:23

Modified files:
	gcc            : ChangeLog 
	gcc/config     : t-libunwind-elf t-slibgcc-darwin 
	                 t-slibgcc-elf-ver t-slibgcc-sld 
	gcc/config/alpha: t-osf4 
	gcc/config/arm : t-netbsd 
	gcc/config/mips: t-iris5-6 
	gcc/config/pa  : t-hpux-shlib 
	gcc/config/sh  : t-linux 

Log message:
	2004-12-16  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR other/18508
	* config/alpha/t-osf4 (SHLIB_LINK): Use `.backup' as the suffix
	to back up the existing shared library.
	* config/arm/t-netbsd (SHLIB_LINK): Likewise.
	* config/mips/t-iris5-6 (SHLIB_LINK): Likewise.
	* config/pa/t-hpux-shlib (SHLIB_LINK): Likewise.
	* config/sh/t-linux (SHLIB_LINK): Likewise.
	* config/t-libunwind-elf (SHLIBUNWIND_LINK): Likewise.
	* config/t-slibgcc-darwin (SHLIB_LINK): Likewise.
	* config/t-slibgcc-elf-ver (SHLIB_LINK): Likewise.
	* config/t-slibgcc-sld (SHLIB_LINK): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.745&r2=2.2326.2.746
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/t-libunwind-elf.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1.4.2&r2=1.1.4.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/t-slibgcc-darwin.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2.10.1&r2=1.2.10.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/t-slibgcc-elf-ver.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.5.20.2&r2=1.5.20.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/t-slibgcc-sld.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.4.20.1&r2=1.4.20.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/alpha/t-osf4.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.7.10.1&r2=1.7.10.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/t-netbsd.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.7.10.1&r2=1.7.10.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/mips/t-iris5-6.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3.20.1&r2=1.3.20.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/pa/t-hpux-shlib.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2.20.1&r2=1.2.20.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sh/t-linux.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.9.10.3&r2=1.9.10.4

Comment 10 H.J. Lu 2004-12-16 19:17:48 UTC
Fixed.
Comment 11 dank 2005-05-14 16:30:26 UTC
On Cygwin, the symptoms may be slightly different.
Here's a snippet of a build log from Petr Cvachoucek:

basename: missing operand
Try `basename --help' for more information.
mv: `libgcc_s_nof.so.1' and `libgcc_s_nof.so.1.' are the same file
make[2]: *** [nof/libgcc_s_nof.so] Error 1

(Yep, Cygwin considers foo and foo. to be the same file.)
I only mention this for completeness.