since we will be building both 32-bit and 64-bit compiler-rt builtins
from a single configuration.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
- Add AR flags to the builtins CMake too since it may be used as a toplevel by the runtimes build
since we will be building both 32-bit and 64-bit compiler-rt builtins
from a single configuration.
@daltenty, from the limited context of this patch, this sounds questionable in terms of avoiding silent errors now and in the future. If the idea is to configure once and then run twice in the same build tree, then some things may get cached either in CMake or in generated headers, etc.
Would the 32-bit and 64-bit objects be built into different directories during the CMake build process?
It also seems like CMake needs to be run twice with a different OBJECT_MODE setting in the environment.
compiler-rt/CMakeLists.txt | ||
---|---|---|
503–504 | Remove extra spaces. | |
compiler-rt/lib/builtins/CMakeLists.txt | ||
31–32 | Remove extra spaces. |
Compiler-rt supports generating multiple targets from a single configuration. By default the compiler-rt build process will figure out the supported arches and generate different targets for the powerpc and powerpc64 objects, so there is only one real run.
The problem is that the CMake configuration doesn't really expect to need seperate AR flags for these targets and the environment OBJECT_MODE flag may not reflect what is actually being generated. I agree this is a bit of a blunt solution, but I'm not sure how much value we'd really get from being more specific with the mode flags (and it may hurt us if we want to start doing combined archives)
Would the 32-bit and 64-bit objects be built into different directories during the CMake build process?
That actually depends on the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR setting, see D45604. My assumption was AIX would adopt the traditional single directory layout similar to BSD / Solaris and friends, but I'll be putting up another PR to establish that default so that's definitely open for discussion.
It also seems like CMake needs to be run twice with a different OBJECT_MODE setting in the environment.
As noted above, it seems a single compiler-rt configuration may be expected to build for multiple targets, regardless of the default target / OBJECT_MODE setting.
LGTM; thanks.
Okay, I think I get it. With Clang as the build compiler, the target triple encodes the address mode. The compiler driver takes care of the object mode for compiling and linking.
Remove extra spaces.