From b0a6be29aaf59bf56af73f57e9bcfca19d84b800 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Sat, 4 Apr 2026 14:38:15 +0200 Subject: [PATCH 1/3] testsuite: normalise macOS ld reexported library warning The macOS-13 GitHub Actions runner now ships with Homebrew llvm@18, whose libunwind triggers a linker warning on every invocation: ld: warning: reexported library with install name '/usr/local/opt/llvm@18/lib/libunwind.1.dylib' ... couldn't be matched with any parent library and will be linked directly This causes ~190 spurious test failures (bad stderr / stderr mismatch) on the Mac x86_64 CI. Filter the warning in both normalise_errmsg and normalise_output, alongside the existing macOS ld warning patterns. --- testsuite/driver/testlib.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 9c0c6f11f8bb..a802a4708201 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -3061,6 +3061,8 @@ def normalise_errmsg(s: str) -> str: s = re.sub('ld: warning: -sdk_version and -platform_version are not compatible, ignoring -sdk_version','',s) # ignore superfluous dylibs passed to the linker. s = re.sub('ld: warning: .*, ignoring unexpected dylib file\n','',s) + # ignore macOS ld warning about reexported libraries (e.g. Homebrew llvm libunwind) + s = re.sub('ld: warning: reexported library with install name .* couldn.t be matched with any parent library and will be linked directly\n','',s) # ignore LLVM Version mismatch garbage; this will just break tests. s = re.sub('You are using an unsupported version of LLVM!.*\n','',s) s = re.sub('Currently only [\\.0-9]+ is supported. System LLVM version: [\\.0-9]+.*\n','',s) @@ -3175,6 +3177,8 @@ def normalise_output( s: str ) -> str: s = re.sub('ld: warning: -sdk_version and -platform_version are not compatible, ignoring -sdk_version','',s) # ignore superfluous dylibs passed to the linker. s = re.sub('ld: warning: .*, ignoring unexpected dylib file\n','',s) + # ignore macOS ld warning about reexported libraries (e.g. Homebrew llvm libunwind) + s = re.sub('ld: warning: reexported library with install name .* couldn.t be matched with any parent library and will be linked directly\n','',s) # ignore LLVM Version mismatch garbage; this will just break tests. s = re.sub('You are using an unsupported version of LLVM!.*\n','',s) s = re.sub('Currently only [\\.0-9]+ is supported. System LLVM version: [\\.0-9]+.*\n','',s) From 8163682dadca12ef97fb683d87938ae145436ea1 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Sat, 4 Apr 2026 15:49:43 +0200 Subject: [PATCH 2/3] deriveConstants: split CC flags from program path Recent macOS and Windows CI runner images set CC to include flags (e.g. "/usr/bin/cc -std=gnu23"). The --gcc-program argument was passed directly to rawSystem which treats the entire string as an executable path, causing: deriveConstants: /usr/bin/cc -std=gnu23: rawSystem: posix_spawnp: does not exist (No such file or directory) Split the --gcc-program value on whitespace: the first word becomes the program path, remaining words are prepended to the gcc flags. --- utils/deriveConstants/Main.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/deriveConstants/Main.hs b/utils/deriveConstants/Main.hs index 2fe21e23e4af..9ad55456309a 100644 --- a/utils/deriveConstants/Main.hs +++ b/utils/deriveConstants/Main.hs @@ -137,7 +137,10 @@ parseArgs = do args <- getArgs f opts ("-o" : fn : args') = f (opts {o_outputFilename = Just fn}) args' f opts ("--gcc-program" : prog : args') - = f (opts {o_gccProg = Just prog}) args' + = case words prog of + (p:flags) -> f (opts {o_gccProg = Just p, + o_gccFlags = flags ++ o_gccFlags opts}) args' + [] -> f (opts {o_gccProg = Just prog}) args' f opts ("--gcc-flag" : flag : args') = f (opts {o_gccFlags = flag : o_gccFlags opts}) args' f opts ("--nm-program" : prog : args') From 8f815505c2d9eb0c01caf42d0641fc255344c2c4 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Sat, 4 Apr 2026 17:01:24 +0200 Subject: [PATCH 3/3] ghc-internal: use struct _utimbuf on Windows On Windows (MSYS2/CLANG64), the _utime function expects a struct _utimbuf pointer. The CUtimbuf CTYPE was declared as "struct utimbuf" which worked when clang treated them as compatible, but with -std=gnu23 (now the default on updated CI runner images) clang errors on the type mismatch: incompatible pointer types passing 'struct utimbuf *' to parameter of type 'struct _utimbuf *' Use the correct Windows type name in the CTYPE pragma. --- .../ghc-internal/src/GHC/Internal/System/Posix/Internals.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs b/libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs index 7fd0fe75159d..a5dd56061228 100644 --- a/libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs +++ b/libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs @@ -97,7 +97,11 @@ data {-# CTYPE "struct stat" #-} CStat data {-# CTYPE "struct termios" #-} CTermios data {-# CTYPE "struct tm" #-} CTm data {-# CTYPE "struct tms" #-} CTms +#if defined(mingw32_HOST_OS) +data {-# CTYPE "struct _utimbuf" #-} CUtimbuf +#else data {-# CTYPE "struct utimbuf" #-} CUtimbuf +#endif data {-# CTYPE "struct utsname" #-} CUtsname type FD = CInt