[ORC-RT] Initial check-in for a new, top-level ORC runtime project. by lhames · Pull Request #113499 · llvm/llvm-project (original) (raw)
@llvm-beanz @petrhosek I'm just getting back to this.
I've hit a sticking point on Darwin: If I want to do a multiconfig build and take the compiler-rt approach:
% xcrun cmake -GNinja -DCMAKE_BUILD_TYPE=Debug
-DLLVM_ENABLE_PROJECTS="llvm;clang"
-DLLVM_ENABLE_RUNTIMES="orc-rt"
-DDARWIN_macosx_ARCHS="arm64;x86-64"
/path/to/llvm-project/llvm
I still only get a single-architecture archive, presumably because the CMake in this PR doesn't speak Apple-multiarch (by design).
On the other hand if I try the Linux approach and specify:
% xcrun cmake -GNinja -DCMAKE_BUILD_TYPE=Debug
-DLLVM_ENABLE_PROJECTS="llvm;clang"
-DLLVM_ENABLE_RUNTIMES="orc-rt"
-DLLVM_RUNTIME_TARGETS="arm64-apple-darwin;x86_64-apple-darwin"
/Users/lhames/Projects/llvm/llvm-github/llvm
I get an error at config time:
CMake Error at runtimes/CMakeLists.txt:64 (message):
compiler-rt for Darwin builds for all platforms and architectures using a
single configuration. Specify only a single darwin triple (e.g.
x86_64-apple-darwin) in your targets list (and not a triple for a specific
platform such as macos). You can use variables such as
COMPILER_RT_ENABLE_IOS and DARWIN_ios_ARCHS to control the specific
platforms and architectures to build. Set RUNTIMES_BUILD_ALLOW_DARWIN to
allow a single darwin triple.
Call Stack (most recent call first):
runtimes/CMakeLists.txt:623 (check_apple_target)
Passing -DRUNTIMES_BUILD_ALLOW_DARWIN
does allow a single triple to be specified, but doesn't allow multi-config.
If building compiler-rt is required for multi-config builds I guess we're going to need some sort of interim solution for Darwin that allows existing projects (compiler-rt in particular) to keep building, while allowing new projects to use -DLLVM_RUNTIME_TARGETS
on Apple. Would it make sense to add an LLVM_RUNTIMES_ISOLATE_APPLE_LEGACY_BUILDS
option that resets RUNTIMES_BUILD_ALLOW_DARWIN
(and any other arguments that aren't expected to be used for Apple-style builds) for Apple-style subprojects?