Error compiling binutils

Home Forums Forum Error compiling binutils

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

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

    Hanxue

    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
    [-Werror,-Wdeprecated-declarations]
    char *lim = (char *) sbrk (0);
    ^
    /usr/include/unistd.h:582:7: note: ‘sbrk’ declared here
    void *sbrk(int);
    ^

    Full output at https://gist.github.com/hanxue/7802316

    Is there any way around this?

    #667

    rich
    Keymaster

    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. 😉

    #687

    rich
    Keymaster

    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.

    #1634

    Dave

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

    Thanks

    #1635

    rich
    Keymaster

    Dave,

    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.

    -Rich

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

You must be logged in to reply to this topic.