From 17386f368a72bba5ed5b3a831e9e9cb744c2f989 Mon Sep 17 00:00:00 2001
From: Cheng Shao <terrorjack@type.dance>
Date: Mon, 7 Oct 2024 23:02:50 +0000
Subject: [PATCH] testsuite: don't use host cpu features when testing cross ghc

This patch disables CPU feature detection logic when testing cross
GHC, since those features don't make sense for the target anyway.

(cherry picked from commit b4c3c34090088378870a6705d30665aac6d5c455)
---
 testsuite/driver/cpu_features.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testsuite/driver/cpu_features.py b/testsuite/driver/cpu_features.py
index 66ee0756adf..b7e7a0d648e 100644
--- a/testsuite/driver/cpu_features.py
+++ b/testsuite/driver/cpu_features.py
@@ -17,6 +17,9 @@ SUPPORTED_CPU_FEATURES = {
 cpu_feature_cache = None
 
 def get_cpu_features():
+    # Don't use host cpu features when testing cross ghc.
+    if config.cross:
+        return []
     try:
         # This import might fail, e.g. if "ctypes" is not available,
         # in which case we report the empty set of features.
-- 
GitLab