error: 'sbrk' is deprecated

Asked by naren

I am building the gcc-arm-none-eabi-4_9-2014q4-20141203 from source and am facing a problem when I run ./build-toolchain.sh

The error that occurs is as follows:

....../gcc-arm-none-eabi-4_9-2014q4-20141203/src/binutils/gas/as.c:977:24: error: 'sbrk' is deprecated
      [-Werror,-Wdeprecated-declarations]
  char *lim = (char *) sbrk (0);
                       ^
/usr/include/unistd.h:582:7: note: 'sbrk' has been explicitly marked deprecated here
void *sbrk(int);
         ^

I am using Mac OS X 10.9.5. How can I correct this error?

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Tony Liu
Solved:
Last query:
Last reply:
Revision history for this message
Best Tony Liu (mrtoniliu) said :
#1

Hi Naren,

Could you try to add the option "--disable-werror" in the binutils configuration part in the build-toolchain.sh? You can find the binutils config options around line 240 to 250 in build-toolchain.sh .

Tony

Revision history for this message
naren (narenvasanad) said :
#2

This fix helped! Thanks. However I ran into another issue:

fatal error:
      bracket nesting level exceeded maximum of 256

I saw on other posts that I need to add "-fbracket-depth" to the configure but I'm not sure where I could do this. Could you help me here?

Revision history for this message
naren (narenvasanad) said :
#3

Thanks Tony Liu, that solved my question.

Revision history for this message
Tony Liu (mrtoniliu) said :
#4

Hi,

I've searched online, it seems this problem is caused by the clang in OS X. As the clang is not yet fully tested to build this toolchain, I'd suggest you to use gcc instead of clang to build this toolchain.

The possible way is:

Use Homebrew ( http://brew.sh/ ) to install a gcc.
Check the system will use real gcc instaed of clang ( you can use " gcc -v " to check ).
Then build the toolchain.

Tony