Exclude LTO from gcc builds when compiler isn't known to support it.
This commit is contained in:
parent
c293e154b0
commit
147ca8ced2
1 changed files with 8 additions and 6 deletions
14
makefile
14
makefile
|
@ -111,12 +111,6 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
|
||||||
LIBPATH += /usr/X11/lib
|
LIBPATH += /usr/X11/lib
|
||||||
OS_LDFLAGS += -L/usr/X11/lib
|
OS_LDFLAGS += -L/usr/X11/lib
|
||||||
endif
|
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
|
else
|
||||||
ifeq (Linux,$(OSTYPE))
|
ifeq (Linux,$(OSTYPE))
|
||||||
LIBPATH := $(sort $(foreach lib,$(shell /sbin/ldconfig -p | grep ' => /' | sed 's/^.* => //'),$(dir $(lib))))
|
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
|
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
|
endif
|
||||||
$(info lib paths are: $(LIBPATH))
|
$(info lib paths are: $(LIBPATH))
|
||||||
find_lib = $(strip $(firstword $(foreach dir,$(strip $(LIBPATH)),$(wildcard $(dir)/lib$(1).$(LIBEXT)))))
|
find_lib = $(strip $(firstword $(foreach dir,$(strip $(LIBPATH)),$(wildcard $(dir)/lib$(1).$(LIBEXT)))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue