Skip to content

Commit 13c764e

Browse files
authored
Merge pull request #4434 from martin-frbg/issue4433
Only use mtune=native in ARM64 fallback paths when not cross-compiling
2 parents 2527afa + 025a1b2 commit 13c764e

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

Makefile.arm64

+16-4
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,15 @@ ifneq ($(F_COMPILER), NAG)
104104
FCOMMON_OPT += -march=armv8.4-a -mtune=neoverse-v1
105105
endif
106106
else
107-
CCOMMON_OPT += -march=armv8.4-a+sve -mtune=native
107+
CCOMMON_OPT += -march=armv8.4-a+sve
108+
ifneq ($(CROSS), 1)
109+
CCOMMON_OPT += -mtune=native
110+
endif
108111
ifneq ($(F_COMPILER), NAG)
109-
FCOMMON_OPT += -march=armv8.4-a -mtune=native
112+
FCOMMON_OPT += -march=armv8.4-a
113+
ifneq ($(CROSS), 1)
114+
FCOMMON_OPT += -mtune=native
115+
endif
110116
endif
111117
endif
112118
else
@@ -138,9 +144,15 @@ ifneq ($(F_COMPILER), NAG)
138144
FCOMMON_OPT += -march=armv8.5-a+sve+sve2+bf16 -mtune=neoverse-n2
139145
endif
140146
else
141-
CCOMMON_OPT += -march=armv8.5-a+sve -mtune=native
147+
CCOMMON_OPT += -march=armv8.5-a+sve
148+
ifneq ($(CROSS), 1)
149+
CCOMMON_OPT += -mtune=native
150+
endif
142151
ifneq ($(F_COMPILER), NAG)
143-
FCOMMON_OPT += -march=armv8.5-a -mtune=native
152+
FCOMMON_OPT += -march=armv8.5-a
153+
ifneq ($(CROSS), 1)
154+
FCOMMON_OPT += -mtune=native
155+
endif
144156
endif
145157
endif
146158
else

0 commit comments

Comments
 (0)