Skip to main content

Module wall

Module wall 

Source
Expand description

The two targets whose system headers are somebody else’s to license.

Design: spec/cross-compile/13-distribution.md section 13.4 and spec/cross-compile/08-sysroots.md section 8.6.

Almost everything a target needs from us is ours to ship. glibc’s headers are LGPL, musl’s are MIT, mingw-w64’s are permissive, the kernel’s come with the system call note that says a program using the interface is not covered by the GPL, and the rest of section 8.2’s table is under a BSD licence. Two rows are not. Apple’s SDK is under the Xcode licence, which limits its use to Apple branded hardware, and Microsoft’s Windows SDK and universal CRT are not redistributable at all.

So for those two there is no tree we may bundle, no artifact a release may pin, and nothing to download on somebody’s behalf, and that is a different situation from a tree that has not been built yet. A compiler that said “there is no sysroot for this target” would send a person looking for a command that will never exist, so the answer names the licence and the lawful ways to get what is behind it.

§Why this is an enum and not a flag

Because the two walls bound different things for the person who hit one. A Windows program has a fully redistributable alternative, which is mingw-w64, and a build for that environment needs nothing installed at all, which is why the default Windows environment for a cross build is gnu. A macOS program has no alternative: the two lawful ways to get the SDK are to compile on a mac, where the installed one is found by asking xcrun, or to download Xcode yourself under its licence, and both of them end at a path that somebody has to name. The Windows one is found the same way on its own platform, by asking the installer that put it there rather than by looking in a fixed place, because neither the toolchain nor the kit is in one.

§What a wall is not

It is not a statement about the back end. We emit Mach-O and we emit COFF, and section 8.6 calls that targeting a platform rather than compiling for it. What is missing in both cases is headers and import libraries, which is why this sits beside the search path rather than anywhere near the code generator.

Enums§

Wall
A target whose system headers and link inputs are not ours to distribute.