静态链接的gcc [英] Statically linked 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屋!