From 908d66210d98183ae9856b4c663cf6aca9aa030b Mon Sep 17 00:00:00 2001
From: Cheng Shao <terrorjack@type.dance>
Date: Sun, 13 Oct 2024 09:57:17 +0000
Subject: [PATCH] testsuite: fix shared library size tests for cross ghc

This commit fixes shared library size tests (e.g. array_so in
testsuite/tests/perf/size/all.T) when testing cross ghc. Previously,
if shared library file extension of host and target differs, those
tests will fail with framework errors due to not finding the right
files.

(cherry picked from commit 05e40406709fd325476a0fec89488a500094ecec)
(cherry picked from commit d00c26a51a23e4fb7bc7d5c44033b9ee3e4f9149)
---
 testsuite/driver/testlib.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 788b0dd1d7f..76dd5483020 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -733,10 +733,12 @@ def _find_so(lib, directory, in_place):
 
     # produce the suffix for the CI operating system
     suffix = "so"
-    if config.os == "mingw32":
-        suffix = "dll"
-    elif config.os == "darwin":
-        suffix = "dylib"
+    # config.os is host os
+    if not config.cross:
+        if config.os == "mingw32":
+            suffix = "dll"
+        elif config.os == "darwin":
+            suffix = "dylib"
 
     # Most artfacts are of the form foo-inplace, or foo-<hash> for release
     # builds, except for the rts.
-- 
GitLab