software/common: add LTO enable flag and cleanup.
This commit is contained in:
parent
b29f443fe5
commit
1d7c6943af
|
@ -7,14 +7,20 @@ endif
|
|||
RM ?= rm -f
|
||||
PYTHON ?= python3
|
||||
|
||||
ifeq ($(CLANG),1)
|
||||
ifneq ($(CPU), lm32)
|
||||
LTO = 0
|
||||
else
|
||||
LTO = 1
|
||||
endif
|
||||
|
||||
ifeq ($(CLANG), 1)
|
||||
CC_normal := clang -target $(TRIPLE) -integrated-as
|
||||
CX_normal := clang++ -target $(TRIPLE) -integrated-as
|
||||
else
|
||||
CC_normal := $(TARGET_PREFIX)gcc -std=gnu99
|
||||
CX_normal := $(TARGET_PREFIX)g++
|
||||
endif
|
||||
ifneq ($(CPU), lm32)
|
||||
ifneq ($(LTO), 1)
|
||||
AR_normal := $(TARGET_PREFIX)gcc-ar
|
||||
else
|
||||
AR_normal := $(TARGET_PREFIX)ar
|
||||
|
@ -28,7 +34,7 @@ AR_quiet = @echo " AR " $@ && $(AR_normal)
|
|||
LD_quiet = @echo " LD " $@ && $(LD_normal)
|
||||
OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(OBJCOPY_normal)
|
||||
|
||||
ifeq ($(V),1)
|
||||
ifeq ($(V), 1)
|
||||
CC = $(CC_normal)
|
||||
CX = $(CX_normal)
|
||||
AR = $(AR_normal)
|
||||
|
@ -50,8 +56,9 @@ DEPFLAGS += -MD -MP
|
|||
# Toolchain options
|
||||
#
|
||||
INCLUDES = -I$(SOC_DIRECTORY)/software/include/base -I$(SOC_DIRECTORY)/software/include -I$(SOC_DIRECTORY)/common -I$(BUILDINC_DIRECTORY)
|
||||
COMMONFLAGS = $(DEPFLAGS) -Os $(CPUFLAGS) -g3 -fomit-frame-pointer -Wall -fno-builtin -nostdinc $(INCLUDES) -ffunction-sections -fdata-sections -nostartfiles -nostdlib -nodefaultlibs
|
||||
ifneq ($(CPU), lm32)
|
||||
COMMONFLAGS = $(DEPFLAGS) -Os $(CPUFLAGS) -g3 -fomit-frame-pointer -Wall -fno-builtin -nostdinc $(INCLUDES)
|
||||
COMMONFLAGS += -ffunction-sections -fdata-sections -nostartfiles -nostdlib -nodefaultlibs
|
||||
ifneq ($(LTO), 1)
|
||||
COMMONFLAGS += -flto -fuse-linker-plugin
|
||||
endif
|
||||
CFLAGS = $(COMMONFLAGS) -fexceptions -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
|
||||
|
|
Loading…
Reference in New Issue