diff --git a/makefile b/makefile index e10f058a..17ada04f 100644 --- a/makefile +++ b/makefile @@ -80,6 +80,10 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) ifeq (Darwin,$(OSTYPE)) OSNAME = OSX LIBEXT = dylib + # OSX's XCode gcc doesn't support LTO, but gcc built to explicitly enable it will work + ifeq (,$(shell $(GCC) -v /dev/null 2>&1 | grep '--enable-lto')) + LTO_EXCLUDE_VERSIONS += $(GCC_VERSION) + endif else ifeq (Linux,$(OSTYPE)) LIBPATH := $(sort $(foreach lib,$(shell /sbin/ldconfig -p | grep ' => /' | sed 's/^.* => //'),$(dir $(lib))))