For bootstrapping gcc 3.4.6 I have configured it the follwing way:

env CONFIG_SHELL=/bin/ksh /usr/local/tmp/gcc-3.4.6/configure
--prefix=/usr/local --with-ld=/usr/bin/ld --with-as=/usr/bin/as
--enable-languages=c

Building (using GNU make) then ends up like this:

if [ -f specs.ready ] ; then \
                true; \
        else \
                echo timestamp > specs.ready; \
        fi
(MAKE="/usr/local/pkg/bin/gmake"; srcdir=`cd
/usr/local/tmp/gcc-3.4.6/gcc/fixinc && ${PWDCMD-pwd}` ; \
        CC="cc"; CFLAGS="  -g -DIN_GCC     -DHAVE_CONFIG_H -DGENERATOR_FILE";
LDFLAGS=""; \
        WARN_CFLAGS=""; LIBERTY=`${PWDCMD-pwd}`/"../libiberty/libiberty.a"; \
        export MAKE srcdir CC CFLAGS LDFLAGS WARN_CFLAGS LIBERTY; \
        cd ./fixinc && \
        /bin/ksh ${srcdir}/mkfixinc.sh mips-sgi-irix5.3 mips-sgi-irix5.3)
constructing ../fixinc.sh for mips-sgi-irix5.3 to run on mips-sgi-irix5.3
/usr/local/pkg/bin/gmake TARGETS=oneprocess SHELL="/bin/tcsh" CC="cc" CFLAGS="
-g -DIN_GCC -DHAVE_CONFIG_H -DGENERATOR_FILE" LDFLAGS=""
LIBERTY="/usr/local/tmp/b/gcc/../libiberty/libiberty.a" install-bin
gmake[2]: Entering directory `/usr/local/tmp/b/gcc/fixinc'
/bin/tcsh /usr/local/tmp/gcc-3.4.6/gcc/fixinc/genfixes machname.h
SHELL=/bin/sh: Command not found.
export: Command not found.
if: Expression Syntax.
gmake[2]: *** [machname.h] Error 1
gmake[2]: Leaving directory `/usr/local/tmp/b/gcc/fixinc'
gmake[1]: *** [fixinc.sh] Error 2
gmake[1]: Leaving directory `/usr/local/tmp/b/gcc'
gmake: *** [all-gcc] Error 2


The reason is found in gcc-3.4.6/gcc/fixinc/mkfixinc.sh which has:

defs="SHELL=\"$SHELL\" CC=\"$CC\" CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\"
LIBERTY=\"$LIBERTY\""


SHELL in my case is the shell I started the build from, /bin/tcsh.
The script that gets called later on, gcc-3.4.6/gcc/fixinc/genfixes, assumes a
/bin/sh-compatible shell though.

To work around the issue one can call GNU make with the SHELL set to /bin/sh or
 /bin/ksh.
To fix this one might change "SHELL=\"$SHELL\" into "SHELL=\"$CONFIG_SHELL\" in
gcc-3.4.6/gcc/fixinc/genfixes, assuming CONFIG_SHELL must necessarily be a
/bin/sh-compatible shell.


-- 
           Summary: bootstrapping fails when building from non-/bin/sh-
                    compatible shell
           Product: gcc
           Version: 3.4.6
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: georg dot schwarz at freenet dot de
 GCC build triplet: mips-sgi-irix5.3
  GCC host triplet: mips-sgi-irix5.3
GCC target triplet: mips-sgi-irix5.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28864

Reply via email to