I'd like to propose a new build configuration for OSS releases and development snapshots on macOS. This configuration would produce toolchains suitable for development on iOS, tvOS, watchOS, and xrOS.
Currently, there are two main obstacles preventing OSS toolchains from being used with these platforms:
-
Missing Libraries:
The librarieslibclang_rt.profile_(ios|iossim|...).a
are linked into a target when-profile-generate
is used (which is the default for debug builds in Xcode). However, they are unconditionally disabled in the build script using the-DCOMPILER_RT_ENABLE_*
options. You can see this implementation here and here. We could address this by enabling these libraries based on the presence of their respective options for enabling support for a particular platform such as--ios
or--watchos
. -
System-Provided Runtimes:
Deployments on these platforms do not support custom-built standard libraries. Therefore, toolchains produced by this build configuration should use system-provided runtimes instead. This can be achieved by setting the--darwin-toolchain-require-use-os-runtime=1
option.
With these adjustments, we could create a build configuration on CI that builds toolchain suitable for a wider array of Apple platforms.
The usefulness of development versions of the compiler without the corresponding standard library is of course debatable. But some features are improvements in the compiler itself and do not affect the stdlib. In any case, I would like to hear what you think.