feat(pkg): 新增 compat.gmp —— GNU GMP 6.3.0 静态库(install() 驱动,linux/macOS) - #194
Merged
Conversation
- pkgs/c/compat.gmp.lua:xpkg install() 钩子跑上游 configure && make && make install, 产出 libgmp.a + include/gmp.h(--disable-assembly 通用 C 内核,--libdir 绝对路径)。 - tests/examples/gmp/:mpz/mpq/mpf 三层算术断言,cfg(linux)/cfg(macos) 门控,其他平台 no-op。 - windows 推迟:GMP 无 MSVC 构建路径;镜像待 mcpp-res 权限后补,当前纯字符串上游 url。 - 本地验证:mcpp 2026.8.8.2 macOS arm64 冷启动全流程通过;lint 8 项全过。 - 关联 issue mcpplibs#171。
linux default 腿 CI 实测失败:configure 报 could not find a working compiler。 GMP 的 configure 会编译并运行 ABI 探针、make 期运行 gen-* 工具,链接到 xim glibc payload(--sysroot/-B/-L)的这类可执行文件在本钩子环境无法运行;openssl 的 Configure 只写 Makefile 所以无此问题。改 /usr/bin/gcc 后探针/工具跑宿主 glibc, 静态库符号由消费端工具链更新的 payload glibc 在最终链接时满足。
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.
Closes #171
变更内容
pkgs/c/compat.gmp.lua—— 新增compat.gmp(GNU GMP 6.3.0):C 源码库走 xpkginstall()钩子模式(同compat.openssl/compat.openblas),钩子内跑上游configure && make && make install产出静态libgmp.a+include/gmp.h。tests/examples/gmp/—— 消费成员:mpz(100! / 2^1000 mod 12345 / gcd)+ mpq(1/2+1/3)+ mpf(sqrt2)断言,参考值由 Python 独立预计算;cfg(linux)/cfg(macos)门控,其他平台 no-op main。mcpp.toml注册成员;README(EN/ZH)参考示例表补充;设计文档.agents/docs/2026-08-09-add-gmp-plan.md。关键决策
--disable-shared --enable-static --disable-assembly(可移植通用 C 内核);--libdir为绝对路径(GMP configure 拒绝相对值)。/usr/bin/gcc、macOS/usr/bin/cc。GMP 的 configure 会编译并运行 ABI 探针、make要运行 gen-* 构建工具,链接到 xim glibc payload 的这类可执行文件无法在本钩子环境运行(linux CI 首轮实测could not find a working compiler);静态库的 glibc/libm 符号由消费端工具链更新的 payload glibc 在最终链接时满足。mcpp-res写权限 → 纯字符串上游 url(ftp.gnu.org 权威 tarball),lint 合规,维护者后续可补 CN。验证
test result ok. 1 passed; 0 failed;lint 8 项全过。mirror-cn-reachable:既有 opencv 5.0.0 CN 资产(origin/main 上已存在,本 PR 未触碰 pkgs/o/)被 gitcode 返回 403,与本次改动无关。