make inflate work with gcc3.5 and 4k stacks
PATCH 1/1 make inflate work with gcc3.5 and 4k stacks
Quick fix to work around gcc3.5's automatic inline and broken stack requirements calculation. Without this, I see stack overflows at boot with 4k stacks.
gcc3.5 - fix inflate inlining
tiny-mpm/lib/inflate.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
lib/inflate.c renamed from lib/inflate.c~inflate-noinline +2 -2
@@ -686,7 +686,7 @@ DEBG("<stor"); -STATIC int inflate_fixed(void) +STATIC int noinline inflate_fixed(void)/* decompress an inflated type 1 (fixed Huffman codes) block. We should either replace this with a custom decoder, or at least precompute the Huffman tables. */
@@ -740,7 +740,7 @@ DEBG("<fix"); -STATIC int inflate_dynamic(void) +STATIC int noinline inflate_dynamic(void)/* decompress an inflated type 2 (dynamic Huffman codes) block. */ {int i;/* temporary variables */
_
Signature · 1 line
Matt Mackall : http://www.selenic.com : Linux development and consulting
Quoted 9 lines · Matt Mackall
Quick fix to work around gcc3.5's automatic inline and broken stack
requirements calculation. Without this, I see stack overflows at boot with 4k stacks.gcc3.5 - fix inflate inlining
-STATIC int
inflate_fixed(void)
+STATIC int noinlineinflate_fixed(void)
Thanks. I added appropriate comments to this, as one should always do when adding otherwise-utterly-mystifying code.