Opened 15 years ago

Closed 15 years ago

#3021 closed bug (fixed)

Building gcc4 cross-compiler errors in binutils?

Reported by: tqh Owned by: bonefish
Priority: normal Milestone: R1
Component: Build System Version: R1/pre-alpha1
Keywords: Cc: ithamar@…
Blocked By: Blocking:
Platform: All

Description

Not sure if this is Haiku or Ubuntu 8.10 x64/gcc4.32.

When configuring gcc4 compiler it fails in binutils because of -Werror: buildtools/binutils/binutils/bucomm.c:426 error: ignoring return value (warn_unused_result). /buildtools/binutils/binutils/bucomm.c:433 error: ignoring return value (warn_unused_result). (errors are translated from Swedish).

Command in question: haiku/generated-gcc4$ ../configure --use-32bit --build-cross-tools-gcc4 x86 ../../buildtools/ --alternative-gcc-output-dir ../generated-gcc2

Attachments (1)

wnoerror.patch (585 bytes ) - added by ithamar 15 years ago.
small patch to add -Wno-error to compiler flags to prevent new gcc versions like the one shipping with Ubuntu 8.10 to stop on non-fatal warnings.…

Download all attachments as: .zip

Change History (13)

comment:2 by tqh, 15 years ago

Compiler flags: gcc -DHAVE_CONFIG_H -I. -I/home/frho/haiku/buildtools/binutils/binutils -I. -D_GNU_SOURCE -I. -I/home/frho/haiku/buildtools/binutils/binutils -I../bfd -I/home/frho/haiku/buildtools/binutils/binutils/../bfd -I/home/frho/haiku/buildtools/binutils/binutils/../include -I/home/frho/haiku/buildtools/binutils/binutils/../intl -I../intl -DLOCALEDIR="\"/home/frho/haiku/haiku/generated-gcc4/cross-tools/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O2 -c /home/frho/haiku/buildtools/binutils/binutils/bucomm.c

comment:3 by aldeck, 15 years ago

I quickly tried doing a fresh build on Ubuntu 8.10 64bits yesterday. Building the buildtools failed on some warning treated as error. I will provide more details asap.

comment:4 by bonefish, 15 years ago

Can someone please try the analog solution to hrev28396.

comment:5 by tqh, 15 years ago

New error with -U_FORTIFY_SOURCE added to CFLAGS at line 90 and 121 in build/scripts/build_cross_tools_gcc4: buildtools/binutils/binutils/cxxfilt.c: I funktion "demangle_it": buildtools/binutils/binutils/cxxfilt.c:66: error: format is not a stringliteral and no format arguments. buildtools/binutils/binutils/cxxfilt.c:71: ... (translated from Swedish)

in reply to:  5 comment:6 by bonefish, 15 years ago

Replying to tqh:

New error with -U_FORTIFY_SOURCE added to CFLAGS at line 90 and 121 in build/scripts/build_cross_tools_gcc4: buildtools/binutils/binutils/cxxfilt.c: I funktion "demangle_it": buildtools/binutils/binutils/cxxfilt.c:66: error: format is not a stringliteral and no format arguments. buildtools/binutils/binutils/cxxfilt.c:71: ... (translated from Swedish)

This sounds just like another of those "fortify" warnings. Does the compile line for this source file contain the -U_FORTIFY_SOURCE?

comment:7 by tqh, 15 years ago

gcc -DHAVE_CONFIG_H -I. -I/home/frho/haiku/buildtools/binutils/binutils -I. -D_GNU_SOURCE -I. -I/home/frho/haiku/buildtools/binutils/binutils -I../bfd -I/home/frho/haiku/buildtools/binutils/binutils/../bfd -I/home/frho/haiku/buildtools/binutils/binutils/../include -I/home/frho/haiku/buildtools/binutils/binutils/../intl -I../intl -DLOCALEDIR="\"/home/frho/haiku/haiku/generated-gcc4/cross-tools/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O2 -U_FORTIFY_SOURCE -c /home/frho/haiku/buildtools/binutils/binutils/cxxfilt.c cc1: warnings being treated as errors /home/frho/haiku/buildtools/binutils/binutils/cxxfilt.c: In function 'demangle_it': /home/frho/haiku/buildtools/binutils/binutils/cxxfilt.c:66: error: format not a string literal and no format arguments /home/frho/haiku/buildtools/binutils/binutils/cxxfilt.c:71: error: format not a string literal and no format arguments

comment:8 by tqh, 15 years ago

I build with -Wno-error added temporarily.

by ithamar, 15 years ago

Attachment: wnoerror.patch added

small patch to add -Wno-error to compiler flags to prevent new gcc versions like the one shipping with Ubuntu 8.10 to stop on non-fatal warnings....

comment:9 by ithamar, 15 years ago

if wanted, I can commit the proposed patch, and also verify if this is needed for the legacy gcc compiler too...

comment:10 by ithamar, 15 years ago

Cc: ithamar@… added

comment:11 by rossi, 15 years ago

Works like a charm ;-) and btw, the legacy compiler works fine without the patch on Ubuntu 8.10. Any reason, why this patch isn't committed? Might spare some people some useless frustration and I guess Ubunutu 8.10 is not that uncommon anymore ...

comment:12 by bonefish, 15 years ago

Resolution: fixed
Status: newclosed

This should have been fixed by the upgrade to gcc 4.3.3 and binutils 2.19. If it still can be reproduced, please reopen.

Note: See TracTickets for help on using tickets.