When building builtins separately as part of the runtime build, we
also want to include crt. To enable that, enable building builtins
together with crt using the top-level CMake file with a new option
I think this is an improvement, it was awkward to have two top-level entry points to the cmake anyway. This probably allows for some further de-duplication down the road as well.
It would be nice to print the list of supported crt arch here as well.
OS_NAME doesn't currently get set in builtin-config-ix, we'll need to duplicate the setup from config-ix.
We probably should retain the new cmake minimum
We should probably disable the crt build here now.
Ditto the other comment
LGTM, with slight adjustment. Though I will note that this requires a clean build because CMake will complain about the change in source directory in cache:
CMake Error: The source “../compiler-rt/CMakeLists.txt" does not match the source ../compiler-rt/lib/builtins/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.
fyi, this needs a slight adjustments because D87120 has landed
The problem we have here is that the scope for these variables has changed, builtin-config-ix.cmake is only included in the builtins CMakeList.tx, so when we go to check COMPILER_RT_HAS_CRT it's out of scope.
Perhaps it would be cleaner to split the CRT checks into it's own crt-config-ix.cmake that can be included at the appropriate scope?
Hi. Thank you for trying to achieve pre-compiling of crtbegin/crtend and builtins. Our architecture, SX-Aurora VE, doesn't have freely distributed crtbegin/crtend, so a mechanism like this is really important as I mentioned in D115038.
I take a look. I think the way to isolate each modules are good way to do. So, basically, it's fine to land in my opinion. However, we have been updating runtimes tramendously. So, it's better to rebase to recent main. We already have compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake. Scope is changed like @daltenty suggested.
After that, we can review it and run it. Thank you for your efforts.
I also think separating this patch to following 3 parts makes applying this patch easy.
- moving AIX related definitions
- isolating crt-config-ix.cmake
- supporting bootstrap build of crtbegin/crtend and builtins
Hi, is there anything I can help to merge this patch? We need this modification to compile crtbegin/crtend before runtime libraries in order to compile LLVM for VE using bootstrapping build, https://libcxx.llvm.org/BuildingLibcxx.html#bootstrapping-build.
I understand you are very busy. But, is there any way to push forward this patch since the ability of runtime standalone build has been removed at D119255. We, VE, badly need this feature, compiling crtbegin.o and crtend.o before runtimes. I previously posted similar patch, D115038, but it is recommended to remove since you already post this patch. But, this patch is not merged yet. Now, this patch is blocking VE runtime build from my point of view. Is it OK to make a similar patch if you don't have time to work on this? Please let me know what you think. Thanks.
are there any plans to get this or an equivalent in? currently in my distribution i have to ship a version of this patch rebased to llvm 14 (https://github.com/chimera-linux/cports/blob/master/main/llvm/patches/999-build-runtimes-crt.patch) because if i don't, i can't build llvm at all (my system is fully llvm-based, therefore does not come with a gcc crt; an llvm crt is needed in order to build the rest of the runtimes, as otherwise invoking the in-tree clang used to build compiler-rt will try to find crtbeginS.o etc. which do not exist in my system)
considering the old way of doing things is deprecated and as far as i can tell scheduled for removal in llvm 15, not having something equivalent to this means llvm will no longer build out of box in gcc-less linux systems...