Skip to content

Commit

Permalink
Add -O2 compilation by default and -g debug info
Browse files Browse the repository at this point in the history
Also store GCC command-line switches in the binaries for easier
debugging.
  • Loading branch information
waptaff committed Jun 2, 2016
1 parent e7668e0 commit 04d12f5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions general.make
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# Use GCC level 2 optimization by default
# Might be overridden below
ADDITIONAL_OBJCFLAGS=-O2
ifeq ($(test-uninitialized),yes)
ifeq ($(debug),yes)
ADDITIONAL_OBJCFLAGS=-O0
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

0 comments on commit 04d12f5

Please sign in to comment.