filter_compiler_wrappers: include realpath of compiler wrappers (#24456)

This commit is contained in:
eugeneswalker 2021-06-22 16:37:07 -07:00 committed by GitHub
parent 4da0561496
commit 2db858e9c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -190,7 +190,11 @@ def _filter_compiler_wrappers_impl(self):
]
for env_var, compiler_path in replacements:
if env_var in os.environ:
x.filter(os.environ[env_var], compiler_path, **filter_kwargs)
# filter spack wrapper and links to spack wrapper in case
# build system runs realpath
wrapper = os.environ[env_var]
for wrapper_path in (wrapper, os.path.realpath(wrapper)):
x.filter(wrapper_path, compiler_path, **filter_kwargs)
# Remove this linking flag if present (it turns RPATH into RUNPATH)
x.filter('{0}--enable-new-dtags'.format(self.compiler.linker_arg), '',