Error compiling binutils

Home Forums Forum Error compiling binutils

This topic contains 4 replies, has 2 voices, and was last updated by  rich 10 years, 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #611


    Hello Rich,

    I have checked out the svn source, and run ./build, with the following result:

    gcc -DHAVE_CONFIG_H -I. -I../../../src/binutils/binutils -I. -I../../../src/binutils/binutils -I../bfd -I../../../src/binutils/binutils/../bfd -I../../../src/binutils/binutils/../include -I./../intl -DLOCALEDIR=”\”/Library/Caches/Homebrew/ellcc–svn-HEAD/lib/share/locale\”” -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -Wno-unused-value -Wno-shadow -MT nm.o -MD -MP -MF .deps/nm.Tpo -c -o nm.o ../../../src/binutils/binutils/nm.c
    ../../../src/binutils/binutils/nm.c:1690:28: error: ‘sbrk’ is deprecated
    char *lim = (char *) sbrk (0);
    /usr/include/unistd.h:582:7: note: ‘sbrk’ declared here
    void *sbrk(int);

    Full output at

    Is there any way around this?



    This error is occurring because sbrk() is deprecated on OSX, -Werror is enabled for the binutils build, and the compiler (in this case “gcc” is an alias for clang) rightly complains about the use of sbrk(). I’ll be looking into eliminating this error this weekend when I won’t have to be at my day job. 😉



    I looked into it a bit more. This happened because the latest version of OS X (Mavericks) uses clang as its compiler and /usr/include/unistd.h has a deprecated declaration of sbrk().

    The solution was to add a -Wno-error=deprecated-declarations option to the CFLAGS for binutils. I also had to make a few other changes to complete the Max OS build. You can find the latest stuff in the ELLCC subversion tree.



    How does one add a -Wno-error=deprecated-declarations option to the CFLAGS for binutils?





    I lost custody of the Mac I was using due to personal reasons about a month and a half ago. Until I can get a replacement, I’ll have to wing it.

    For some reason, I lost the change that I has made to add the option to the Mac. Those were fairly tumultuous times, I suspect I forgot to push the changes back to the source repository.

    As I recall though, I added the option to line 11636 of ellcc/gnu/src/binutils/binutils/configure.

    This is only required because of the sbrk() call in line 1698 of nm.c.

    I hope that helps.


Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.