arm-linux-androideabi-gcc与arm-linux-gnueabihf-gcc的一些差别

本文探讨了使用arm-linux-gnueabihf-gcc和arm-linux-androideabi-gcc在Android上进行静态编译时遇到的问题,包括getpwnam函数缺失、静态链接库的大小和复杂性、以及Android对某些库的支持情况。文章通过实例分享了编译nginx和openssl的经验,指出静态编译时需要针对Android环境修改代码、配置编译选项,以及解决静态链接curl时的限制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

想在手机上做一些工作,但不是很想用android 的不开源的东西。所以编译工具arm-linux-gnueabihf-gcc,这个在用static编译选项时对多数程序,除编出来的有点大外都是可用的。但对getpwnam等.

Is linking statically (or: bundling all the libraries you need with your software) a solution? Even if it works technically, the associated costs might be to high. So unfortunately, the answer is probably no either.

  • Security: you shift the responsibility to update the libraries from the user of your software to yourself.

  • Size and complexity: just for fun try to build a statically linked GUI program.

  • Interoperability: if your software is a "plugin" of any kind, you depend on the software which calls you.

  • Library design: if you link your program statically to GNU libc and use name services (getpwnam() etc.), you end up linked dynamically against libc's NSS (name service switch).

  • Library design: the library you link your program s

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值