V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
ebi5oowiiy1llo

写了一个 rust 能用所有 libc+kernel structure 的 dlibc

  •  
  •   ebi5oowiiy1llo · Aug 8, 2025 · 1199 views
    This topic created in 267 days ago, the information mentioned may be changed or developed.

    写 rust 的时候,要是用 libc 开发一些底层的东西,不是缺这就是缺那,给 libc 贡献代码时间长又累

    为此写了一个从系统头文件用 Bindgen 动态生成 binding 的包

    https://github.com/qinghon/dlibc.git

    当然也有些缺点:

    • 需要有头文件,不过用上了 Bindgen 依赖里会带上 clang
    • 跨平台编译比较麻烦, 需要设置头文件目录

    最近还在研究 zig 的跨平台编译方式,看看能不能也融入到这里面解决跨平台编译链接问题

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2352 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 04:25 · PVG 12:25 · LAX 21:25 · JFK 00:25
    ♥ Do have faith in what you're doing.