[PATCH 2/2] Makefile: Remove -g from default CFLAGS
Kele Zhang
1952088712 at qq.com
Sat Aug 24 01:19:32 PDT 2024
Remove `-g` from default CFLAGS as it should not be used in production
builds. Adjust optimization level to `-Og` when DEBUG is enabled.
Signed-off-by: Kele Zhang <1952088712 at qq.com>
Signed-off-by: Yuan Tan <tanyuan at tinylab.org>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 9abea9f..bcec588 100644
--- a/Makefile
+++ b/Makefile
@@ -346,9 +346,9 @@ GENFLAGS += $(libsbiutils-genflags-y)
GENFLAGS += $(platform-genflags-y)
GENFLAGS += $(firmware-genflags-y)
-CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-stack-protector -fno-strict-aliasing -ffunction-sections -fdata-sections -Wl,--gc-sections
+CFLAGS = -Wall -Werror -ffreestanding -nostdlib -fno-stack-protector -fno-strict-aliasing -ffunction-sections -fdata-sections -Wl,--gc-sections
ifneq ($(DEBUG),)
-CFLAGS += -O0 -Wl,--print-gc-sections
+CFLAGS += -Og -Wl,--print-gc-sections
else
CFLAGS += -O2
endif
--
2.34.1
More information about the opensbi
mailing list