Bug 22213 - [3.4 only] quoting of dir-variable in mklibgcc.in
Summary: [3.4 only] quoting of dir-variable in mklibgcc.in
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 3.4.4
: P2 minor
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2005-06-28 08:48 UTC by Michael Haubenwallner
Modified: 2006-02-28 15:54 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-01-07 02:09:51


Attachments
patch to quote dir-variable in mklibgcc.in correctly (450 bytes, patch)
2005-06-28 08:54 UTC, Michael Haubenwallner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Haubenwallner 2005-06-28 08:48:59 UTC
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
Comment 1 Michael Haubenwallner 2005-06-28 08:54:39 UTC
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.
Comment 2 Andrew Pinski 2005-06-28 13:45:49 UTC
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.
Comment 3 Gabriel Dos Reis 2006-02-28 15:49:59 UTC
Fixed in 4.0.0 and up.
Comment 4 Andrew Pinski 2006-02-28 15:54:45 UTC
Fixed.