When there is an exported shell-function 'dir()' and /bin/sh is bashish, the make aborts very ugly (see below). The problem is a quoting bug in gcc/mklibgcc.in, where the dir-variable gets expanded by make, but make does not have the dir-variable set anywhere and so puts in the shell-function. Here's the failure text: ( ` if [ -f ./nm ] ; then echo ./nm ; elif [ -f /tools/haubi/toolsbox-4-patchespre.haubi/i686-pc-linux-gnu/var/tmp/portage/gcc-3.4.4/work/build/gcc/../binutils/nm-new ] ; then echo /tools/haubi/toolsbox-4-patchespre.haubi/i686-pc-linux-gnu/var/tmp/portage/gcc-3.4.4/work/build/gcc/../binutils/nm-new ; else if [ "i686-pc-linux-gnu" = "i686-pc-linux-gnu" ] ; then echo nm; else t='s,y,y,'; echo nm | sed -e ; fi; fi` -pg libgcc/./_muldi3.o | gawk 'NF == 3 && $2 !~ /^[UN]$/ { print "\t.hidden", $3 }'; cat libgcc/() { local x; /bin/sh: -c: line 0: syntax error near unexpected token `(' /bin/sh: -c: line 0: `( ` if [ -f ./nm ] ; then echo ./nm ; elif [ -f /tools/haubi/toolsbox-4-patchespre.haubi/i686-pc-linux-gnu/var/tmp/portage/gcc-3.4.4/work/build/gcc/../binutils/nm-new ] ; then echo /tools/haubi/toolsbox-4-patchespre.haubi/i686-pc-linux-gnu/var/tmp/portage/gcc-3.4.4/work/build/gcc/../binutils/nm-new ; else if [ "i686-pc-linux-gnu" = "i686-pc-linux-gnu" ] ; then echo nm; else t='s,y,y,'; echo nm | sed -e ; fi; fi` -pg libgcc/./_muldi3.o | gawk 'NF == 3 && $2 !~ /^[UN]$/ { print "\t.hidden", $3 }'; cat libgcc/() { local x;' make[3]: *** [libgcc/./_muldi3.oS] Error 2 make[2]: *** [libgcc.a] Error 2 make[1]: *** [stage1_build] Error 2 make: *** [profiledbootstrap] Error 2
Created attachment 9164 [details] patch to quote dir-variable in mklibgcc.in correctly I do not really expect this to go into a 3.4-release (this problem does not exist in gcc-4), but thought to have the bug filed to let other users find it.
Could you post your patch to gcc-patches@ with a changelog and saying it only for 3.4.x branch as it is already fixed for 4.0.0 and above.
Fixed in 4.0.0 and up.
Fixed.