如何增加gcc可执行栈的大小? [英] How to increase the gcc executable stack size?
本文介绍了如何增加gcc可执行栈的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何增加gcc的堆栈大小,所以我可以编译这个程序?
注意:没有无限递归,但是有足够的附带递归用于排空gcc的堆栈。
解决方案
在Linux上,您可以在/etc/security/limits.conf中扩展堆栈大小。
当前堆栈大小
$ ulimit -s
8192
然后展开堆栈,使其倍增:
youruser软堆栈16384
然后重新登录。
这将增加您正在运行的所有可执行文件的堆栈大小,而不仅仅是GCC的。
I have large Boost/Spirit metaprogram that is blowing gcc's stack when I try to compile it.
How can I increase gcc's stack size, so I can compile this program?
Note: There's no infinite recursion going on, but there is enough incidental recursion to exhaust gcc's stack.
解决方案
On Linux, you can expand the stack size in /etc/security/limits.conf.
You can check your current stack size by using
$ ulimit -s
8192
Then expand the stack to be double than that:
youruser soft stack 16384
And then relog.
This will increase stack size for all executable you're running, not just GCC's.
这篇关于如何增加gcc可执行栈的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文