This is an archive of the discontinued LLVM Phabricator instance.

[runtimes][compiler-rt] Add optional runtimes step to build crt up front
AbandonedPublic

Authored by daltenty on Oct 6 2020, 3:29 PM.

Details

Summary

When building runtimes, the built compiler may depend on components from
compiler-rt's crt module depending on the target and configuration, and
thus have difficulty passing CMake configuration test if crt is not
already available (the same as is true for compiler-rt builtins).

Similar to builtins, this change provides the ability to build
crt prior to trying to build the rest of runtimes, in order to resolve
this dependency. This includes adding a standalone header to the crt
CMakeLists.txt and a separate crt-config-ix.cmake both in the same
style as what is currently done for builtins.

Enabling this build behavior is gated under the LLVM_RUNTIMES_CRT_STANDALONE_BUILD
variable, so the default build is unmodified and specific configurations
that need it can opt-in to it.

Diff Detail

Event Timeline

daltenty created this revision.Oct 6 2020, 3:29 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 6 2020, 3:29 PM
Herald added subscribers: llvm-commits, Restricted Project, s.egerton and 5 others. · View Herald Transcript
daltenty requested review of this revision.Oct 6 2020, 3:29 PM
phosek added a subscriber: beanz.Oct 6 2020, 3:57 PM

See D70744 which is trying to achieve the same, but instead it builds crt together with builtins. When I started working on that change, I also considered the approached used in this change and I briefly discussed it with @beanz, but there was a concern that adding more stages is going to increase already long build time even further.

compiler-rt/cmake/config-ix.cmake
670

What does setting this to TRUE more often do?

compiler-rt/cmake/crt-config-ix.cmake
25–41

My guess is that the unreferenced lists here are going to become unmaintained lists very quickly. Also, what is the scope associated with these? Are we sure that these are not overriding other definitions before their corresponding use?

47

Nit: re: extra space.

48

Nit: Comma.

See D70744 which is trying to achieve the same, but instead it builds crt together with builtins. When I started working on that change, I also considered the approached used in this change and I briefly discussed it with @beanz, but there was a concern that adding more stages is going to increase already long build time even further.

@phosek Thanks, I think it makes a lot of sense to keep it all together in a single stage. It also avoids duplicating a lot of the config which this approach does. I'm not opposed to abandoning this revision if you'd prefer to revive D70744 instead then?

See D70744 which is trying to achieve the same, but instead it builds crt together with builtins. When I started working on that change, I also considered the approached used in this change and I briefly discussed it with @beanz, but there was a concern that adding more stages is going to increase already long build time even further.

@phosek Thanks, I think it makes a lot of sense to keep it all together in a single stage. It also avoids duplicating a lot of the config which this approach does. I'm not opposed to abandoning this revision if you'd prefer to revive D70744 instead then?

@phosek Gentle ping on whether we are keeping this patch around, or if you'd like to update D70744 (since it's already approved) instead. I can merge the approach of D70744 into here if you'd prefer to abandon that one instead.

compiler-rt/cmake/crt-config-ix.cmake
25–41

These really probably should have a common definition that get's included somewhere. Right now all the various cmake files that need it reproduce the list.

daltenty planned changes to this revision.Oct 13 2020, 11:26 AM

See D70744 which is trying to achieve the same, but instead it builds crt together with builtins. When I started working on that change, I also considered the approached used in this change and I briefly discussed it with @beanz, but there was a concern that adding more stages is going to increase already long build time even further.

@phosek Thanks, I think it makes a lot of sense to keep it all together in a single stage. It also avoids duplicating a lot of the config which this approach does. I'm not opposed to abandoning this revision if you'd prefer to revive D70744 instead then?

@phosek Gentle ping on whether we are keeping this patch around, or if you'd like to update D70744 (since it's already approved) instead. I can merge the approach of D70744 into here if you'd prefer to abandon that one instead.

I plan to land D70744.

daltenty abandoned this revision.Oct 13 2020, 1:18 PM

See D70744 which is trying to achieve the same, but instead it builds crt together with builtins. When I started working on that change, I also considered the approached used in this change and I briefly discussed it with @beanz, but there was a concern that adding more stages is going to increase already long build time even further.

@phosek Thanks, I think it makes a lot of sense to keep it all together in a single stage. It also avoids duplicating a lot of the config which this approach does. I'm not opposed to abandoning this revision if you'd prefer to revive D70744 instead then?

@phosek Gentle ping on whether we are keeping this patch around, or if you'd like to update D70744 (since it's already approved) instead. I can merge the approach of D70744 into here if you'd prefer to abandon that one instead.

I plan to land D70744.

Thanks, I'll abandon this revision in favour for D70744 then.