This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bootstrap/7087: sub-make FLAG propagation fails if flag ends with '='
- From: sdouglass at arm dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 20 Jun 2002 14:19:54 -0000
- Subject: bootstrap/7087: sub-make FLAG propagation fails if flag ends with '='
- Reply-to: sdouglass at arm dot com
>Number: 7087
>Category: bootstrap
>Synopsis: sub-make FLAG propagation fails if flag ends with '='
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jun 20 07:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: sdouglass@arm.com
>Release: 3.1
>Organization:
>Environment:
all
>Description:
The top-level Makefile.in (and others?) propagates some flags to sub-make by saying, e.g.
"`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
This fails to propagate the value if I've done, e.g.
make STAGE1_CFLAGS="-O2 -Dinline=' bootstrap-lean
>How-To-Repeat:
make STAGE1_CFLAGS="-O2 -Dinline=' bootstrap-lean
>Fix:
The fix is to change the sed commands to
sed -e s'/[^=][^=]*=$$/XFOO=/'
I've also added single quotes to protect the '*' (and now '[]'s from being interpreted by the shell. Although it's pretty unlikely there would be a directory named 's/.[BAR=$/XFOO=' lying around, imagine the confusion that would ensue when using the unquoted form.
Try it for fun:
mkdir -p s'/.[BAR=$/'XFOO=
make bootstrap-lean
>Release-Note:
>Audit-Trail:
>Unformatted: