From c4c6d714b93e65052c872df0c3b700302adaba97 Mon Sep 17 00:00:00 2001
From: Cheng Shao <terrorjack@type.dance>
Date: Thu, 16 May 2024 18:27:25 +0000
Subject: [PATCH] testsuite: don't attempt to detect host cpu features when
 testing cross ghc

The testsuite driver CPU feature detection logic only detects host CPU
and only makes sense when we are not testing a cross GHC.
---
 testsuite/driver/cpu_features.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testsuite/driver/cpu_features.py b/testsuite/driver/cpu_features.py
index f6c441d88f4c..4ab1e65a6568 100644
--- a/testsuite/driver/cpu_features.py
+++ b/testsuite/driver/cpu_features.py
@@ -17,6 +17,11 @@ SUPPORTED_CPU_FEATURES = {
 cpu_feature_cache = None
 
 def get_cpu_features():
+    # we're testing a cross ghc, don't attempt to detect host cpu
+    # configuration
+    if config.target_wrapper is not None:
+        return {}
+
     if config.os in ['mingw32', 'linux'] and os.path.exists('/proc/cpuinfo'):
         with open('/proc/cpuinfo') as x:
             f = x.read()
-- 
GitLab