Right now the Makefile is cluttered with OS X equivalents
of all the x86 targets. We can get rid of all of them and
just check UNAME against "Darwin" for the few OS X-specific
things we need to do.
We also disable Clang LTO when using BMI2 instructions. For
some reason, LLVM cannot find the PEXT instruction when using
LTO. I don't know why, but disabling LTO for BMI2 fixes it.
No functional change.
-ifeq ($(ARCH),osx-ppc-32)
-ifeq ($(ARCH),osx-ppc-64)
-ifeq ($(ARCH),linux-ppc-64)
- arch = ppc64
- bits = 64
-endif
-
-ifeq ($(ARCH),osx-x86-64)
- arch = x86_64
- os = osx
- bits = 64
- prefetch = yes
- bsfq = yes
- sse = yes
-endif
-
-ifeq ($(ARCH),osx-x86-64-modern)
- arch = x86_64
- os = osx
- bits = 64
- prefetch = yes
- bsfq = yes
- popcnt = yes
- sse = yes
-endif
-
-ifeq ($(ARCH),osx-x86-32)
- arch = i386
- os = osx
- prefetch = yes
- bsfq = no
- popcnt = no
- sse = yes
-endif
-
### ==========================================================================
### Section 3. Low-level configuration
### ==========================================================================
### Section 3. Low-level configuration
profile_clean = gcc-profile-clean
endif
profile_clean = gcc-profile-clean
endif
CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.6
LDFLAGS += -arch $(arch) -mmacosx-version-min=10.6
endif
CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.6
LDFLAGS += -arch $(arch) -mmacosx-version-min=10.6
endif
ifeq ($(comp),gcc)
CXXFLAGS += -O3
ifeq ($(comp),gcc)
CXXFLAGS += -O3
ifeq ($(arch),i386)
CXXFLAGS += -mdynamic-no-pic
endif
ifeq ($(arch),i386)
CXXFLAGS += -mdynamic-no-pic
endif
CXXFLAGS += -fast -mdynamic-no-pic
else
CXXFLAGS += -fast
CXXFLAGS += -fast -mdynamic-no-pic
else
CXXFLAGS += -fast
ifeq ($(comp),clang)
CXXFLAGS += -O3
ifeq ($(comp),clang)
CXXFLAGS += -O3
- ifeq ($(os),osx)
- CXXFLAGS += -flto
+ ifeq ($(UNAME),Darwin)
+ ifeq ($(pext),no)
+ CXXFLAGS += -flto
+ LDFLAGS += $(CXXFLAGS)
+ endif
ifeq ($(arch),i386)
CXXFLAGS += -mdynamic-no-pic
endif
ifeq ($(arch),i386)
CXXFLAGS += -mdynamic-no-pic
endif
@echo "x86-64-bmi2 > x86 64-bit with pext support"
@echo "x86-32 > x86 32-bit with SSE support"
@echo "x86-32-old > x86 32-bit fall back for old hardware"
@echo "x86-64-bmi2 > x86 64-bit with pext support"
@echo "x86-32 > x86 32-bit with SSE support"
@echo "x86-32-old > x86 32-bit fall back for old hardware"
- @echo "linux-ppc-64 > PPC-Linux 64 bit"
- @echo "osx-ppc-64 > PPC-Mac OS X 64 bit"
- @echo "osx-ppc-32 > PPC-Mac OS X 32 bit"
- @echo "osx-x86-64-modern > x86-Mac OS X 64 bit with popcnt support"
- @echo "osx-x86-64 > x86-Mac OS X 64 bit"
- @echo "osx-x86-32 > x86-Mac OS X 32 bit"
- @echo "armv7 > ARMv7 32 bit"
+ @echo "ppc-64 > PPC 64-bit"
+ @echo "ppc-32 > PPC 32-bit"
+ @echo "armv7 > ARMv7 32-bit"
@echo "general-64 > unspecified 64-bit"
@echo "general-32 > unspecified 32-bit"
@echo ""
@echo "general-64 > unspecified 64-bit"
@echo "general-32 > unspecified 32-bit"
@echo ""
@test "$(optimize)" = "yes" || test "$(optimize)" = "no"
@test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \
test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "armv7"
@test "$(optimize)" = "yes" || test "$(optimize)" = "no"
@test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \
test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "armv7"
- @test "$(os)" = "any" || test "$(os)" = "osx"
@test "$(bits)" = "32" || test "$(bits)" = "64"
@test "$(prefetch)" = "yes" || test "$(prefetch)" = "no"
@test "$(bsfq)" = "yes" || test "$(bsfq)" = "no"
@test "$(bits)" = "32" || test "$(bits)" = "64"
@test "$(prefetch)" = "yes" || test "$(prefetch)" = "no"
@test "$(bsfq)" = "yes" || test "$(bsfq)" = "no"