OSX 10.9.2 Build Failure -with-python=yes

Asked by Kenny Koller

Hi,

So GDB with Python is critical to the environment I am trying to build. I read the posts here about building -with-python=yes but I get the error below on OSX 10.9.2.

Closely related to this: GDB built from Homebrew does have Python support but it doesn't understand the elf file. It seems like most things are abstracted away from GDB but "load my.elf" does not work. What does arm-none-eabi-gdb know that gdb doesn't?Please see this posting:

http://stackoverflow.com/q/23555304/873389

Thank you.

Kenny

gcc -DHAVE_CONFIG_H -I. -I/Volumes/Development/Resource/Build.GCC/gcc-arm-none-eabi-4_8-2014q1-20140314/src/binutils/binutils -I. -I/Volumes/Development/Resource/Build.GCC/gcc-arm-none-eabi-4_8-2014q1-20140314/src/binutils/binutils -I../bfd -I/Volumes/Development/Resource/Build.GCC/gcc-arm-none-eabi-4_8-2014q1-20140314/src/binutils/binutils/../bfd -I/Volumes/Development/Resource/Build.GCC/gcc-arm-none-eabi-4_8-2014q1-20140314/src/binutils/binutils/../include -DLOCALEDIR="\"/Volumes/Development/Resource/Build.GCC/gcc-arm-none-eabi-4_8-2014q1-20140314/install-native/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -I/Volumes/Development/Resource/Build.GCC/gcc-arm-none-eabi-4_8-2014q1-20140314/build-native/host-libs/zlib/include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I/Volumes/Development/Resource/Build.GCC/gcc-arm-none-eabi-4_8-2014q1-20140314/build-native/host-libs/zlib/include -O2 -MT readelf.o -MD -MP -MF .deps/readelf.Tpo -c -o readelf.o /Volumes/Development/Resource/Build.GCC/gcc-arm-none-eabi-4_8-2014q1-20140314/src/binutils/binutils/readelf.c
/Volumes/Development/Resource/Build.GCC/gcc-arm-none-eabi-4_8-2014q1-20140314/src/binutils/binutils/readelf.c:9046:20: error:
      adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int]
    fputs (" " + n, stdout);
           ~~~~~~~~^~~
/Volumes/Development/Resource/Build.GCC/gcc-arm-none-eabi-4_8-2014q1-20140314/src/binutils/binutils/readelf.c:9046:20: note:
      use array indexing to silence this warning
    fputs (" " + n, stdout);
                   ^
           & [ ]
1 error generated.
make[4]: *** [readelf.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-binutils] Error 2
make: *** [all] Error 2

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Thomas Preud'homme
Solved:
Last query:
Last reply:
Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#1

Hi Kenny,

gcc warns because the style of this line of code is not as it expects. There is however no bug on this line and you can thus safely pass --disable--Werror to the configure of binutils.

Best regards.

Revision history for this message
Terry Guo (terry.guo) said :
#2

Before you start to build the gdb source, you need to configure it. In this step, you have to specify the target of your new gdb through options like "--target=arm-none-eabi", "--target=i386...." or "--target=mips.....". Something is skipped here because I can't recall the exact option name.

As far as I know, you can't build a gdb that can understand all targets. So the gdb from homebrew targets for x86, thus can't understand the ELF file for arm targets. And vice versa.

Revision history for this message
Terry Guo (terry.guo) said :
#3

When you configure gdb with option "--target=arm-none-eabi", the gdb source files to parse arm elf file will be compiled and added to final new gdb. This makes new gdb to be able to perform "load arm.elf". Meanwhile the gdb sources to parse x86 elf files won't be included and thus the new gdb won't be able to handle x86 elf file.

Revision history for this message
Kenny Koller (kenny-koller) said :
#4

Thanks Terry. I guess I figured ELF was common enough that it would also get baked in. Interesting that my build is failing in readelf.c even though the questions is about mostly about Python support!

Thomas:

That's an interesting (and somewhat clever) line of code. It looks like its trying to use pointer arithmetic to add a variable amount of space to stdout. Could have used a comment!

if (n < 5)
    fputs (" " + n, stdout);

Why would the defaults create a failing build? I guess this configuration of the build is not super clear to me. The instructions just said run the two .sh files.

Revision history for this message
Best Thomas Preud'homme (thomas-preudhomme) said :
#5

It was fixed later. My guess is that when the code was written there was no error but then a new version of gcc came out that warns about this. Probably your version of gcc is more recent than the one we build our toolchain with. As to the --disable-Werror you should add it to the configure line in build-toolchain.sh. Look at the line that starts with $SRCDIR/$BINUTILS/configure and just add --disable-werror to the list of switches.

Best regards,

Thomas

Revision history for this message
Kenny Koller (kenny-koller) said :
#6

Thanks Thomas Preud'homme, that solved my question.