Skip to content

Commit a776c9b

Browse files
committed
Also apply HSrts normalization to static lib
1 parent d67085d commit a776c9b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

haskell/toolchain.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,16 @@ def _haskell_toolchain_libraries(ctx, libraries):
262262
libs[libname] = {"dynamic": lib}
263263
for lib in target[HaskellImportHack].static_libraries.to_list():
264264
name = get_static_hs_lib_name(with_profiling, lib)
265+
266+
# with GHC >= 9.4.1 the rts library has a version number
267+
# included in the name.
268+
# for handling single-threaded and threading variants below,
269+
# we normalize the name and strip the version number
270+
if name.startswith("HSrts-"):
271+
idx = name.find("_")
272+
suffix = name[idx:] if idx > 0 else ""
273+
name = "HSrts" + suffix
274+
265275
entry = libs.get(name, {})
266276
entry["static"] = lib
267277
libs[name] = entry

0 commit comments

Comments
 (0)