mirror of
https://github.com/simh/simh.git
synced 2026-01-14 15:45:18 +00:00
Exclude LTO from gcc builds when compiler isn't known to support it.
This commit is contained in:
parent
c293e154b0
commit
147ca8ced2
14
makefile
14
makefile
@ -111,12 +111,6 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
|
||||
LIBPATH += /usr/X11/lib
|
||||
OS_LDFLAGS += -L/usr/X11/lib
|
||||
endif
|
||||
# OSX's XCode gcc doesn't support LTO, but gcc built to explicitly enable it will work
|
||||
ifneq (,$(GCC_VERSION))
|
||||
ifeq (,$(shell $(GCC) -v /dev/null 2>&1 | grep '\-\-enable-lto'))
|
||||
LTO_EXCLUDE_VERSIONS += $(GCC_VERSION)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
ifeq (Linux,$(OSTYPE))
|
||||
LIBPATH := $(sort $(foreach lib,$(shell /sbin/ldconfig -p | grep ' => /' | sed 's/^.* => //'),$(dir $(lib))))
|
||||
@ -170,6 +164,14 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
# Some gcc versions don't support LTO, so only use LTO when the compiler is known to support it
|
||||
ifeq (,$(NO_LTO))
|
||||
ifneq (,$(GCC_VERSION))
|
||||
ifeq (,$(shell $(GCC) -v /dev/null 2>&1 | grep '\-\-enable-lto'))
|
||||
LTO_EXCLUDE_VERSIONS += $(GCC_VERSION)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
$(info lib paths are: $(LIBPATH))
|
||||
find_lib = $(strip $(firstword $(foreach dir,$(strip $(LIBPATH)),$(wildcard $(dir)/lib$(1).$(LIBEXT)))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user