1
0
mirror of https://github.com/simh/simh.git synced 2026-03-03 18:16:24 +00:00

makefile: Make non debug builds with -O3 and LTO under gcc with -fwhole-program

This commit is contained in:
Mark Pizzolato
2022-10-29 18:03:33 -10:00
parent da5e7f4769
commit b4b18f02f9

View File

@@ -1313,10 +1313,10 @@ ifneq ($(DEBUG),)
LTO =
else
ifneq (,$(findstring clang,$(COMPILER_NAME))$(findstring LLVM,$(COMPILER_NAME)))
CFLAGS_O = -O2 -fno-strict-overflow
CFLAGS_O = -O3 -fno-strict-overflow
GCC_OPTIMIZERS_CMD = ${GCC} --help 2>&1
else
CFLAGS_O := -O2
CFLAGS_O := -O3
endif
LDFLAGS_O =
GCC_MAJOR_VERSION = $(firstword $(subst ., ,$(GCC_VERSION)))
@@ -1356,7 +1356,7 @@ else
ifneq (,$(LTO))
ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS)))
CFLAGS_O += -flto
ifneq (,$(and $(findstring gcc,$(COMPILER_NAME)),$(findstring -fwhole-program,$(GCC_OPTIMIZERS))))
ifneq (,$(and $(or $(findstring gcc,$(COMPILER_NAME)),$(findstring GCC,$(COMPILER_NAME))),$(findstring -fwhole-program,$(GCC_OPTIMIZERS))))
CFLAGS_O += -fwhole-program
endif
LTO_FEATURE = , with Link Time Optimization,