summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-11-04 00:34:00 +0100
committerGitHub <noreply@github.com>2022-11-03 17:34:00 -0600
commitb52be759788cf20f1458c80e6e005744f5856c73 (patch)
treea53db50ae7ca4ea9e779be099faee6581fc24eda /var
parent7fc49c42ee27bcd2629e3ac112e63da460d9a26c (diff)
downloadspack-b52be759788cf20f1458c80e6e005744f5856c73.tar.gz
spack-b52be759788cf20f1458c80e6e005744f5856c73.tar.bz2
spack-b52be759788cf20f1458c80e6e005744f5856c73.tar.xz
spack-b52be759788cf20f1458c80e6e005744f5856c73.zip
Experimental binding of shared ELF libraries (#31948)
Adds another post install hook that loops over the install prefix, looking for shared libraries type of ELF files, and sets the soname to their own absolute paths. The idea being, whenever somebody links against those libraries, the linker copies the soname (which is the absolute path to the library) as a "needed" library, so that at runtime the dynamic loader realizes the needed library is a path which should be loaded directly without searching. As a result: 1. rpaths are not used for the fixed/static list of needed libraries in the dynamic section (only for _actually_ dynamically loaded libraries through `dlopen`), which largely solves the issue that Spack's rpaths are a heuristic (`<prefix>/lib` and `<prefix>/lib64` might not be where libraries really are...) 2. improved startup times (no library search required)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/cuda/package.py3
-rw-r--r--var/spack/repos/builtin/packages/nvhpc/package.py3
-rw-r--r--var/spack/repos/builtin/packages/openjdk/package.py5
3 files changed, 11 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py
index e8157b54ae..2375e318af 100644
--- a/var/spack/repos/builtin/packages/cuda/package.py
+++ b/var/spack/repos/builtin/packages/cuda/package.py
@@ -583,3 +583,6 @@ class Cuda(Package):
if "compat" not in parts and "stubs" not in parts:
filtered_libs.append(lib)
return LibraryList(filtered_libs)
+
+ # Avoid binding stub libraries by absolute path
+ non_bindable_shared_objects = ["stubs"]
diff --git a/var/spack/repos/builtin/packages/nvhpc/package.py b/var/spack/repos/builtin/packages/nvhpc/package.py
index b7e625b97c..2ade4bc9e6 100644
--- a/var/spack/repos/builtin/packages/nvhpc/package.py
+++ b/var/spack/repos/builtin/packages/nvhpc/package.py
@@ -415,3 +415,6 @@ class Nvhpc(Package):
libs.append("libnvf")
return find_libraries(libs, root=prefix, recursive=True)
+
+ # Avoid binding stub libraries by absolute path
+ non_bindable_shared_objects = ["stubs"]
diff --git a/var/spack/repos/builtin/packages/openjdk/package.py b/var/spack/repos/builtin/packages/openjdk/package.py
index 6382dc3688..fab50a28f8 100644
--- a/var/spack/repos/builtin/packages/openjdk/package.py
+++ b/var/spack/repos/builtin/packages/openjdk/package.py
@@ -413,3 +413,8 @@ class Openjdk(Package):
class_paths = find(dependent_spec.prefix, "*.jar")
classpath = os.pathsep.join(class_paths)
env.prepend_path("CLASSPATH", classpath)
+
+ # Since we provide openjdk as a binary, we can't remove an obsolete glibc
+ # fix that prevents us from modifying the soname of libjvm.so. If we move
+ # to source builds this should be possible.
+ non_bindable_shared_objects = ["libjvm.so"]