simulator: Hopefully fix red introduced in 5b61c79cf

This problem only happened with GCC7 (and older?) simulator builds, and
was introduced by an incorrect test that always stripped our default
optimization (-Os) in simulator builds.

The fix is to correct the test to only strip -Os if the user explicitly
enables a debug build.

Also, use -Og instead of (implicit) -O0, as per GCC recommendations.

Change-Id: I61091b3cdf5323504961c0bb2d80aa65049eb8fb
This commit is contained in:
Solomon Peachy 2024-06-19 08:42:19 -04:00
parent b3e6b12266
commit 9beca004b9

4
tools/configure vendored
View file

@ -262,8 +262,8 @@ simcc () {
winbuild=""
GCCOPTS=`echo $CCOPTS | sed -e s/\ -ffreestanding// -e s/\ -nostdlib// -e s/\ -Wundef//`
if [ "$debug" ]; then
GCCOPTS=`echo $GCCOPTS | sed -e s/\ -Os//`
if [ "yes" = "$use_debug" ]; then
GCCOPTS=`echo $GCCOPTS | sed -e s/\ -Os/-Og/`
fi
GCCOPTS="$GCCOPTS -fno-builtin -g"