链接glibc的静态,但其他一些与海湾合作委员会动态库 [英] Link glibc statically but some other library dynamically with GCC

查看:163
本文介绍了链接glibc的静态,但其他一些与海湾合作委员会动态库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要静态链接glibc的到我的项目,因为目标平台只支持一个很旧的(但它与静态链接glibc的作品从我的工具链,我已签吧)

不幸的是,此应用程序有权使用pthread库,但静态链接的libpthread需要太多的地方。

我想静态链接glibc的,动态的pthread。

运行这个命令之后

  PowerPC的未知Linux的GNU-GCC object_files -lrt -lpthread -Wl,-Bstatic -lc

我得到:

  / PowerPC的未知Linux的GNU /斌/劳工处:找不到-lgcc_s


解决方案

有一个 -static-libgcc中如果这可以帮助

I need to statically link glibc to my project, because the target platform supports only a very old one ( but it works with statically linked glibc from my toolchain, I have checked it)

Unfortunately, this application has to make use of pthread library, but statically linked libpthread takes too much place.

I would like to statically link glibc, and dynamically pthread.

After running this command

powerpc-unknown-linux-gnu-gcc object_files -lrt -lpthread -Wl,-Bstatic -lc 

I get:

/powerpc-unknown-linux-gnu/bin/ld: cannot find -lgcc_s

解决方案

There is a -static-libgcc if that may help

这篇关于链接glibc的静态,但其他一些与海湾合作委员会动态库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆