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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…