|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Building binutils 2.18.50 on Ubuntu 8.10 (gcc 4.3.2)Hi all,
I've been testing building the toolchain on the most recent major Ubuntu release, 8.10, and it appears that binutils breaks due to stricter enforcement of string literals being passed to things like printf and fprintf. For instance, out of the box, binutils 2.18.50 with the appropriate patch errors out the first of two times on binutils-2.18.50/binutils/dwarf.c like so: gcc -DHAVE_CONFIG_H -I. -I/opt/or1200-toolchain/build/binutils-2.18.50/binutils -I. -I. -I/opt/or1200-toolchain/build/binutils-2.18.50/binutils -I../bfd -I/opt/or1200-toolchain/build/binutils-2.18.50/binutils/../bfd -I/opt/or1200-toolchain/build/binutils-2.18.50/binutils/../include -DLOCALEDIR="\"/opt/or1200-toolchain/build/tools/or32-uclinux/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c /opt/or1200-toolchain/build/binutils-2.18.50/binutils/dwarf.c cc1: warnings being treated as errors /opt/or1200-toolchain/build/binutils-2.18.50/binutils/dwarf.c: In function print_dwarf_vma: /opt/or1200-toolchain/build/binutils-2.18.50/binutils/dwarf.c:189: error: format not a string literal and no format arguments make[4]: *** [dwarf.o] Error 1 It was configured from a recent version of the MOF script, like so: $BUILD_TOP/$BINUTILS_VER/configure --target=or32-uclinux --prefix=$BUILD_TOP/tools/or32-uclinux --disable-checking --disable-Werror So, the line it refers to in dwarf.c that it doesn't like is like this: printf (buff + (byte_size == 4 ? 8 : 0)); Now, I'm by no means one hundred percent that this is correct, but I presume there's a pre-made string it wants to pass to printf, so if I just put in a "%s" in there it will fix this error? Wary that I may have changed the code so that it doesn't do what was intended, I can at least make the file compile by changing the line at 189 to: printf ("%s", buff + (byte_size == 4 ? 8 : 0)); The next issue when compiling is for the same reason, in the file binutils-2.18.50/gas/listing.c: gcc -DHAVE_CONFIG_H -I. -I/opt/or1200-toolchain/build/binutils-2.18.50/gas -I. -I. -I/opt/or1200-toolchain/build/binutils-2.18.50/gas -I../bfd -I/opt/or1200-toolchain/build/binutils-2.18.50/gas/config -I/opt/or1200-toolchain/build/binutils-2.18.50/gas/../include -I/opt/or1200-toolchain/build/binutils-2.18.50/gas/.. -I/opt/or1200-toolchain/build/binutils-2.18.50/gas/../bfd -DLOCALEDIR="\"/opt/or1200-toolchain/build/tools/or32-uclinux/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c /opt/or1200-toolchain/build/binutils-2.18.50/gas/listing.c cc1: warnings being treated as errors /opt/or1200-toolchain/build/binutils-2.18.50/gas/listing.c: In function print_options: /opt/or1200-toolchain/build/binutils-2.18.50/gas/listing.c:1103: error: format not a string literal and no format arguments make[4]: *** [listing.o] Error 1 The line concerned in listing.c is: fprintf (list_file, field_name); So I presume here we put in a format string like before, again wary that I have not much of an idea of what this is meant to do: fprintf (list_file, "%s", field_name); And now binutils-2.18.50 compiles and installs. GCC-4.2.2 seems to compile OK too, however the next issues with this toolchain build are to do with the linux kernel portion, but I'm yet to track down the specifics of this. I'll post more when I know. Anyway, i'm not sure if perhaps there's a configure option I can pass (I've seen the -Wformat-nonliteral, but I guess this makes gcc thrown an error at any of these warnings.... which is now standard behavior in gcc-4.3.2 I think) or perhaps these fixes should be in the next patch (or perhaps already are fixed in binutils-2.19). Anyone know what could be done to make this work first time, every time? -jb _______________________________________________ http://www.opencores.org/mailman/listinfo/openrisc |
|
|
|
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |