This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bootstrap/7087: sub-make FLAG propagation fails if flag ends with '='


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]