VE doesn't distribute crtbegin/end, so compilation of LLVM for VE
requires to compile crtbegin/end first similar to builtin.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This patch add mechanism to compile crtbegin/end before other libraries which is similar to a mechanism to compile builtins before compile-rt.
The crtbegin/end files are not available for VE freely. Those are distributed as a part of propariatary libraries. Therefore, we need to compile crtbegin/end before other libraries. This patch modifies building mechanism to compile crtbegin/end similar to builtins without other libraries. Then, compile compiler-rt again in the middle of compilation. This patch is useful for not only for SX-Aurora VE, but also other architectures which has no crtbegin/end freely.
However, I'm not sure what kind of mechanism is good for other architectures. For example, I can define LLVM_BUILTIN_CRTBEGIN_TARGETS variable to enable this feature. However, I'm not sure what is the best. So, this time, I send this patch for only crtbegin/end before other libraies for only VE at the moment. I appreciate any comments and requests for changes. Thanks!!
Thank you for this change. We've discussed this before with other contributors. The main concern over adding another sub-build is the increased overhead since every CMake run takes considerable time. To address that, I have implemented D89492 which makes it possible to build builtins and crtbegin/crtend in a single CMake build without requiring another sub-build. That change is ready to land but it's been waiting for someone to review it, do you want to take a look if it addresses your use case?
Thank you for trying to achieve pre-compiling of crtbegin/crtend and builtins. I'll join D89492 and review it.