Opened 11 years ago

Closed 10 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:
Has a Patch: no 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 11 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:1 Changed 11 years ago by tqh

hrev28431 btw.

comment:2 Changed 11 years ago by tqh

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 Changed 11 years ago by aldeck

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 Changed 11 years ago by bonefish

Can someone please try the analog solution to hrev28396.

comment:5 Changed 11 years ago by 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)

comment:6 in reply to:  5 Changed 11 years ago by bonefish

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 Changed 11 years ago by tqh

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 Changed 11 years ago by tqh

I build with -Wno-error added temporarily.

Changed 11 years ago by ithamar

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 Changed 11 years ago by ithamar

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

comment:10 Changed 11 years ago by ithamar

Cc: ithamar@… added

comment:11 Changed 10 years ago by rossi

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 Changed 10 years ago by bonefish

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.