Skip to content

Commit

Permalink
optimize.lunar: Ensure that flags are in the correct format
Browse files Browse the repository at this point in the history
The daily builds everything with -Os for stage2, but -Os is a bad flag
for glibc, and -Os is either first or last in the CFLAGS, which makes
it so that bad_flags doesn't see it and doesn't remove it.

Therefore, put spaces before and after the contents of the various flags
variables so that bad_flags operates on them the right way.
  • Loading branch information
dagbrown committed Feb 25, 2020
1 parent 5faa823 commit e255e95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libs/optimize.lunar
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ bad_flags()
unset LDFLAGS
else
for BAD_FLAG in "$@" ; do
# XXX should probably figure whether these variables are
# guaranteed to start and end with spaces or not
CFLAGS=" $CFLAGS "
CFLAGS="${CFLAGS// $BAD_FLAG / }"
CXXFLAGS=" $CXXFLAGS "
CXXFLAGS="${CXXFLAGS// $BAD_FLAG / }"
CPPFLAGS=" $CPPFLAGS "
CPPFLAGS="${CPPFLAGS// $BAD_FLAG / }"
LDFLAGS=" $LDFLAGS "
LDFLAGS="${LDFLAGS// $BAD_FLAG / }"
done
fi
Expand Down

0 comments on commit e255e95

Please sign in to comment.