feat(openkal): 0.5.2 —— 冻结布局的断言此前只描述了 64 位 - #234
Merged
Conversation
`kal_node_info` 的断言写的是 `offsetof(modified_ns) == sizeof(kal_uintptr)`, 在 64 位上成立、在 32 位上不成立:`modified_ns` 是自然对齐的 `kal_u64`, 4 字节的 `size` 之后补 4 字节填充,偏移仍停在 8。 0.5.2 改成 `== 8`,与指针宽度无关——那正是冻结布局想要的性质——并一并断言 `sizeof(kal_node_info) == 24`(两种宽度同样成立)。⚠️ openkal 自己的 CI 在结构上发现不了它:那里每一行都是宿主构建,而宿主 全是 64 位。缺陷在**消费者**处暴露(`mcpplibs/riscv-virt-rt` 的 rv32 腿), 那是 32 位布局唯一被实例化的地方。0.5.2 因此补了一条 rv64/rv32 两个目标的 只编译 ABI 检查。 两端逐字节核验一致。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
kal_node_info的断言写的是offsetof(modified_ns) == sizeof(kal_uintptr),在 64 位上成立、在 32 位上不成立:modified_ns是自然对齐的kal_u64,4 字节的size之后补 4 字节填充,偏移仍停在 8。0.5.2 改成
== 8,与指针宽度无关——那正是冻结布局想要的性质。riscv-virt-rt的 rv32 腿),那是 32 位布局唯一被实例化的地方。0.5.2 补了一条 rv64/rv32 的只编译 ABI 检查。两端镜像逐字节核验一致(sha256 相同)。