summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2021-11-18 04:10:59 +0100
committerGitHub <noreply@github.com>2021-11-17 20:10:59 -0700
commit40a6ac62d37ea5a8c7e3152e6a110759185f8109 (patch)
treeff7ae7986571922ae7621fc4ece3b6317f7e171b
parentd24d13559b78d640c6101321aca982197a156ca8 (diff)
downloadspack-40a6ac62d37ea5a8c7e3152e6a110759185f8109.tar.gz
spack-40a6ac62d37ea5a8c7e3152e6a110759185f8109.tar.bz2
spack-40a6ac62d37ea5a8c7e3152e6a110759185f8109.tar.xz
spack-40a6ac62d37ea5a8c7e3152e6a110759185f8109.zip
llvm: introduce [build/link]_llvm_dylib (#27450)
Apart from building a single dylib for LLVM, users should also be able to link tools against it.
-rw-r--r--share/spack/gitlab/cloud_pipelines/stacks/e4s-on-power/spack.yaml2
-rw-r--r--share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml2
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py19
3 files changed, 16 insertions, 7 deletions
diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s-on-power/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s-on-power/spack.yaml
index ef85ed69c0..fcc1eb1432 100644
--- a/share/spack/gitlab/cloud_pipelines/stacks/e4s-on-power/spack.yaml
+++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s-on-power/spack.yaml
@@ -119,7 +119,7 @@ spack:
- libnrm
- libquo
- libunwind
- - llvm +all_targets +clang +compiler-rt +libcxx +lld +lldb +llvm_dylib +flang ~cuda
+ - llvm +all_targets +clang +compiler-rt +libcxx +lld +lldb +build_llvm_dylib +flang ~cuda
- loki
- mercury
- metall
diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml
index 867a539b54..cb49f7a703 100644
--- a/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml
+++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml
@@ -130,7 +130,7 @@ spack:
- libnrm
- libquo
- libunwind
- - llvm +all_targets +clang +compiler-rt +libcxx +lld +lldb +llvm_dylib +flang ~cuda
+ - llvm +all_targets +clang +compiler-rt +libcxx +lld +lldb +build_llvm_dylib +flang ~cuda
- loki
- mercury
- metall
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index de30ba506e..cbfddc13e9 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -123,12 +123,17 @@ class Llvm(CMakePackage, CudaPackage):
"less memory to build, less stable",
)
variant(
- "llvm_dylib",
+ "build_llvm_dylib",
default=False,
description="Build LLVM shared library, containing all "
"components in a single shared library",
)
variant(
+ "link_llvm_dylib",
+ default=False,
+ description="Link LLVM tools against the LLVM shared library",
+ )
+ variant(
"all_targets",
default=False,
description="Build all supported targets, default targets "
@@ -190,7 +195,8 @@ class Llvm(CMakePackage, CudaPackage):
depends_on("gmp", when="@:3.6 +polly")
depends_on("isl", when="@:3.6 +polly")
- conflicts("+llvm_dylib", when="+shared_libs")
+ conflicts("+build_llvm_dylib", when="+shared_libs")
+ conflicts("+link_llvm_dylib", when="~build_llvm_dylib")
conflicts("+lldb", when="~clang")
conflicts("+libcxx", when="~clang")
conflicts("+internal_unwind", when="~clang")
@@ -552,9 +558,12 @@ class Llvm(CMakePackage, CudaPackage):
projects.append("polly")
cmake_args.append(define("LINK_POLLY_INTO_TOOLS", True))
- cmake_args.append(from_variant("BUILD_SHARED_LIBS", "shared_libs"))
- cmake_args.append(from_variant("LLVM_BUILD_LLVM_DYLIB", "llvm_dylib"))
- cmake_args.append(from_variant("LLVM_USE_SPLIT_DWARF", "split_dwarf"))
+ cmake_args.extend([
+ from_variant("BUILD_SHARED_LIBS", "shared_libs"),
+ from_variant("LLVM_BUILD_LLVM_DYLIB", "build_llvm_dylib"),
+ from_variant("LLVM_LINK_LLVM_DYLIB", "link_llvm_dylib"),
+ from_variant("LLVM_USE_SPLIT_DWARF", "split_dwarf")
+ ])
# By default on Linux, libc++.so is a linker script, and CMake tries to add the
# CMAKE_INSTALL_RPATH to it, which fails, causing installation to fail. The