@@ -17,6 +17,38 @@ repo = "https://github.com/mcpplibs/openkal-llvm-runtime"
1717# declared here and read there.
1818provides = [" hosted-standard-library" ]
1919
20+ # Where this package's `std' module source is, and what it needs.
21+ #
22+ # The build tool otherwise asks the compiler (`-print-library-module-manifest-path'),
23+ # which is the right question when the standard library is the compiler's own
24+ # and the wrong one here: this source was configured for a target the compiler
25+ # knows nothing about, and its configuration is in llvm-generated/ rather than
26+ # beside the compiler.
27+ std-module = " llvm-generated/std.cppm"
28+ std-module-flags = [
29+ # ⚠️ --no-default-config, and it is not tidiness.
30+ #
31+ # The toolchain payload ships a clang++.cfg that names a host C library's
32+ # headers unconditionally. For an ordinary translation unit that is right and
33+ # invisible; for this one it puts a C library that is not the one beneath this
34+ # package first, and the module fails compiling <wchar.h> with names that
35+ # library expects the host compiler to have supplied. Measured.
36+ " --no-default-config" ,
37+ " -nostdinc" ,
38+ " -nostdinc++" ,
39+ # libc++'s locale layer reaches for names musl declares only under this macro
40+ # (vasprintf, strtof_l and their relatives). LLVM's own runtimes build defines
41+ # it for the same reason. It is stated here rather than left to the target
42+ # block, because that block describes how this package's own sources are
43+ # compiled and the module is compiled separately.
44+ " -D_GNU_SOURCE" ,
45+ # The module source is one file that includes ninety-odd fragments by
46+ # relative name. They are upstream's and unmodified, so they stay where
47+ # upstream put them and the search path names that directory rather than the
48+ # fragments being copied next to the configured source.
49+ " -I" , " llvm/libcxx/modules" ,
50+ ]
51+
2052# The C library beneath. A C++ standard library is not portable in the sense a
2153# program is: it is configured for one C library and compiled against that
2254# library's headers, and the configuration is what this package supplies. The
0 commit comments