Error building ELLCC
binutils, clang, cross-compiling, ellcc, macos
Solution
I had the same issue compiling binutils-2.24 on Mac OSX Mavericks 13.2.0 with clang. Thanks to Richard Pennington's suggestion, I was able to get binutils to compile by specifying a few other `-Wno-error` arguments to gcc by setting `CFLAGS` before running `configure`. Namely, these are the commands I ran to build and install binutils:
CFLAGS="-Wno-error=deprecated-declarations -Wno-error=unused-variable -Wno-error=unused-function" ./configure --prefix=/usr/local/toolchain-arm-linux-elf --target=arm-linux-elf
make
make install
EDIT: I just noticed that the binutils configure script accepts an `--disable-werror` argument, which disables gcc turning warnings into errors, and removes the need for the settings `CFLAGS`. With this argument, building could be done as follows:
./configure --prefix=/usr/local/toolchain-arm-linux-elf --target=arm-linux-elf --disable-werror
make
make install
Problem
Running the `build` script from ELLCC results in this error ``` 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); ^ ``` The following compilers have been used with the same result: - gcc 4.8 - llvm-gcc 2.8 - llvm 3.3