From be8f8b41ff468427b3bf3f074a48480585745fee Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Mon, 10 Jun 2024 17:00:45 +0200 Subject: [PATCH] centralize -g flag for gnu targets --- configure/CONFIG.gnuCommon | 8 ++++++-- configure/os/CONFIG.Common.iosCommon | 6 ------ configure/os/CONFIG.darwinCommon.darwinCommon | 6 ------ configure/os/CONFIG_SITE.cygwin-x86.cygwin-x86 | 8 -------- configure/os/CONFIG_SITE.linux-aarch64.linux-aarch64 | 7 ------- configure/os/CONFIG_SITE.linux-x86.linux-x86 | 7 ------- configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 | 7 ------- 7 files changed, 6 insertions(+), 43 deletions(-) diff --git a/configure/CONFIG.gnuCommon b/configure/CONFIG.gnuCommon index f721b065e..a6305990b 100644 --- a/configure/CONFIG.gnuCommon +++ b/configure/CONFIG.gnuCommon @@ -27,13 +27,17 @@ RANLIB = $(GNU_BIN)/$(CMPLR_PREFIX)ranlib$(CMPLR_SUFFIX) ASAN_FLAGS_YES = -fsanitize=address ASAN_LDFLAGS_YES = $(ASAN_FLAGS_YES) +# It makes sense to include debugging symbols even in optimized builds +# in case you want to attach gdb to the process or examine a core-dump. +# This does cost disk space, but not memory as debug symbols are not +# loaded into RAM when the binary is loaded. PROF_CFLAGS_YES = -p GPROF_CFLAGS_YES = -pg CODE_CFLAGS = $(PROF_CFLAGS_$(PROFILE)) $(GPROF_CFLAGS_$(GPROF)) CODE_CFLAGS += $(ASAN_FLAGS_$(ENABLE_ASAN)) WARN_CFLAGS_YES = -Wall -Werror-implicit-function-declaration WARN_CFLAGS_NO = -w -OPT_CFLAGS_YES = -O3 +OPT_CFLAGS_YES = -O3 -g OPT_CFLAGS_NO = -g PROF_CXXFLAGS_YES = -p @@ -42,7 +46,7 @@ CODE_CXXFLAGS = $(PROF_CXXFLAGS_$(PROFILE)) $(GPROF_CXXFLAGS_$(GPROF)) CODE_CXXFLAGS += $(ASAN_FLAGS_$(ENABLE_ASAN)) WARN_CXXFLAGS_YES = -Wall WARN_CXXFLAGS_NO = -w -OPT_CXXFLAGS_YES = -O3 +OPT_CXXFLAGS_YES = -O3 -g OPT_CXXFLAGS_NO = -g CODE_LDFLAGS = $(PROF_CXXFLAGS_$(PROFILE)) $(GPROF_CXXFLAGS_$(GPROF)) diff --git a/configure/os/CONFIG.Common.iosCommon b/configure/os/CONFIG.Common.iosCommon index 5c248f38a..03d3cab8e 100644 --- a/configure/os/CONFIG.Common.iosCommon +++ b/configure/os/CONFIG.Common.iosCommon @@ -42,12 +42,6 @@ ARCH_DEP_LDFLAGS += $(ARCH_DEP_FLAGS) OP_SYS_CFLAGS += -isysroot $(SDK_DIR) OP_SYS_LDFLAGS += -isysroot $(SDK_DIR) -#-------------------------------------------------- -# Always compile in debugging symbol table information -# -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - #------------------------------------------------------- # Compiler definitions: diff --git a/configure/os/CONFIG.darwinCommon.darwinCommon b/configure/os/CONFIG.darwinCommon.darwinCommon index c0a69f46c..2c12b2fbb 100644 --- a/configure/os/CONFIG.darwinCommon.darwinCommon +++ b/configure/os/CONFIG.darwinCommon.darwinCommon @@ -39,12 +39,6 @@ OP_SYS_CFLAGS += -fno-common # OP_SYS_CPPFLAGS += -Ddarwin -# -# Always compile in debugging symbol table information -# -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - # # Libraries for command-line editing. # diff --git a/configure/os/CONFIG_SITE.cygwin-x86.cygwin-x86 b/configure/os/CONFIG_SITE.cygwin-x86.cygwin-x86 index 46a1eccea..3125c7a64 100644 --- a/configure/os/CONFIG_SITE.cygwin-x86.cygwin-x86 +++ b/configure/os/CONFIG_SITE.cygwin-x86.cygwin-x86 @@ -6,11 +6,3 @@ # GNU_DIR used when COMMANDLINE_LIBRARY is READLINE #GNU_DIR=C:/cygwin - -# It makes sense to include debugging symbols even in optimized builds -# in case you want to attach gdb to the process or examine a core-dump. -# This does cost disk space, but not memory as debug symbols are not -# loaded into RAM when the binary is loaded. -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - diff --git a/configure/os/CONFIG_SITE.linux-aarch64.linux-aarch64 b/configure/os/CONFIG_SITE.linux-aarch64.linux-aarch64 index e196135b7..f569951f1 100644 --- a/configure/os/CONFIG_SITE.linux-aarch64.linux-aarch64 +++ b/configure/os/CONFIG_SITE.linux-aarch64.linux-aarch64 @@ -3,10 +3,3 @@ # Site specific definitions for native linux-aarch64 builds #------------------------------------------------------- -# It makes sense to include debugging symbols even in optimized builds -# in case you want to attach gdb to the process or examine a core-dump. -# This does cost disk space, but not memory as debug symbols are not -# loaded into RAM when the binary is loaded. -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - diff --git a/configure/os/CONFIG_SITE.linux-x86.linux-x86 b/configure/os/CONFIG_SITE.linux-x86.linux-x86 index 5b2fa7c65..64810a835 100644 --- a/configure/os/CONFIG_SITE.linux-x86.linux-x86 +++ b/configure/os/CONFIG_SITE.linux-x86.linux-x86 @@ -3,13 +3,6 @@ # Site specific definitions for linux-x86 host - linux-x86 target builds #------------------------------------------------------- -# It makes sense to include debugging symbols even in optimized builds -# in case you want to attach gdb to the process or examine a core-dump. -# This does cost disk space, but not memory as debug symbols are not -# loaded into RAM when the binary is loaded. -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - # Uncomment the followings lines to build with CLANG instead of GCC. # #GNU = NO diff --git a/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 b/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 index 9178afd43..2f538151a 100644 --- a/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 +++ b/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 @@ -3,13 +3,6 @@ # Site specific definitions for linux-x86_64 host - linux-x86_64 target builds #------------------------------------------------------- -# It makes sense to include debugging symbols even in optimized builds -# in case you want to attach gdb to the process or examine a core-dump. -# This does cost disk space, but not memory as debug symbols are not -# loaded into RAM when the binary is loaded. -OPT_CFLAGS_YES += -g -OPT_CXXFLAGS_YES += -g - # Uncomment the followings lines to build with CLANG instead of GCC. # #GNU = NO