binutils build fails on Mac OS X 10.9 Mavericks

Bug #1254507 reported by Christopher Wilson on 2013-11-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Undecided
Terry Guo

Bug Description

I'm following the How-to-build-toolchain.pdf guide on Mac OS X 10.9 Mavericks and I'm hitting an error I'm not sure how to resolve. Not sure if it's a bug or something I'm doing wrong.

I installed the prerequisites using:

sudo port install wget automake autoconf libtool coreutils gnutar md5sha1sum texlive

$ gcc --version
gcc (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Build fails here:

gcc -DHAVE_CONFIG_H -I. -I/tmp/gcc-arm-none-eabi-4_7-2013q3-20130916/src/binutils/binutils -I. -I/tmp/gcc-arm-none-eabi-4_7-2013q3-20130916/src/binutils/binutils -I../bfd -I/tmp/gcc-arm-none-eabi-4_7-2013q3-20130916/src/binutils/binutils/../bfd -I/tmp/gcc-arm-none-eabi-4_7-2013q3-20130916/src/binutils/binutils/../include -DLOCALEDIR="\"/tmp/gcc-arm-none-eabi-4_7-2013q3-20130916/install-native/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -I/tmp/gcc-arm-none-eabi-4_7-2013q3-20130916/build-native/host-libs/zlib/include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I/tmp/gcc-arm-none-eabi-4_7-2013q3-20130916/build-native/host-libs/zlib/include -O2 -MT nm.o -MD -MP -MF .deps/nm.Tpo -c -o nm.o /tmp/gcc-arm-none-eabi-4_7-2013q3-20130916/src/binutils/binutils/nm.c
cc1: warnings being treated as errors
/tmp/gcc-arm-none-eabi-4_7-2013q3-20130916/src/binutils/binutils/nm.c: In function 'main':
/tmp/gcc-arm-none-eabi-4_7-2013q3-20130916/src/binutils/binutils/nm.c:1687:7: error: 'sbrk' is deprecated (declared at /usr/include/unistd.h:582)
make[4]: *** [nm.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-binutils] Error 2
make: *** [all] Error 2

Terry Guo (terry.guo) on 2013-11-25
Changed in gcc-arm-embedded:
assignee: nobody → Terry Guo (terry.guo)
Terry Guo (terry.guo) wrote :

The How-to-build-toolchain.pdf says the build instructions are for 10.7.x. I am sorry that you have to figure this out for 10.9 by yourself.

Changed in gcc-arm-embedded:
status: New → Won't Fix
Simon (notsimon) wrote :

Just managed to build the 2.32.2 release of binutils on OSX Mavericks this way :
CC=gcc-4.9 CFLAGS=-Wno-error=deprecated-declarations ./configure --target=arm-none-eabi --enable-interwork --enable-multilib

William B. Wettersten (willfam) wrote :

Have you tried:

make CFLAGS=-Wno-error=deprecated-declarations

Keith Randall (keithr-p) wrote :

make CFLAGS=-Wno-error=deprecated-declarations

worked for me.

Terry Guo (terry.guo) wrote :

We are trying to add --disable-werror into Binutils configuration part, the final build step will look like:

echo Task [III-0] /$HOST_NATIVE/binutils/
rm -rf $BUILDDIR_NATIVE/binutils && mkdir -p $BUILDDIR_NATIVE/binutils
pushd $BUILDDIR_NATIVE/binutils
saveenv
saveenvvar CFLAGS "$ENV_CFLAGS"
saveenvvar CPPFLAGS "$ENV_CPPFLAGS"
saveenvvar LDFLAGS "$ENV_LDFLAGS"
$SRCDIR/$BINUTILS/configure \
    ${BINUTILS_CONFIG_OPTS} \
    --target=$TARGET \
    --prefix=$INSTALLDIR_NATIVE \
    --infodir=$INSTALLDIR_NATIVE_DOC/info \
    --disable-werror \
...............

Would you please help us to check if this works on your 10.9? Thanks in advance.

Christopher Wilson (cdwilson) wrote :

Since I posted the original bug, I have since upgraded to OSX 10.10 Yosemite. I tried this today by adding the "--disable-werror" and attempting to compile again.

Now it looks like I'm getting an error building the libc.pdf, so I'll have to see if I can sort that out... (I'm using tex from macports)

...
/usr/bin/texi2dvi: pdfetex exited with bad status, quitting.
/usr/bin/texi2dvi: see libc.log for errors.
make[4]: *** [libc.pdf] Error 1
make[3]: *** [pdf-recursive] Error 1
make[2]: *** [pdf-recursive] Error 1
make[1]: *** [pdf-target-newlib] Error 1
make: *** [do-pdf] Error 2

is there an easy way to disable building the docs so I can confirm if the tools compile?

Hale Wang (hale-wang) wrote :

Please try the option '--skip_steps=manual' to skip the pdf generation.

Christopher Wilson (cdwilson) wrote :

Oops... thanks Hale, I missed that option when I glanced through earlier. Using the '--skip_steps=manual' option, I was able to get the toolchain to compile on OSX 10.10 Yosemite (using macports gcc 4.9). I used it to quickly cross-compile the samples that come with the toolchain to sanity check, but I haven't tested it beyond that.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers