Shop OBEX P1 Docs P2 Docs Learn Events
problem compiling propgcc source on OSX 10.9 with latest Xcode — Parallax Forums

problem compiling propgcc source on OSX 10.9 with latest Xcode

Mike PetryMike Petry Posts: 14
edited 2013-12-21 09:05 in Propeller 1
Hi,
Has anyone built the latest propgcc tree under OSX 10.9 with the latest Xcode?

I've been happily running binaries that I built from a March 2013 propgcc tree that I built on OSX 10.8 with its Xcode release.
Everything compiled, linked, and ran with no problem.

I decided to try and catch up to the latest propgcc sources on my OSX 10.9
I cloned a new copy of the directory, ran an update, and did a build. The build failed with the error below.

Seems a lot has changed on OSX with release 10.9 and the updated Xcode.

I did a quick edit, to fix the readelf.c error, but then ran into problem on other parts of binutils because of "sbrk()" being defined.
It looks like configure finds an "sbrk()" definition and sets HAVE_SBRK. That causes havoc to gas and a few others in binutil.

Have others run into this on OSX 10.9?

Glad I kept my old /opt/parallax binary tree.

-Mike


/bin/sh ./libtool --tag=CC --mode=link gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -o addr2line addr2line.o bucomm.o version.o filemode.o ../bfd/libbfd.la ../libiberty/libiberty.a -lz
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -o addr2line addr2line.o bucomm.o version.o filemode.o ../bfd/.libs/libbfd.a ../libiberty/libiberty.a -lz
gcc -DHAVE_CONFIG_H -I. -I../../../propgcc/binutils/binutils -I. -I../../../propgcc/binutils/binutils -I../bfd -I../../../propgcc/binutils/binutils/../bfd -I../../../propgcc/binutils/binutils/../include -DLOCALEDIR="\"/opt/parallax/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT readelf.o -MD -MP -MF .deps/readelf.Tpo -c -o readelf.o ../../../propgcc/binutils/binutils/readelf.c
../../../propgcc/binutils/binutils/readelf.c:9051:20: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int]
fputs (" " + n, stdout);
~~~~~~~~^~~
../../../propgcc/binutils/binutils/readelf.c:9051:20: note: use array indexing to silence this warning
fputs (" " + n, stdout);
^
& [ ]
1 error generated.
make[4]: *** [readelf.o] Error 1

Comments

  • Heater.Heater. Posts: 21,230
    edited 2013-12-21 03:15
    Strangely enough RossH and I were discussing exactly that compiler error message here recently. In the statement "fputs (" " + n, stdout);" the code is adding an integer to a string which is crazy and the compiler rightly complains.

    To fix this you are going to have to change that code to something like this:
    fputs (&" "[n], stdout);
    

    Or you are going to have to switch the checking off by adding the option -Wno-string-plus-int to the command in the build system some how.

    This all comes about because xcode uses the Clang compiler which does more checking than GCC and the GCC source code is wonky.


  • David BetzDavid Betz Posts: 14,516
    edited 2013-12-21 04:26
    Mike Petry wrote: »
    Hi,
    Has anyone built the latest propgcc tree under OSX 10.9 with the latest Xcode?

    I've been happily running binaries that I built from a March 2013 propgcc tree that I built on OSX 10.8 with its Xcode release.
    Everything compiled, linked, and ran with no problem.

    I decided to try and catch up to the latest propgcc sources on my OSX 10.9
    I cloned a new copy of the directory, ran an update, and did a build. The build failed with the error below.

    Seems a lot has changed on OSX with release 10.9 and the updated Xcode.

    I did a quick edit, to fix the readelf.c error, but then ran into problem on other parts of binutils because of "sbrk()" being defined.
    It looks like configure finds an "sbrk()" definition and sets HAVE_SBRK. That causes havoc to gas and a few others in binutil.

    Have others run into this on OSX 10.9?

    Glad I kept my old /opt/parallax binary tree.

    -Mike


    /bin/sh ./libtool --tag=CC --mode=link gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -o addr2line addr2line.o bucomm.o version.o filemode.o ../bfd/libbfd.la ../libiberty/libiberty.a -lz
    libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -o addr2line addr2line.o bucomm.o version.o filemode.o ../bfd/.libs/libbfd.a ../libiberty/libiberty.a -lz
    gcc -DHAVE_CONFIG_H -I. -I../../../propgcc/binutils/binutils -I. -I../../../propgcc/binutils/binutils -I../bfd -I../../../propgcc/binutils/binutils/../bfd -I../../../propgcc/binutils/binutils/../include -DLOCALEDIR="\"/opt/parallax/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT readelf.o -MD -MP -MF .deps/readelf.Tpo -c -o readelf.o ../../../propgcc/binutils/binutils/readelf.c
    ../../../propgcc/binutils/binutils/readelf.c:9051:20: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int]
    fputs (" " + n, stdout);
    ~~~~~~~~^~~
    ../../../propgcc/binutils/binutils/readelf.c:9051:20: note: use array indexing to silence this warning
    fputs (" " + n, stdout);
    ^
    & [ ]
    1 error generated.
    make[4]: *** [readelf.o] Error 1

    I had lots of problems like this when I first tried compiling propgcc with the latest Xcode. I discussed it with Eric Smith and we decided that it wasn't a good idea to modify all of the generic GCC code to fix these warnings so I've been running the following command before starting a build. It seems to fix the problem.
    export CFLAGS="\
    -Wno-string-plus-int \
    -Wno-deprecated-declarations \
    -Wno-empty-body \
    -Wno-self-assign \
    -Wno-sometimes-uninitialized"
    
    There is still a problem in one module that I ended up fixing in the generic code because it really was a bug but I think I pushed that change to both the release_1_0 branch and the default branch in Google Code.
  • Mike PetryMike Petry Posts: 14
    edited 2013-12-21 09:05
    Thanks. Those two things did it.

    Will jbuild.sh be updated to reflect the new CFLAGS?

    Thanks again,
    Mike
Sign In or Register to comment.