makefile: Force gcc/clang -fcommon to address future gcc -fno-common default
as reported and discussed in #794
This commit is contained in:
parent
30c182a10c
commit
ca4b733883
1 changed files with 7 additions and 0 deletions
7
makefile
7
makefile
|
@ -1136,11 +1136,15 @@ else
|
||||||
ifneq (3,$(GCC_MAJOR_VERSION))
|
ifneq (3,$(GCC_MAJOR_VERSION))
|
||||||
ifeq (,$(GCC_OPTIMIZERS_CMD))
|
ifeq (,$(GCC_OPTIMIZERS_CMD))
|
||||||
GCC_OPTIMIZERS_CMD = ${GCC} --help=optimizers
|
GCC_OPTIMIZERS_CMD = ${GCC} --help=optimizers
|
||||||
|
GCC_COMMON_CMD = ${GCC} --help=common
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifneq (,$(GCC_OPTIMIZERS_CMD))
|
ifneq (,$(GCC_OPTIMIZERS_CMD))
|
||||||
GCC_OPTIMIZERS = $(shell $(GCC_OPTIMIZERS_CMD))
|
GCC_OPTIMIZERS = $(shell $(GCC_OPTIMIZERS_CMD))
|
||||||
endif
|
endif
|
||||||
|
ifneq (,$(GCC_COMMON_CMD))
|
||||||
|
GCC_OPTIMIZERS += $(shell $(GCC_COMMON_CMD))
|
||||||
|
endif
|
||||||
ifneq (,$(findstring $(GCC_VERSION),$(LTO_EXCLUDE_VERSIONS)))
|
ifneq (,$(findstring $(GCC_VERSION),$(LTO_EXCLUDE_VERSIONS)))
|
||||||
NO_LTO = 1
|
NO_LTO = 1
|
||||||
endif
|
endif
|
||||||
|
@ -1162,6 +1166,9 @@ else
|
||||||
ifneq (,$(findstring -fstrict-overflow,$(GCC_OPTIMIZERS)))
|
ifneq (,$(findstring -fstrict-overflow,$(GCC_OPTIMIZERS)))
|
||||||
CFLAGS_O += -fno-strict-overflow
|
CFLAGS_O += -fno-strict-overflow
|
||||||
endif
|
endif
|
||||||
|
ifneq (,$(findstring -fcommon,$(GCC_OPTIMIZERS))$(findstring -fno-common,$(GCC_OPTIMIZERS)))
|
||||||
|
CFLAGS_O += -fcommon
|
||||||
|
endif
|
||||||
ifeq (,$(NO_LTO))
|
ifeq (,$(NO_LTO))
|
||||||
ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS)))
|
ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS)))
|
||||||
CFLAGS_O += -flto -fwhole-program
|
CFLAGS_O += -flto -fwhole-program
|
||||||
|
|
Loading…
Add table
Reference in a new issue