Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bracket nesting level exceeded maximum of 256 on macOS #59

Closed
kinosang opened this issue Feb 14, 2017 · 7 comments
Closed

bracket nesting level exceeded maximum of 256 on macOS #59

kinosang opened this issue Feb 14, 2017 · 7 comments

Comments

@kinosang
Copy link

kinosang commented Feb 14, 2017

While run build_toolchain.sh, it failed with bracket nesting level exceeded maximum of 256.

#define ATTRIBUTE_ASM_FPRINTF(m, n) __attribute__ ((__format__ (__asm_fp...
                                                    ^
../../gcc-6.2.0/gcc/config/arm/thumb1.md:1615:10873: fatal error: bracket
      nesting level exceeded maximum of 256
../../gcc-6.2.0/gcc/config/arm/thumb1.md:1615:10873: note: use -fbracket-depth=N
      to increase maximum nesting level

I tried to add -fbracket-depth=512 into CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET in build_toolchain.sh, but not works.

macOS Sierra 10.12.3
Homebrewed gcc-arm-none-eabi (px4/px4/gcc-arm-none-eabi: stable 20160928)
clang --version Apple LLVM version 8.0.0 (clang-800.0.42.1)

@Vogtinator
Copy link
Contributor

What's your host toolchain version?

I tried to add -fbracket-depth=512 into CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET in build_toolchain.sh, but not works.

That's the wrong place, you need to add it to CFLAGS.

@kinosang
Copy link
Author

kinosang commented Feb 14, 2017

system information updated in the first comment.

I didn't find where to add the CFLAGS

@adriweb
Copy link
Contributor

adriweb commented Feb 14, 2017

This is actually a known issue with clang, you can add it in the GCC make commands of the "Building GCC" steps of build_toolchain.sh.
It should look like this: [...] && make $PARALLEL CXXFLAGS="-fbracket-depth=512" all-gcc && [...]
You should also remove the GDB's --with-python (at least last time I checked, which is quite a bit ago, but still, it was problematic)

@kinosang
Copy link
Author

@adriweb not work for me.
still show the error

...
../../gcc-6.2.0/gcc/config/arm/thumb1.md:1615:10873: fatal error: bracket
      nesting level exceeded maximum of 256
../../gcc-6.2.0/gcc/config/arm/thumb1.md:1615:10873: note: use -fbracket-depth=N
      to increase maximum nesting level
...
11 warnings generated.
9 warnings generated.
9 warnings generated.
9 warnings generated.
38 warnings generated.
47 warnings generated.
49 warnings generated.
rm gcc.pod
make[1]: *** [all-gcc] Error 2
make: *** [all] Error 2

@adriweb
Copy link
Contributor

adriweb commented Feb 15, 2017

I'll try again when I'm back home tonight but considering it was working that way (the updated post, not the initial one), I don't see why it wouldn't anymore...

@kinosang
Copy link
Author

@adriweb thank you very much. I found that there's two step of building gcc and the error is threw by step 2 now. I add the CXXFLAGS to it and it works well now.

The first step looks like [...] && make $PARALLEL CXXFLAGS="-fbracket-depth=512" all-gcc && [...] and the second step looks like [...] && make $PARALLEL CXXFLAGS="-fbracket-depth=512" gcc && [...]

@adriweb
Copy link
Contributor

adriweb commented Mar 2, 2017

Fixed by #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants