ispc: on ARM, build with ARM targets enabled, and updates (#38080)

* llvm: fix build with libcxx=none

* ispc: checksum 1.20.0

* ispc: ensure that it does not crash immediately

this would happen if linked to the wrong libc++

* ispc: fix build on macos

find ncurses instead of curses and link against tinfo in order to avoid
unresolved references to _del_curterm, _set_curterm, _setupterm, and
_tigetnum

* ispc: enable arm targets, if building on arm

* ispc: remove double cmake argument

I forgot to remove the constant -DARM_ENABLED=FALSE when adding
-DARM_ENABLED with a value depending on target architecture

* ispc: fix linux build

since 1.20, linux build uses TBB as default tasking system and thus
needs to depend on it

* ispc: try to fix link error on linux

link against both curses (as before) and tinfo (added because of macos)

* ispc: update for recent llvm changes

libcxx=none instead of ~libcxx
This commit is contained in:
Martin Aumüller 2023-07-11 18:44:18 +02:00 committed by GitHub
parent 5fc949f252
commit 2e695fa03f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View File

@ -25,6 +25,7 @@ class Ispc(CMakePackage):
executables = ["^ispc$"]
version("main", branch="main")
version("1.20.0", sha256="8bd30ded7f96859451ead1cecf6f58ac8e937288fe0e5b98c56f6eba4be370b4")
version("1.19.0", sha256="c1aeae4bdfb28004a6949394ea1b3daa3fdf12f646e17fcc0614861077dc8b6a")
version("1.18.1", sha256="fee76d42fc0129f81489b7c2b9143e22a44c281940693c1c13cf1e3dd2ab207f")
version("1.18.0", sha256="ecf1fc6ad5e39242e555b8e0ac539489939a9e475722eaa9da5caa4651cecf05")
@ -41,7 +42,9 @@ class Ispc(CMakePackage):
depends_on("flex", type="build")
depends_on("ncurses", type="link")
depends_on("zlib", type="link")
depends_on("tbb", type="link", when="platform=linux @1.20:")
depends_on("llvm+clang")
depends_on("llvm libcxx=none", when="platform=darwin")
depends_on("llvm@13:15", when="@1.19:")
depends_on("llvm@11.0:14.0", when="@1.18")
depends_on("llvm@11:14", when="@1.17")
@ -49,6 +52,8 @@ class Ispc(CMakePackage):
depends_on("llvm@11:", when="@1.16")
depends_on("llvm@10:11", when="@1.15.0:1.15")
depends_on("llvm@10.0:10", when="@1.13:1.14")
depends_on("llvm targets=arm,aarch64", when="target=arm:")
depends_on("llvm targets=arm,aarch64", when="target=aarch64:")
patch(
"don-t-assume-that-ncurses-zlib-are-system-libraries.patch",
@ -65,6 +70,7 @@ class Ispc(CMakePackage):
def setup_build_environment(self, env):
if self.spec.satisfies("@1.18.0:"):
env.append_flags("LDFLAGS", "-lcurses")
env.append_flags("LDFLAGS", "-ltinfo")
env.append_flags("LDFLAGS", "-lz")
def patch(self):
@ -76,14 +82,25 @@ def patch(self):
filter_file("bit 32 64", "bit 64", "cmake/GenerateBuiltins.cmake")
def cmake_args(self):
spec = self.spec
args = []
args.append("-DARM_ENABLED=FALSE")
args.append("-DISPC_NO_DUMPS=ON") # otherwise, LLVM needs patching
args.append("-DCURSES_NEED_NCURSES=TRUE")
args.append("-DISPC_INCLUDE_EXAMPLES=OFF")
args.append("-DISPC_INCLUDE_TESTS=OFF")
args.append("-DISPC_INCLUDE_UTILS=OFF")
if spec.satisfies("target=x86_64:") or spec.satisfies("target=x86:"):
args.append("-DARM_ENABLED=OFF")
elif spec.satisfies("target=aarch64:"):
args.append("-DARM_ENABLED=ON")
return args
@run_after("install")
def check_install(self):
with working_dir(self.stage.source_path):
ispc = Executable(join_path(self.prefix, "bin", "ispc"))
ispc("--version")
@classmethod
def determine_version(cls, exe):
output = Executable(exe)("--version", output=str, error=str)

View File

@ -885,6 +885,10 @@ def cmake_args(self):
if self.spec.satisfies("~code_signing platform=darwin"):
cmake_args.append(define("LLDB_USE_SYSTEM_DEBUGSERVER", True))
# LLDB test suite requires libc++
if "libcxx=none" in spec:
cmake_args.append(define("LLDB_INCLUDE_TESTS", False))
# Enable building with CLT [and not require full Xcode]
# https://github.com/llvm/llvm-project/issues/57037
if self.spec.satisfies("@15.0.0: platform=darwin"):