From 2db858e9c4fc16db4051004e4cca8b11154a3d22 Mon Sep 17 00:00:00 2001 From: eugeneswalker <38933153+eugeneswalker@users.noreply.github.com> Date: Tue, 22 Jun 2021 16:37:07 -0700 Subject: filter_compiler_wrappers: include realpath of compiler wrappers (#24456) --- lib/spack/spack/mixins.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/mixins.py b/lib/spack/spack/mixins.py index be13e3ea3a..ee1f57c91d 100644 --- a/lib/spack/spack/mixins.py +++ b/lib/spack/spack/mixins.py @@ -190,7 +190,11 @@ def filter_compiler_wrappers(*files, **kwargs): ] 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), '', -- cgit v1.2.3-70-g09d2