Move function/data sections to common CFLAGS

Instead of adding -ffunction-sections and -fdata-sections to
every architecture, just add it to CFLAGS_common, thus making
sure that new architectures will pick it up automatically.

Change-Id: I38e878851226565b7791d05e222cb4e502e0c8a3
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/11105
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Stefan Reinauer 2015-07-31 13:50:03 -07:00 committed by Patrick Georgi
parent d0d487aaf4
commit d146ac6a33
2 changed files with 7 additions and 11 deletions

View File

@ -270,6 +270,8 @@ CFLAGS_common += -pipe -g -nostdinc
CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
CFLAGS_common += -Wstrict-aliasing -Wshadow CFLAGS_common += -Wstrict-aliasing -Wshadow
CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
CFLAGS_common += -ffunction-sections -fdata-sections
ifeq ($(CONFIG_COMPILER_GCC),y) ifeq ($(CONFIG_COMPILER_GCC),y)
# cf. commit f69a99db (coreboot: x86: enable gc-sections) # cf. commit f69a99db (coreboot: x86: enable gc-sections)
@ -279,7 +281,6 @@ endif
ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y) ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y)
CFLAGS_common += -Werror CFLAGS_common += -Werror
endif endif
CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
ifneq ($(GDB_DEBUG),) ifneq ($(GDB_DEBUG),)
CFLAGS_common += -Og CFLAGS_common += -Og
else else

View File

@ -62,16 +62,11 @@ ARCHDIR-arm64 := arm64
ARCHDIR-riscv := riscv ARCHDIR-riscv := riscv
ARCHDIR-mips := mips ARCHDIR-mips := mips
CFLAGS_arm += -ffunction-sections -fdata-sections CFLAGS_arm +=
CFLAGS_arm64 += -mgeneral-regs-only
CFLAGS_arm64 += -ffunction-sections -fdata-sections -mgeneral-regs-only CFLAGS_mips += -mips32r2 -G 0 -mno-abicalls -fno-pic
CFLAGS_riscv +=
CFLAGS_mips += -mips32r2 -G 0 -ffunction-sections -fdata-sections CFLAGS_x86_32 +=
CFLAGS_mips += -mno-abicalls -fno-pic
CFLAGS_x86_32 += -ffunction-sections -fdata-sections
CFLAGS_riscv += -ffunction-sections -fdata-sections
CFLAGS_x86_64 += -mcmodel=large -mno-red-zone CFLAGS_x86_64 += -mcmodel=large -mno-red-zone
# Some boards only provide 2K stacks, so storing lots of data there leads to # Some boards only provide 2K stacks, so storing lots of data there leads to