Bug 53679 - Build failure in libgo
Summary: Build failure in libgo
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: go (show other bugs)
Version: 4.7.1
: P3 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-15 07:49 UTC by Allan McRae
Modified: 2013-01-26 03:20 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Allows me to compile it, I do know if there's any value if checking for errors writing to stderr (171 bytes, patch)
2012-06-15 15:52 UTC, safety0ff.bugz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Allan McRae 2012-06-15 07:49:46 UTC
Since revision 187850, I get build failures for libgo due to the use of -Werror and not checking the return value of write:

/build/src/gcc-4.7.1/libgo/runtime/print.c: In function 'gwrite':
/build/src/gcc-4.7.1/libgo/runtime/print.c:20:3: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result]
cc1: all warnings being treated as errors
Comment 1 safety0ff.bugz 2012-06-15 15:52:18 UTC
Created attachment 27626 [details]
Allows me to compile it, I do know if there's any value if checking for errors writing to stderr
Comment 2 Andrew Pinski 2012-06-15 16:41:53 UTC
Actually this is due to your modifications to gcc to enable fority by default and glibc's bad idea that write needs to be check for error after each write.
Comment 3 Allan McRae 2012-06-15 22:36:54 UTC
Just to be clear, I have not modified the compiler to enable fortify by default, but it is in my CFLAGS...

As this is the only place that glibc's decision to enforce a check on the return value of write causes the build to fail with these CFLAGS, it would be nice to include the posted work-around, or equivalently: 

- runtime_write(2, v, n)
+ if(runtime_write(2, v, n)) {}
Comment 4 Mike Frysinger 2012-06-27 23:09:10 UTC
another alternative woul dbe to fix the libgo/ subdir to respect --disable-werror like all the other places in the gcc tree
Comment 5 Mike Frysinger 2012-12-23 23:32:35 UTC
posted a patch here to add --disable-werror:
http://gcc.gnu.org/ml/gcc-patches/2012-12/msg01379.html

we need this for ChromiumOS ...
Comment 6 Mike Frysinger 2013-01-26 03:20:51 UTC
Ian has pushed the patch to trunk:
http://gcc.gnu.org/viewcvs?view=revision&revision=195482