Skip to content

Commit

Permalink
patch copied wrapper script to make sure it's actually working (CMD n…
Browse files Browse the repository at this point in the history
…eeds to be set to 'ld' for 'x86_64-pc-linux-gnu-ld', because EasyBuild's rpath_args.py only takes into account 'ld' when determining whether or not to use -Wl,-rpath or just -rpath
  • Loading branch information
boegel committed May 27, 2023
1 parent 7554604 commit c2ec231
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from easybuild.easyblocks.generic.configuremake import obtain_config_guess
from easybuild.tools.build_log import EasyBuildError, print_msg
from easybuild.tools.config import build_option, update_build_option
from easybuild.tools.filetools import copy_file, which
from easybuild.tools.filetools import apply_regex_substitutions, copy_file, which
from easybuild.tools.run import run_cmd
from easybuild.tools.systemtools import AARCH64, POWER, X86_64, get_cpu_architecture, get_cpu_features
from easybuild.tools.toolchain.compiler import OPTARCH_GENERIC
Expand Down Expand Up @@ -108,6 +108,17 @@ def gcc_postprepare(self, *args, **kwargs):
prefix_wrapper = os.path.join(wrapper_dir, cmd_prefix + cmd)
copy_file(wrapper, prefix_wrapper)
self.log.info("Path to %s wrapper with '%s' prefix: %s" % (cmd, cmd_prefix, which(prefix_wrapper)))

# we need to tweak the copied wrapper script, so that:
regex_subs = [
# - CMD in the script is set to the command name without prefix, because EasyBuild's rpath_args.py
# script that is used by the wrapper script only checks for 'ld', 'ld.gold', etc.
# when checking whether or not to use -Wl
('^CMD=.*', 'CMD=%s' % cmd),
# - the path to the correct actual binary is logged and called
('/%s ' % cmd, '/%s ' % (cmd_prefix + cmd)),
]
apply_regex_substitutions(prefix_wrapper, regex_subs)
else:
raise EasyBuildError("GCCcore-specific hook triggered for non-GCCcore easyconfig?!")

Expand Down

0 comments on commit c2ec231

Please sign in to comment.