Bug 196854 - devel/psptoolchain-binutils: Fails to build with GCC 4.9 (due to "warnings as errors")
Summary: devel/psptoolchain-binutils: Fails to build with GCC 4.9 (due to "warnings as...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Gerald Pfeifer
Keywords: needs-qa, patch
Depends on:
Blocks: 196712
  Show dependency treegraph
Reported: 2015-01-18 23:04 UTC by Gerald Pfeifer
Modified: 2015-02-25 16:06 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback+

set USE_GCC=4.8 to unblock (506 bytes, patch)
2015-01-19 05:52 UTC, Tassilo Philipp
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer freebsd_committer 2015-01-18 23:04:11 UTC
This is important since it blocks the upgrade of the default version
of GCC from GCC 4.8 to GCC 4.9.  If you cannot fix it, please change
to USE_GCC=4.8 temporarily.

Better yet, update to a reasonably recent version of binutils.


libtool: compile:  gcc49 -DHAVE_CONFIG_H -I. -I. -I. -I./../include -DHAVE_bfd_elf32_littlemips_vec -DHAVE_bfd_elf32_bigmips_vec -DHAVE_bfd_elf64_bigmips_vec -DHAVE_bfd_elf64_littlemips_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -O2 -pipe -fstack-protector -Wl,-rpath=/usr/local/lib/gcc49 -fno-strict-aliasing -MT opncls.lo -MD -MP -MF .deps/opncls.Tpo -c opncls.c -o opncls.o
In file included from opncls.c:26:0:
opncls.c: In function 'bfd_fopen':
bfd.h:524:65: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
 #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
opncls.c:249:5: note: in expansion of macro 'bfd_set_cacheable'
     bfd_set_cacheable (nbfd, TRUE);
cc1: all warnings being treated as errors
Makefile:1537: recipe for target 'opncls.lo' failed
Comment 1 Bugzilla Automation freebsd_committer 2015-01-18 23:04:11 UTC
Maintainer CC'd
Comment 2 Tassilo Philipp 2015-01-19 05:43:43 UTC
Will work on a patch, but this might be most-likely USE_GCC=4.8 - the upstream sources for the psptoolchain are dead, and the binutils used are patched extensively to support the MIPS processor of the PSP, so it's kinda tied to that binutils version, currently.
I'll work on it, but I think it's best to unblock you, by setting USE_GCC, for now.
Comment 3 Tassilo Philipp 2015-01-19 05:52:26 UTC
Created attachment 151825 [details]
set USE_GCC=4.8 to unblock

Attached just the patch to use gcc 4.8, so the port doesn't block switching to 4.9 by default
Comment 4 Tassilo Philipp 2015-02-08 21:11:56 UTC
I keep getting emails that this PR needs some action from my side... not sure what, though? Sent in a patch, and also looks like this will be the final "fix" as the last official upstream sources are pretty committed to binutils 2.22. Someone started a github repository which might be where the psptoolchain development continues, but they are also sticking to binutils 2.22, so for now I don't think there will be a better patch.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2015-02-16 04:19:48 UTC
Reporter is Committer
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2015-02-16 04:22:34 UTC
For reference, people who's emails are set as the value of the maintainer-feedback flag receive intermittent notifications until that flag is removed (set to + in this case to say "yep, provided my feedback"
Comment 7 commit-hook freebsd_committer 2015-02-16 05:56:33 UTC
A commit references this bug:

Author: gerald
Date: Mon Feb 16 05:55:49 UTC 2015
New revision: 379064
URL: https://svnweb.freebsd.org/changeset/ports/379064

  Force the use of GCC 4.8 since the old codebase here fails with newer
  versionf of GCC.

  PR:		196854
  Approved by:	tphilipp@potion-studios.com (maintainer)

Comment 8 Gerald Pfeifer freebsd_committer 2015-02-16 05:58:02 UTC
Thanks, I applied this change; one port less to worry about.
Comment 9 John Marino freebsd_committer 2015-02-16 07:29:19 UTC

This fix may be accidentally right.

I already fixed the problem listed in the PR.  The problem was that it was being built with -Werror set.

devel/binutils explicitly puts --disable-werror in the configure args for this reason.  All that was missing from devel/psptoolchain-binutils was the same argument, which I had *already* added.

Before the last commit, binutils built with gcc5!  It was not limited to 4.8 at all.

However, the psptoolchain-gcc stage 1 failed on gcc5.  I don't know if it buids on 4.9 or not. 

So the summary is:
The fix for this particular port is wrong as it was *already fixed* by the previous commit and there is not gcc limit on it.  The ports dependent on it may need some work to build with gcc-5 (status for gcc 4.9 is unknown)
Comment 10 Tassilo Philipp 2015-02-16 16:48:52 UTC
John: thanks for the note. I can see the flag you added and sorry for not seeing that myself when this was originally reported. There is another PR open for this port (197581), to fix building it on ARM as host. While working on that one I can look into switching USE_GCC back to any. Of course I will test this across multiple platforms.
About psptoolchain-gcc-stage1, is there a PR open for it? I'm a bit confused by the details on this. Thanks!

Kubilay: Ok, I see - this really is anything but intuitive IMHO, but now I know. Thanks for explaining.
Comment 11 John Marino freebsd_committer 2015-02-16 16:54:59 UTC
No, I haven't reported for the following reasons:

1) it's an internal compiler fault
2) It's built on gcc-5, and not even a vendor gcc-5, but the DragonFly base compiler which is sort of like saying it an "experimental experimental compiler"

error is here:

/wrkdirs/devel/psptoolchain-gcc-stage1/work/build/./gcc/xgcc -B/wrkdirs/devel/psptoolchain-gcc-stage1/work/build/./gcc/ -B/usr/local/psp/stage1/psp/bin/ -B/usr/local/psp/stage1/psp/lib/ -isystem /usr/local/psp/stage1/psp/include -isystem /usr/local/psp/stage1/psp/sys-include    -g -pipe -O2 -fno-strict-aliasing -O2  -g -pipe -O2 -fno-strict-aliasing -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -G 0 -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector -Dinhibit_libc  -I. -I. -I../.././gcc -I../.././../gcc-4.6.2/libgcc -I../.././../gcc-4.6.2/libgcc/. -I../.././../gcc-4.6.2/libgcc/../gcc -I../.././../gcc-4.6.2/libgcc/../include  -DHAVE_CC_TLS  -o _ucmpdi2.o -MT _ucmpdi2.o -MD -MP -MF _ucmpdi2.dep -DL_ucmpdi2 -c ../.././../gcc-4.6.2/libgcc/../gcc/libgcc2.c \
../.././../gcc-4.6.2/libgcc/../gcc/libgcc2.c: In function '__negdi2':
../.././../gcc-4.6.2/libgcc/../gcc/libgcc2.c:72:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Makefile:377: recipe for target '_negdi2.o' failed
gmake[3]: *** [_negdi2.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
if [ -z "" ]; then \
  true; \
Comment 12 Tassilo Philipp 2015-02-16 17:06:41 UTC
Cool, thanks for the feedback - I'll keep this in mind.
Comment 13 commit-hook freebsd_committer 2015-02-25 08:28:45 UTC
A commit references this bug:

Author: marino
Date: Wed Feb 25 08:28:02 UTC 2015
New revision: 379887
URL: https://svnweb.freebsd.org/changeset/ports/379887

  devel/psptoolchain-binutils: Revert revision 379064

  This binutils port builds just fine with newer GCC, as long as -Werror
  is not used.  Revert the false restriction of 379064, the issue had
  already been handled two days earlier with 378957.

  PR:	196854

Comment 14 Tassilo Philipp 2015-02-25 16:06:27 UTC
(In reply to commit-hook from comment #13)