makefile: restore -O2 to clang non-debug builds
- clang's list of optimization options makes no mention of strict-overflow or no-strict-overflow, but it silently accepts -fno-strict-overflow and in fact honors it.
This commit is contained in:
parent
3f2d76eee5
commit
9414b6b98e
1 changed files with 7 additions and 6 deletions
11
makefile
11
makefile
|
@ -1043,16 +1043,15 @@ ifneq ($(DEBUG),)
|
||||||
BUILD_FEATURES = - debugging support
|
BUILD_FEATURES = - debugging support
|
||||||
else
|
else
|
||||||
ifneq (,$(findstring clang,$(COMPILER_NAME))$(findstring LLVM,$(COMPILER_NAME)))
|
ifneq (,$(findstring clang,$(COMPILER_NAME))$(findstring LLVM,$(COMPILER_NAME)))
|
||||||
CFLAGS_O = -O0
|
CFLAGS_O = -O2 -fno-strict-overflow
|
||||||
ifeq (Darwin,$(OSTYPE))
|
GCC_OPTIMIZERS_CMD = $(GCC) --help
|
||||||
NO_LTO = 1
|
NO_LTO = 1
|
||||||
endif
|
|
||||||
else
|
else
|
||||||
NO_LTO = 1
|
NO_LTO = 1
|
||||||
ifeq (Darwin,$(OSTYPE))
|
ifeq (Darwin,$(OSTYPE))
|
||||||
CFLAGS_O += -O4 -fno-strict-overflow -flto -fwhole-program
|
CFLAGS_O += -O4 -flto -fwhole-program
|
||||||
else
|
else
|
||||||
CFLAGS_O := -O2 -fno-strict-overflow
|
CFLAGS_O := -O2
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
LDFLAGS_O =
|
LDFLAGS_O =
|
||||||
|
@ -1061,6 +1060,8 @@ else
|
||||||
ifeq (,$(GCC_OPTIMIZERS_CMD))
|
ifeq (,$(GCC_OPTIMIZERS_CMD))
|
||||||
GCC_OPTIMIZERS_CMD = $(GCC) --help=optimizers
|
GCC_OPTIMIZERS_CMD = $(GCC) --help=optimizers
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
ifneq (,$(GCC_OPTIMIZERS_CMD))
|
||||||
GCC_OPTIMIZERS = $(shell $(GCC_OPTIMIZERS_CMD))
|
GCC_OPTIMIZERS = $(shell $(GCC_OPTIMIZERS_CMD))
|
||||||
endif
|
endif
|
||||||
ifneq (,$(findstring $(GCC_VERSION),$(LTO_EXCLUDE_VERSIONS)))
|
ifneq (,$(findstring $(GCC_VERSION),$(LTO_EXCLUDE_VERSIONS)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue