From a4bca65fbdb64680dcba9d1e3daba6e3789736a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 19 Dec 2025 11:36:09 +0100 Subject: [PATCH 1/3] check if ld wrappers are actually available --- eb_hooks.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eb_hooks.py b/eb_hooks.py index d080ea11..ce833535 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -331,6 +331,11 @@ def post_prepare_hook_gcc_prefixed_ld_rpath_wrapper(self, *args, **kwargs): cmd_prefix = '%s-' % system_type.strip() for cmd in ('ld', 'ld.gold', 'ld.bfd'): wrapper = which(cmd) + if wrapper is None: + # if no wrapper is found, the build machine does not have the corresponding command + # (e.g. there is no ld.gold in newer compatibility layers), + # and we can simply skip this step + continue self.log.info("Path to %s wrapper: %s" % (cmd, wrapper)) wrapper_dir = os.path.dirname(wrapper) prefix_wrapper = os.path.join(wrapper_dir, cmd_prefix + cmd) From ac4be2f1eac8b8f40f104cc1dcfe8be404b492b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 19 Dec 2025 13:49:38 +0100 Subject: [PATCH 2/3] only allow missing ld.gold, print an error for other missing wrappers --- eb_hooks.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index ce833535..6f5a67a7 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -332,10 +332,11 @@ def post_prepare_hook_gcc_prefixed_ld_rpath_wrapper(self, *args, **kwargs): for cmd in ('ld', 'ld.gold', 'ld.bfd'): wrapper = which(cmd) if wrapper is None: - # if no wrapper is found, the build machine does not have the corresponding command - # (e.g. there is no ld.gold in newer compatibility layers), - # and we can simply skip this step - continue + if cmd in ['ld.gold']: + # newer compatibility layers don't have ld.gold + continue + else: + raise EasyBuildError(f"No RPATH wrapper script found for {cmd}.") self.log.info("Path to %s wrapper: %s" % (cmd, wrapper)) wrapper_dir = os.path.dirname(wrapper) prefix_wrapper = os.path.join(wrapper_dir, cmd_prefix + cmd) From cc39efb12efe458538e1486a9cea3924fa750a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 19 Dec 2025 15:52:49 +0100 Subject: [PATCH 3/3] add fix for RISC-V unknown vs pc system type --- eb_hooks.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/eb_hooks.py b/eb_hooks.py index 6f5a67a7..d2cd2a29 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -329,6 +329,19 @@ def post_prepare_hook_gcc_prefixed_ld_rpath_wrapper(self, *args, **kwargs): config_guess = obtain_config_guess() system_type, _ = run_cmd(config_guess, log_all=True) cmd_prefix = '%s-' % system_type.strip() + if cmd_prefix.startswith('riscv64-unknown-'): + # The 2025.06 compatibility layer for RISC-V is built with CHOST=riscv64-pc-linux-gnu, + # while config.guess returns riscv64-unknown-linux-gnu. + # If we can't find an ld with the original cmd_prefix, but can find one with the -pc- prefix, + # we simply override the original cmd_prefix. + eprefix = get_eessi_envvar('EPREFIX') + cmd_prefix_riscv_pc = cmd_prefix.replace('-unknown-', '-pc-') + if ( + not os.path.exists(os.path.join(eprefix, 'usr', 'bin', cmd_prefix + 'ld')) and + os.path.exists(os.path.join(eprefix, 'usr', 'bin', cmd_prefix_riscv_pc + 'ld')) + ): + self.log.info(f"Using {cmd_prefix_riscv_pc} instead of {cmd_prefix} as command prefix.") + cmd_prefix = cmd_prefix_riscv_pc for cmd in ('ld', 'ld.gold', 'ld.bfd'): wrapper = which(cmd) if wrapper is None: