This is an archive of the discontinued LLVM Phabricator instance.

[CMake][compiler-rt] Make CRT separately buildable
ClosedPublic

Authored by phosek on Feb 28 2022, 1:44 PM.

Diff Detail

Event Timeline

phosek created this revision.Feb 28 2022, 1:44 PM
phosek requested review of this revision.Feb 28 2022, 1:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2022, 1:44 PM
Herald added subscribers: Restricted Project, pcwang-thead. · View Herald Transcript

This was split from D89492. I plan on doing some addition cleanup in subsequent changes to reduce some of the duplication around project setup.

phosek updated this revision to Diff 411887.Feb 28 2022, 1:50 PM
kaz7 added a comment.Mar 4 2022, 3:05 AM

Thank you. For the case of VE, this works fine as

$ mkdir build-crt
$ cd build-crt
$ cmake -G Ninja ../llvm-project/compiler-rt/lib/crt
$ ninja install
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2022, 3:05 AM
kaz7 accepted this revision.Mar 7 2022, 6:06 AM

LGTM.

This revision is now accepted and ready to land.Mar 7 2022, 6:06 AM
This revision was landed with ongoing or failed builds.Mar 7 2022, 11:05 PM
This revision was automatically updated to reflect the committed changes.
phosek reopened this revision.Mar 8 2022, 12:01 AM

This appears to have broken the VE bot.

This revision is now accepted and ready to land.Mar 8 2022, 12:01 AM
simoll added a subscriber: simoll.Mar 8 2022, 12:58 AM

Try relanding. I've updated llvm-zorg: commit 4b6aa0f2f4a8 "[ve] fix target triple"

shchenz added a subscriber: shchenz.Mar 8 2022, 5:33 AM
shchenz added inline comments.
compiler-rt/cmake/crt-config-ix.cmake
30

I know this was reverted. One question, do we need to include PPC32/PPC64/HEXAGON here? I see the legacy ALL_CRT_SUPPORTED_ARCH defined in compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake has these three archs. Thanks

kaz7 added a comment.Mar 17 2022, 3:19 AM

@simoll , thank you for fixing the VE bot problem. This should work fine now.

q66 added a subscriber: q66.Apr 5 2022, 6:58 PM
q66 added inline comments.
compiler-rt/cmake/crt-config-ix.cmake
30

indeed, i believe this will break ppc* builds

phosek updated this revision to Diff 420712.Apr 5 2022, 10:44 PM
phosek marked an inline comment as done.
phosek added inline comments.
compiler-rt/cmake/crt-config-ix.cmake
30

Thanks for catching this!

This revision was landed with ongoing or failed builds.Apr 5 2022, 11:46 PM
This revision was automatically updated to reflect the committed changes.

Hey man, I think you introduced a bug, when compiling compiler-rt as part of LLVM cmake is reconfigued and cached variables are deleted.

it changes the compiler to the freshly built version of clang, that in my case is buggy and it leads to the rest of llvm failing to compile.

more info: https://github.com/llvm/llvm-project/issues/54903

Seeing this cmake error for ARM32 after this patch.

--Supported architectures for crt: arm;armv6m
CMake Error: Attempt to add a custom rule to output ".../compiler-rt/arm32/linux/lib/linux/clang_rt.crtbegin-arm.o.rule" which already has a custom rule.
CMake Error: Attempt to add a custom rule to output ".../compiler-rt/arm32/linux/lib/linux/clang_rt.crtend-arm.o.rule" which already has a custom rule.

https://github.com/llvm/llvm-project/issues/55046