diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b0d5277..c6b8f25f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ ### Added +- **openkal-musl 0.23.0、openkal-llvm-runtime 0.16.10。** openkal-musl 的文件 `mmap`、`munmap`、`msync` 经 + `openkal.map`(偏移按 `KAL_MAP_ALIGNMENT` 向下对齐,区域止于文件末尾);openkal-llvm-runtime 随之移动。测试成员 + `openkal-musl` 观察映射的文件,`openkal` 移到 0.16.10。GLOBAL 为 GitHub 标签归档,CN 为 GitCode `mcpp-res` 镜像, + sha256 两处一致。 - **openkal-ld、openkal-run、openkal-tools、openkal-bind 0.1.5。** okrun 以 `openkal.map`(私有、可写)映射它运行的映像 或 okb,而不是整体读入内存,映像结束时释放;映像绑定 `openkal.map` 的三个函数。四个成员钉 openkal 0.18.0、 openkal-linux 0.19.0、openkal-macos 0.16.0、openkal-windows 0.14.0。测试成员 `openkal-tools`、`openkal-bind` diff --git a/pkgs/o/openkal-llvm-runtime.lua b/pkgs/o/openkal-llvm-runtime.lua index 521e93c5..ac535da4 100644 --- a/pkgs/o/openkal-llvm-runtime.lua +++ b/pkgs/o/openkal-llvm-runtime.lua @@ -75,6 +75,13 @@ package = { xpm = { linux = { + ["0.16.10"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-llvm-runtime/archive/refs/tags/0.16.10.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-llvm-runtime/releases/download/0.16.10/openkal-llvm-runtime-0.16.10.tar.gz", + }, + sha256 = "6f23060d3956c19986ee18a72034017b3f918dbe8c5fe4011b8fad8a3a7b00ba", + }, ["0.16.9"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-llvm-runtime/archive/refs/tags/0.16.9.tar.gz", @@ -371,6 +378,13 @@ package = { }, }, macosx = { + ["0.16.10"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-llvm-runtime/archive/refs/tags/0.16.10.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-llvm-runtime/releases/download/0.16.10/openkal-llvm-runtime-0.16.10.tar.gz", + }, + sha256 = "6f23060d3956c19986ee18a72034017b3f918dbe8c5fe4011b8fad8a3a7b00ba", + }, ["0.16.9"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-llvm-runtime/archive/refs/tags/0.16.9.tar.gz", @@ -667,6 +681,13 @@ package = { }, }, windows = { + ["0.16.10"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-llvm-runtime/archive/refs/tags/0.16.10.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-llvm-runtime/releases/download/0.16.10/openkal-llvm-runtime-0.16.10.tar.gz", + }, + sha256 = "6f23060d3956c19986ee18a72034017b3f918dbe8c5fe4011b8fad8a3a7b00ba", + }, ["0.16.9"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-llvm-runtime/archive/refs/tags/0.16.9.tar.gz", diff --git a/pkgs/o/openkal-musl.lua b/pkgs/o/openkal-musl.lua index e0241d15..86a9ea62 100644 --- a/pkgs/o/openkal-musl.lua +++ b/pkgs/o/openkal-musl.lua @@ -75,6 +75,13 @@ package = { xpm = { linux = { + ["0.23.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-musl/archive/refs/tags/0.23.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-musl/releases/download/0.23.0/openkal-musl-0.23.0.tar.gz", + }, + sha256 = "d2238aef42b4155d23aa87431d3c344fafcba78446473499bb9b1472f9d31a87", + }, ["0.22.9"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-musl/archive/refs/tags/0.22.9.tar.gz", @@ -385,6 +392,13 @@ package = { }, }, macosx = { + ["0.23.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-musl/archive/refs/tags/0.23.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-musl/releases/download/0.23.0/openkal-musl-0.23.0.tar.gz", + }, + sha256 = "d2238aef42b4155d23aa87431d3c344fafcba78446473499bb9b1472f9d31a87", + }, ["0.22.9"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-musl/archive/refs/tags/0.22.9.tar.gz", @@ -695,6 +709,13 @@ package = { }, }, windows = { + ["0.23.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-musl/archive/refs/tags/0.23.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-musl/releases/download/0.23.0/openkal-musl-0.23.0.tar.gz", + }, + sha256 = "d2238aef42b4155d23aa87431d3c344fafcba78446473499bb9b1472f9d31a87", + }, ["0.22.9"] = { url = { GLOBAL = "https://github.com/mcpplibs/openkal-musl/archive/refs/tags/0.22.9.tar.gz", diff --git a/tests/examples/openkal-musl/mcpp.toml b/tests/examples/openkal-musl/mcpp.toml index 4789e50e..8cccf1f7 100644 --- a/tests/examples/openkal-musl/mcpp.toml +++ b/tests/examples/openkal-musl/mcpp.toml @@ -8,7 +8,7 @@ name = "openkal-musl-tests" version = "0.1.0" [target.'cfg(os = "linux")'.dependencies.mcpplibs] -openkal-musl = "0.22.9" +openkal-musl = "0.23.0" [target.'cfg(os = "linux")'.build] cxxflags = ["-DHAVE_OPENKAL_MUSL=1"] diff --git a/tests/examples/openkal-musl/tests/reports.cpp b/tests/examples/openkal-musl/tests/reports.cpp index d953b0ea..af793ebe 100644 --- a/tests/examples/openkal-musl/tests/reports.cpp +++ b/tests/examples/openkal-musl/tests/reports.cpp @@ -1,6 +1,6 @@ /* The reporters' programs, above openkal-musl. Elsewhere this compiles to a * main() that reports nothing, because the member names the port for Linux - * alone. */ + * alone. And (0.23) a file mapped with mmap. */ #ifndef HAVE_OPENKAL_MUSL int main(void) { return 0; } #else @@ -10,6 +10,7 @@ int main(void) { return 0; } #include #include #include +#include #include #include @@ -45,6 +46,18 @@ int main(void) { static char region[1 << 20]; pthread_attr_setstack(&attr, region, sizeof region); check(pthread_create(&t, &attr, body, &depth) == EINVAL, "a stack the caller supplies is refused"); + /* 0.23: mmap of a file is openkal.map's; the bytes after the end in the last page are zero. */ + int fd = open("okm.map", O_RDWR | O_CREAT | O_TRUNC, 0644); + if (fd >= 0 && write(fd, "mapped", 6) == 6) { + const char* p = (const char*)mmap(NULL, 6, PROT_READ, MAP_PRIVATE, fd, 0); + check(p != MAP_FAILED, "a file is mapped"); + if (p != MAP_FAILED) { + check(p[0] == 'm' && p[5] == 'd' && p[6] == 0, "the region holds the file's bytes and zero after its end"); + check(munmap((void*)p, 6) == 0, "the region is released"); + } + } + if (fd >= 0) close(fd); + unlink("okm.map"); return failures != 0; } #endif diff --git a/tests/examples/openkal/mcpp.toml b/tests/examples/openkal/mcpp.toml index f7ceadd3..bd007b1c 100644 --- a/tests/examples/openkal/mcpp.toml +++ b/tests/examples/openkal/mcpp.toml @@ -30,7 +30,7 @@ openkal-macos = "0.16.0" openkal-windows = "0.14.0" [target.'cfg(all(os = "linux", env = "musl"))'.dependencies.mcpplibs] -openkal-llvm-runtime = "0.16.9" +openkal-llvm-runtime = "0.16.10" [target.'cfg(arch = "wasm32")'.dependencies.mcpplibs] openkal-emscripten = "0.6.0"