gcc/0334-Dont-use-local_detect_cpu-when-cross-build.patch

28 lines
823 B
Diff

From cd708367a6558eca37715f8068f044a55402edab Mon Sep 17 00:00:00 2001
From: YunQiang Su <yunqiang@isrc.iscas.ac.cn>
Date: Wed, 18 Dec 2024 14:22:03 +0800
Subject: [PATCH] Don't use local_detect_cpu when cross build
-march=native makes no sense for cross build.
---
gcc/gcc.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 179d507f255..f2387e0fae2 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -5800,7 +5800,7 @@ do_self_spec (const char *spec)
do_spec_1 (" ", 0, NULL);
const char* tune_native = NULL;
-#if defined (__x86_64__) || defined (__aarch64__)
+#if !defined(CROSS_DIRECTORY_STRUCTURE) && (defined (__x86_64__) || defined (__aarch64__))
tune_native = eval_spec_function ("local_cpu_detect", "cpu", "");
#endif
if (tune_native == NULL)
--
Gitee