Repository navigation
Expand file tree
/
Copy pathmcpp.toml
More file actions
142 lines (131 loc) · 7.83 KB
/
Copy pathmcpp.toml
File metadata and controls
142 lines (131 loc) · 7.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# mcpplibs/openkal-platform -- the platform of the ok-image targets
# (`<arch>-openkal`; mcpp SPEC-013, openkal SPEC clause 12).
#
# A data package: everything the openkal ecosystem agrees on for an ok image --
# how one is compiled and linked, the notes it carries and the check that
# accepts it, its names, the loader that runs it, the program that carries it
# (M3) -- and the versions of the family that are built and tested together.
# mcpp pins one version of it for the two targets, which is what "built-in
# support" for them is; a project may select another with
# `[target.<selector>] platform = "openkal-platform@<version>"`. The one program
# here is the plugin (`build.mcpp`), which provides the `okb` package format.
[package]
namespace = "mcpplibs"
name = "openkal-platform"
version = "0.20.0"
description = "The platform of ok images (<arch>-openkal): their toolchain, C library and C++ run-time, tools, compile and link conventions, seal, runner and carrier, as one versioned statement mcpp reads."
license = "Apache-2.0"
authors = ["mcpplibs"]
repo = "https://github.com/mcpplibs/openkal-platform"
mcpp = ">=2026.10.30.1"
[platform]
targets = ["x86_64-openkal", "aarch64-openkal"]
toolchain = "llvm@23.1.3"
# The loader runs an image of its own architecture on Linux, macOS and Windows;
# `hosts` are the systems and architectures openkal-tools builds it for, which is
# where a package that needs it can run (mcpp's `runs_on`).
runner = { cmd = ["okrun", "{}"], host = "same-arch", hosts = ["linux-x86_64", "linux-aarch64", "macos-aarch64", "windows-x86_64"] }
# `mcpp pack --mode self-contained`: a program of the packing machine that
# carries the image in a section and runs it through libokrun (M3).
carrier = { package = "openkal-run@0.1.8", section = ".oke", main = "carrier/main.cpp" }
# The `okb` package format (`mcpp pack --pkg-format okb`): the images of every
# architecture as one file okrun runs (openkal-image docs/okb.md).
plugin = "build.mcpp"
# The C library and the C++ run-time inside an image. A package of the graph
# that provides a layer takes its place (`provides`), and `false` leaves it out.
[platform.layers]
compiler-runtime = "openkal-llvm-runtime@0.16.13"
"c++-abi" = "openkal-llvm-runtime@0.16.13"
c-abi = { name = "openkal-musl", version = "0.24.0", default-features = false, features = ["posix"] }
# Built for the building machine: `okld` writes and checks the notes, `okrun`
# runs an image.
[platform.tools]
okld = "openkal-tools@0.1.8"
okrun = "openkal-tools@0.1.8"
# Every unit of an image (SPEC 12.2):
# -fPIC the image is ET_DYN and has no text relocation;
# -femulated-tls a variable is found through `__emutls_get_address`, which
# the image supplies: one system does not let a program set
# the thread pointer, another does not let it change it;
# -fvisibility=hidden
# an image exports what its source marks
# `visibility("default")`, so the link can drop what
# nothing reaches and the requirements note names only the
# interfaces the program uses;
# -fasynchronous-unwind-tables
# every frame, C's included, can be unwound: a C++
# exception crosses the unwinder's own C and the C library's;
# -Xclang -fstack-clash-protection
# a frame larger than a page is probed page by page, as one
# system commits a thread's stack as its guard is touched;
# -ffunction-sections -fdata-sections
# each function and object in a section of its own, so the
# link's `--gc-sections` discards what nothing reaches at
# that grain, not at a translation unit's.
[platform.build]
cflags = ["-fPIC", "-femulated-tls", "-fvisibility=hidden", "-fasynchronous-unwind-tables", "-Xclang", "-fstack-clash-protection", "-ffunction-sections", "-fdata-sections"]
cxxflags = ["-fPIC", "-femulated-tls", "-fvisibility=hidden", "-fasynchronous-unwind-tables", "-Xclang", "-fstack-clash-protection", "-ffunction-sections", "-fdata-sections"]
asmflags = ["-fPIC", "-femulated-tls", "-fvisibility=hidden", "-fasynchronous-unwind-tables", "-Xclang", "-fstack-clash-protection"]
# AArch64: two systems reserve the platform register, and the outlined atomic
# helpers read the processor's features through an operating system's interface.
[platform.build.'cfg(arch = "aarch64")']
cflags = ["-ffixed-x18", "-mno-outline-atomics"]
cxxflags = ["-ffixed-x18", "-mno-outline-atomics"]
asmflags = ["-ffixed-x18", "-mno-outline-atomics"]
# The link, by `ld.lld` itself: position-independent, every loadable segment
# aligned to 64 KiB (the largest protection granularity among the systems),
# bound now, no executable stack, both hash tables, what nothing reaches
# discarded, identical functions whose address nothing takes folded into one,
# and the unwind index an unwinder finds through `dl_iterate_phdr`.
# An executable image is entered at `ok_main`, which its C library defines; its
# notes come from `okld note-source`; `okld note` writes its requirements and
# `okld check` accepts it, against the images it needs, before it is published.
[platform.link]
driver = "lld"
start = "ok_main"
flags = ["-shared", "-z", "max-page-size=65536", "-z", "now", "-z", "noexecstack",
"--hash-style=both", "--gc-sections", "--icf=safe", "--eh-frame-hdr"]
inputs = [{ from = ["okld", "note-source"], as = "ok-notes.S" }]
exe = "{name}.oke"
shared = "lib{name}.okso"
seal = [["okld", "note", "{}"], ["okld", "check", "{}", "--with", "{needed}"]]
# A host triple selecting this platform (`x86_64-linux-gnu`, `aarch64-macos`,
# `x86_64-windows-gnu`) takes the same C library and C++ run-time over the
# system's openkal implementation, compiled by the same toolchain.
[platform.hosted]
# On Windows the arrangement is the GNU ABI's (or musl's) row: a C library of the
# graph and libc++ above it are not the MSVC runtime's.
targets = ["x86_64-linux-gnu", "aarch64-linux-gnu", "x86_64-linux-musl", "aarch64-linux-musl",
"x86_64-macos", "aarch64-macos", "x86_64-windows-gnu", "x86_64-windows-musl"]
toolchain = "llvm@23.1.3"
[platform.hosted.layers]
compiler-runtime = "openkal-llvm-runtime@0.16.13"
"c++-abi" = "openkal-llvm-runtime@0.16.13"
c-abi = { name = "openkal-musl", version = "0.24.0", default-features = false, features = ["posix"] }
# The family released together for openkal 0.17 (the 0.17.2 round: okb, the
# runner's bundle and library interfaces, musl's renameat2; the 0.17.3 round:
# musl takes a program's arguments when it is entered; the 0.18.0 round: a
# directory handle names and does not read, musl leaves C++ its `restrict';
# openkal 0.18: openkal.map, musl's mmap of a file, okrun maps what it runs;
# 0.19.1: okrun releases the file it ran once the image is loaded, and digests
# on the processor's SHA-256 instructions; 0.19.2: on Linux aarch64 too, where
# the processor states them; openkal 0.19 (0.20.0): the physical cores and a
# context's claim on the processors, getpid as the environment's identifier,
# flock, and okb chunk digests verified in parallel):
# one version of each in a build (their pins are exact).
[platform.versions]
openkal = "0.19.0"
openkal-linux = "0.20.0"
openkal-macos = "0.17.0"
openkal-windows = "0.15.0"
openkal-musl = "0.24.0"
openkal-llvm-runtime = "0.16.13"
openkal-ld = "0.1.8"
openkal-run = "0.1.8"
openkal-tools = "0.1.8"
# The plugin's tool, `okld bundle`, which writes the okb, and its library, the
# provider of a package format (mcpp.plugins.platform).
[build-dependencies]
openkal-tools = { version = "0.1.8", tools = ["okld"] }
[build-dependencies.mcpp]
plugins = { version = "0.20.0", features = ["plugins-platform"], host-module = true }