From 9beca004b9a6712343269a0d87fc3c3e905d7020 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 19 Jun 2024 08:42:19 -0400 Subject: 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 --- tools/configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/configure b/tools/configure index 2016dd4dfb..7e9a6e4222 100755 --- a/tools/configure +++ b/tools/configure @@ -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" -- cgit v1.2.3