From 37002c5a312d4ed63f0c631bcce41ece60e69180 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Mon, 21 Sep 2026 02:50:58 +0800 Subject: [PATCH 1/3] the target is named by mcpp, not borrowed from Cygwin `bits/setjmp.h` sizes `jmp_buf` by whether the target is Windows, because that decides the calling convention. It asked `__CYGWIN__`, which answered correctly only by accident: mcpp kept that name defined because nothing else named the target, while upstream code reads it as "Win32 is available" --- a 30-member measurement found four packages doing exactly that and reaching `#include `. A BORROWED NAME MEANS WHAT THE LENDER'S HISTORY MADE IT MEAN. mcpp 2026.9.21.1 states the fact under its own name, `__mcpp_target___`, for every target. This header reads that first and still accepts `__CYGWIN__`, so it is correct on an engine from either side of that release --- the new name is absent before it, the old one is withdrawn after a later one. The second operand is there so this file has no flag day, not for redundancy, and goes once the withdrawal ships. VERIFIED BY A CRITERION THAT FAILS ON THE OLD HEADER. A translation unit asserting `sizeof(jmp_buf) >= 32 * sizeof(unsigned long long)`, built for `x86_64-windows-gnu` with `-U__CYGWIN__ -U__CYGWIN32__` to simulate the withdrawal: published 0.18.0 static assertion failed: did not take the Windows branch this branch passes The failing side is what this change is for, and it is the silent kind: the old header falls to `#include_next` and produces a SHORT record, which this file's own comment describes as "a mismatch nothing reports until the record overruns". An earlier run of the same simulation without the assertion reported success, because a short `jmp_buf` compiles and links perfectly well. --- port/include/bits/setjmp.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/port/include/bits/setjmp.h b/port/include/bits/setjmp.h index b882bdd..7bdf0ce 100644 --- a/port/include/bits/setjmp.h +++ b/port/include/bits/setjmp.h @@ -44,7 +44,23 @@ #ifndef OKM_BITS_SETJMP_H #define OKM_BITS_SETJMP_H -#if defined(__CYGWIN__) && defined(__x86_64__) +/* `__mcpp_target_windows__` FIRST, `__CYGWIN__` STILL ACCEPTED (mcpp + * 2026.9.21.1). The question this file asks is "is the target Windows", + * because that decides the calling convention and so the size of the record + * below. `__CYGWIN__` answered it only by accident: mcpp kept the name + * defined because nothing else named the target, and upstream code reads it + * as "Win32 is available" --- a 30-member measurement found four packages + * doing exactly that and reaching `#include `. A BORROWED NAME + * MEANS WHAT THE LENDER'S HISTORY MADE IT MEAN. + * + * mcpp now states the fact itself, for every target and under its own name + * (`docs/21`, "The macros mcpp defines"). Both are accepted here so that this + * header is correct on an engine from either side of that release: the new + * name is absent before 2026.9.21.1, and the old one is withdrawn after a + * later release. Once that withdrawal ships, the second operand may go --- it + * is not there for redundancy, it is there so this file has no flag day. */ +#if (defined(__mcpp_target_windows__) || defined(__CYGWIN__)) \ + && defined(__x86_64__) /* eight general registers, the stack pointer, the resumption address, and ten * vector registers of sixteen bytes each: thirty machine words, rounded up. */ typedef unsigned long long __jmp_buf[32]; From e7b8951a4d88280c127d8f7daaaa1dffc8ac5833 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Mon, 21 Sep 2026 03:03:50 +0800 Subject: [PATCH 2/3] 0.19.0 The header change in this branch is what the version names: `bits/setjmp.h` reads mcpp's own name for the target and still accepts the borrowed one, so that a later mcpp release may withdraw `__CYGWIN__` without this package falling silently to a shorter record. Backward compatible in both directions by construction. On the engine published today the new name is absent and the old operand answers; on 2026.9.21.1 both are present. Neither ordering of the two releases breaks a build, which is the property the three-step sequence exists to hold. --- mcpp.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcpp.toml b/mcpp.toml index c0b95ae..cf28078 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -1,7 +1,7 @@ [package] namespace = "mcpplibs" name = "openkal-musl" -version = "0.18.0" +version = "0.19.0" description = "musl 1.2.5 redirected onto openkal: one C library, ported once, above every implementation of the specification rather than above one kernel." license = "Apache-2.0" From 5269f4df8e274960862b917b1d9cec7666294b28 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Mon, 21 Sep 2026 03:39:10 +0800 Subject: [PATCH 3/3] the name is upper case, and two operands remove the ordering constraint Project-owned macros are upper case --- `NDEBUG` and every other one are --- while lower case belongs to the compiler's own predefines (`__linux__`), which mcpp supplies but does not own. 2026.9.21.1 spelt it lower; the release that withdraws `__CYGWIN__` renames it in the same change, so this header is written against the spelling it will keep. THE LOWER-CASE NAME IS NOT READ HERE AND DOES NOT NEED TO BE. It existed for one release and nothing consumed it. Two operands cover every engine: one up to and including 2026.9.21.1 defines `__CYGWIN__`, and the one that withdraws it defines `__MCPP_TARGET_WINDOWS__`. No engine defines neither, so this header has no flag day and the two releases may land in either order --- which is the point of the second operand, not redundancy. It goes once the withdrawal has shipped. --- port/include/bits/setjmp.h | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/port/include/bits/setjmp.h b/port/include/bits/setjmp.h index 7bdf0ce..57aca11 100644 --- a/port/include/bits/setjmp.h +++ b/port/include/bits/setjmp.h @@ -44,8 +44,9 @@ #ifndef OKM_BITS_SETJMP_H #define OKM_BITS_SETJMP_H -/* `__mcpp_target_windows__` FIRST, `__CYGWIN__` STILL ACCEPTED (mcpp - * 2026.9.21.1). The question this file asks is "is the target Windows", +/* `__MCPP_TARGET_WINDOWS__` FIRST, `__CYGWIN__` STILL ACCEPTED. + * + * The question this file asks is "is the target Windows", * because that decides the calling convention and so the size of the record * below. `__CYGWIN__` answered it only by accident: mcpp kept the name * defined because nothing else named the target, and upstream code reads it @@ -54,12 +55,23 @@ * MEANS WHAT THE LENDER'S HISTORY MADE IT MEAN. * * mcpp now states the fact itself, for every target and under its own name - * (`docs/21`, "The macros mcpp defines"). Both are accepted here so that this - * header is correct on an engine from either side of that release: the new - * name is absent before 2026.9.21.1, and the old one is withdrawn after a - * later release. Once that withdrawal ships, the second operand may go --- it - * is not there for redundancy, it is there so this file has no flag day. */ -#if (defined(__mcpp_target_windows__) || defined(__CYGWIN__)) \ + * (`docs/21`, "The macros mcpp defines"). + * + * TWO OPERANDS COVER EVERY ENGINE, AND THE ORDER OF RELEASES DOES NOT MATTER. + * An engine up to and including 2026.9.21.1 defines `__CYGWIN__`, which + * answers; the release that withdraws it defines `__MCPP_TARGET_WINDOWS__`, + * which answers instead. There is no engine that defines neither, so this + * header has no flag day and the two releases may land in either order. + * + * 2026.9.21.1 spelt the name in lower case. It is not read here and does not + * need to be: that spelling existed for one release, nothing consumed it, and + * the release that withdraws `__CYGWIN__` renames it in the same change --- + * project-owned macros are upper case, as `NDEBUG` and every other are, while + * lower case belongs to the compiler's own predefines (`__linux__`), which + * mcpp supplies but does not own. The second operand is not redundancy; it is + * what removes the ordering constraint, and it goes once the withdrawal has + * shipped. */ +#if (defined(__MCPP_TARGET_WINDOWS__) || defined(__CYGWIN__)) \ && defined(__x86_64__) /* eight general registers, the stack pointer, the resumption address, and ten * vector registers of sixteen bytes each: thirty machine words, rounded up. */