Skip to content

Commit a2216ef

Browse files
authored
Merge pull request #3173 from martin-frbg/dyna-sse3
Fix spillover of host-specific build flags into the shared part of x86 DYNAMIC_ARCH builds
2 parents 209b026 + 5332cba commit a2216ef

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

Makefile.x86

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
# COMPILER_PREFIX = mingw32-
22

3+
ifndef DYNAMIC_ARCH
4+
ADD_CPUFLAGS = 1
5+
else
6+
ifdef TARGET_CORE
7+
ADD_CPUFLAGS = 1
8+
endif
9+
endif
10+
11+
ifdef ADD_CPUFLAGS
312
ifdef HAVE_SSE
413
CCOMMON_OPT += -msse
14+
ifneq ($(F_COMPILER), NAG)
515
FCOMMON_OPT += -msse
616
endif
7-
17+
endif
18+
endif
819

920
ifeq ($(OSNAME), Interix)
1021
ARFLAGS = -m x86

Makefile.x86_64

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ endif
88
endif
99
endif
1010

11+
12+
ifndef DYNAMIC_ARCH
13+
ADD_CPUFLAGS = 1
14+
else
15+
ifdef TARGET_CORE
16+
ADD_CPUFLAGS = 1
17+
endif
18+
endif
19+
20+
ifdef ADD_CPUFLAGS
1121
ifdef HAVE_SSE3
1222
CCOMMON_OPT += -msse3
1323
ifneq ($(F_COMPILER), NAG)
@@ -44,7 +54,6 @@ endif
4454
endif
4555

4656
ifeq ($(CORE), SKYLAKEX)
47-
ifndef DYNAMIC_ARCH
4857
ifndef NO_AVX512
4958
CCOMMON_OPT += -march=skylake-avx512
5059
ifneq ($(F_COMPILER), NAG)
@@ -62,10 +71,8 @@ endif
6271
endif
6372
endif
6473
endif
65-
endif
6674

6775
ifeq ($(CORE), COOPERLAKE)
68-
ifndef DYNAMIC_ARCH
6976
ifndef NO_AVX512
7077
ifeq ($(C_COMPILER), GCC)
7178
# cooperlake support was added in 10.1
@@ -88,7 +95,6 @@ endif
8895
endif
8996
endif
9097
endif
91-
endif
9298

9399
ifdef HAVE_AVX2
94100
ifndef NO_AVX2
@@ -120,6 +126,7 @@ endif
120126
endif
121127
endif
122128

129+
endif
123130

124131

125132
ifeq ($(OSNAME), Interix)

0 commit comments

Comments
 (0)