Skip to content

Commit ed67caa

Browse files
committed
make rpath section check optional
1 parent f725e61 commit ed67caa

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

easybuild/framework/easyblock.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3066,7 +3066,7 @@ def _sanity_check_step_multi_deps(self, *args, **kwargs):
30663066
self.cfg['builddependencies'] = builddeps
30673067
self.cfg.iterating = False
30683068

3069-
def sanity_check_rpath(self, rpath_dirs=None):
3069+
def sanity_check_rpath(self, rpath_dirs=None, check_readelf_rpath=True):
30703070
"""Sanity check binaries/libraries w.r.t. RPATH linking."""
30713071

30723072
self.log.info("Checking RPATH linkage for binaries/libraries...")
@@ -3131,17 +3131,20 @@ def sanity_check_rpath(self, rpath_dirs=None):
31313131
self.log.debug("Output of 'ldd %s' checked, looks OK", path)
31323132

31333133
# check whether RPATH section in 'readelf -d' output is there
3134-
out, ec = run_cmd("readelf -d %s" % path, simple=False, trace=False)
3135-
if ec:
3136-
fail_msg = "Failed to run 'readelf %s': %s" % (path, out)
3137-
self.log.warning(fail_msg)
3138-
fails.append(fail_msg)
3139-
elif not readelf_rpath_regex.search(out):
3140-
fail_msg = "No '(RPATH)' found in 'readelf -d' output for %s: %s" % (path, out)
3141-
self.log.warning(fail_msg)
3142-
fails.append(fail_msg)
3134+
if check_readelf_rpath:
3135+
out, ec = run_cmd("readelf -d %s" % path, simple=False, trace=False)
3136+
if ec:
3137+
fail_msg = "Failed to run 'readelf %s': %s" % (path, out)
3138+
self.log.warning(fail_msg)
3139+
fails.append(fail_msg)
3140+
elif not readelf_rpath_regex.search(out):
3141+
fail_msg = "No '(RPATH)' found in 'readelf -d' output for %s: %s" % (path, out)
3142+
self.log.warning(fail_msg)
3143+
fails.append(fail_msg)
3144+
else:
3145+
self.log.debug("Output of 'readelf -d %s' checked, looks OK", path)
31433146
else:
3144-
self.log.debug("Output of 'readelf -d %s' checked, looks OK", path)
3147+
self.log.debug("Skipping the RPATH section check with 'readelf -d', as requested")
31453148
else:
31463149
self.log.debug("Not sanity checking files in non-existing directory %s", dirpath)
31473150

0 commit comments

Comments
 (0)