From 04d12f52f81c4929b37f26e4e24edbbaf636a5ea Mon Sep 17 00:00:00 2001 From: Patrice Levesque Date: Thu, 2 Jun 2016 11:37:19 -0400 Subject: [PATCH] Add -O2 compilation by default and -g debug info Also store GCC command-line switches in the binaries for easier debugging. --- general.make | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/general.make b/general.make index dc22c26b9..3dd3c396d 100644 --- a/general.make +++ b/general.make @@ -1,3 +1,6 @@ +# Use GCC level 2 optimization by default +# Might be overridden below +ADDITIONAL_OBJCFLAGS=-O2 ifeq ($(test-uninitialized),yes) ifeq ($(debug),yes) ADDITIONAL_OBJCFLAGS=-O0 @@ -5,3 +8,9 @@ else ADDITIONAL_OBJCFLAGS=-Wuninitialized endif endif +# Ensure we store in the ELF files minimal debugging +# information plus the compiler flags used; that can +# be afterwards read with: +# readelf -p .GCC.command.line /path/to/elf_file +ADDITIONAL_OBJCFLAGS += -g -frecord-gcc-switches +