參考資訊:
https://stackoverflow.com/questions/72190379/lld-runs-lto-even-if-fno-lto-is-passed
DEF_FLAGS += -Wall -Wno-unused-variable #-flto ifeq ($(DEBUG), 1) OBJDIR := $(OBJDIR_BASE)/debug DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG -fno-lto else OBJDIR := $(OBJDIR_BASE)/release DEF_FLAGS += -O2 -DNDEBUG -flto endif
P.S. 改成只有在release時,才做LD最佳化