Documentation
¶
Overview ¶
Package headers provides the C system headers of modernc.org/libc for the target it is built for, for C compilers that run without host files.
The headers are musl's public include tree, configured for the target, as libc's generator writes it to include/<goos>/<goarch> in this module. These are the files ccgo/v4 uses by default when it translates C against libc. They describe libc's ABI as ccgo sees it, so a compiler must use them the way ccgo does. It must predefine __CCGO__, which makes long double a double, as libc implements it, and the predefined macros of the target. ccgo also defines _GNU_SOURCE.
Each target's headers are embedded as a ZIP archive, so a binary carries only its own target's headers, and only if it calls FS. Importing the package costs nothing otherwise. Only linux/amd64 has headers so far; on other targets FS fails.
musl is distributed under the MIT license. Its copyright notice is the file COPYRIGHT in the root of the tree FS returns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FS ¶
FS returns the include tree of the target: FS().Open("stdio.h") opens what #include <stdio.h> includes. Each call returns a new *zip.Reader, which may be used concurrently.
No package-level initializer may refer to archive, otherwise the linker would keep it in every binary importing the package.
Types ¶
This section is empty.