Skip to main content

Module library

Module library 

Source
Expand description

Where the library’s headers are.

Design: spec/04-driver-and-cli.md section 4.4.

A hosted implementation is two halves and rucc_session::runtime is one of them. The other is the library’s, and finding it is the compiler’s job because nothing else can do it. A compiler that has to be told -isystem /usr/include on every command line is a compiler nobody can run make with.

gcc settles this at configure time, which it can do because a gcc is built for the machine it will run on and the directories are baked into the binary. This compiler is one binary that runs wherever it is copied, so it has to ask the machine instead, and the shape of the answer is a list of candidates per platform of which the ones that exist are taken.

Cross compiling to another operating system produces nothing here on purpose. The host’s /usr/include describes the host’s library and handing it to a program being built for somewhere else is worse than handing it nothing, because the failure moves from the #include that could not be resolved to a declaration that is quietly wrong. A cross build supplies the headers with --sysroot or with -isystem, which is what every cross toolchain already does.

Structs§

Machine
What the machine says about itself, and what the command line said over the top of it.

Functions§

candidates
The directories the library’s headers might be in, in search order.
system_dirs
The directories the library’s headers are actually in, in search order.