Skip to content

Commit d393f19

Browse files
authored
Fix spillover of host-specific build flags into the shared part of DYNAMIC_ARCH builds with gmake
for #3139
1 parent 0492f0f commit d393f19

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Makefile.x86_64

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

11+
12+
ifndef DYNAMIC_ARCH
13+
define ADD_CPUFLAGS
14+
1
15+
endef
16+
else
17+
ifdef TARGET_CORE
18+
define ADD_CPUFLAGS
19+
1
20+
endef
21+
endif
22+
endif
23+
24+
ifdef ADD_CPUFLAGS
1125
ifdef HAVE_SSE3
1226
CCOMMON_OPT += -msse3
1327
ifneq ($(F_COMPILER), NAG)
@@ -44,7 +58,6 @@ endif
4458
endif
4559

4660
ifeq ($(CORE), SKYLAKEX)
47-
ifndef DYNAMIC_ARCH
4861
ifndef NO_AVX512
4962
CCOMMON_OPT += -march=skylake-avx512
5063
ifneq ($(F_COMPILER), NAG)
@@ -62,10 +75,8 @@ endif
6275
endif
6376
endif
6477
endif
65-
endif
6678

6779
ifeq ($(CORE), COOPERLAKE)
68-
ifndef DYNAMIC_ARCH
6980
ifndef NO_AVX512
7081
ifeq ($(C_COMPILER), GCC)
7182
# cooperlake support was added in 10.1
@@ -88,7 +99,6 @@ endif
8899
endif
89100
endif
90101
endif
91-
endif
92102

93103
ifdef HAVE_AVX2
94104
ifndef NO_AVX2
@@ -120,6 +130,7 @@ endif
120130
endif
121131
endif
122132

133+
endif
123134

124135

125136
ifeq ($(OSNAME), Interix)

0 commit comments

Comments
 (0)