From 3ee8f30df423790464ba8ba5fd3db294fb09813f 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)
(cherry picked from commit 908d66210d98183ae9856b4c663cf6aca9aa030b)
---
 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 97e51efa377..00790289ad3 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -730,10 +730,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, except for the rts.
     if in_place:
-- 
GitLab