静态链接的gcc [英] Statically linked gcc

查看:98
本文介绍了静态链接的gcc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何方法可以构建静态链接的gcc编译器?如果是,我应该使用哪些标记configure/make?我希望得到gcc和g ++二进制文件 应该是不是动态可执行文件"(使用ldd检查时) 工具).

Is there any method to build statically linked gcc compiler? If yes, what flags of configure/make should I use? I expect getting gcc and g++ binary files which should be "not a dynamic executable" (while checking with ldd tool, for example).

推荐答案

禁用所有共享选项是一个好的开始.然后使用可以使用--with-stage1-ldflags--with-boot-ldflags将链接器标志设置为静态链接. – 一些程序员哥们

Disabling all shared options is a good start. Then using e.g. --with-stage1-ldflags and --with-boot-ldflags to set linker flags to link statically could be used. – Some programmer dude

成功了!这是用于配置的标志:

It worked! Here is used configure flags:

../configure --prefix=/home/myuser/soft/gcc-6.2.0/myusr/ --enable-multilib --enable-languages=c,c++ --disable-shared --disable-host-shared --with-boot-ldflags=-static --with-stage1-ldflags=-static

–  AccumPlus

– AccumPlus

这篇关于静态链接的gcc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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