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.
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?
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.
How hard to fix the older bug?
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.
A patch is posted at http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01352.html
Hi Mark, can you take a look at the patch? Thanks.
This patch is OK.
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
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
Fixed.
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.