summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2021-06-17 11:25:19 +0200
committerGitHub <noreply@github.com>2021-06-17 09:25:19 +0000
commite4d80c997a7cfca416276fc62e06ea0ec8d2d0bb (patch)
tree1af61e542fb0736cb69b3d4d5810d090b079253f /lib
parent3571c1b812e4694be47eaca29366e72c93c7ea23 (diff)
downloadspack-e4d80c997a7cfca416276fc62e06ea0ec8d2d0bb.tar.gz
spack-e4d80c997a7cfca416276fc62e06ea0ec8d2d0bb.tar.bz2
spack-e4d80c997a7cfca416276fc62e06ea0ec8d2d0bb.tar.xz
spack-e4d80c997a7cfca416276fc62e06ea0ec8d2d0bb.zip
Unset LD_PRELOAD and DYLD_INSERT_LIBRARIES (#24177)
When running executables from build dependencies, we want to avoid that `LD_PRELOAD` and `DYLD_INSERT_LIBRARIES` any of their shared libs build by spack with system libraries.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_environment.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 5fa8a5d7de..70571570a9 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -159,6 +159,10 @@ def clean_environment():
env.unset('CPLUS_INCLUDE_PATH')
env.unset('OBJC_INCLUDE_PATH')
+ # Avoid that libraries of build dependencies get hijacked.
+ env.unset('LD_PRELOAD')
+ env.unset('DYLD_INSERT_LIBRARIES')
+
# On Cray "cluster" systems, unset CRAY_LD_LIBRARY_PATH to avoid
# interference with Spack dependencies.
# CNL requires these variables to be set (or at least some of them,