Bug 6742

Summary: Ungraceful build error if bison or yacc is not available when building ld from CVS
Product: binutils Reporter: Joe Ren <earthengine>
Component: binutilsAssignee: unassigned
Status: RESOLVED OBSOLETE    
Severity: enhancement CC: bug-binutils, hp
Priority: P2    
Version: 2.18   
Target Milestone: ---   
Host: Target: i686-pc-cygwin
Build: Last reconfirmed:

Description Joe Ren 2008-07-13 09:29:41 UTC
I have tried to build a binutils for target cygwin by both native build under
Windows XP and cross build under Ubuntu 8.04. The problem is if the yacc parser
is not installed, the build of LD will fail because the ld/deffilep.y file can
not be parsed.

This takes me time to find out the problem because the error is something like
"main is duplicated" and provide no information of the yacc.

Suggestion is to detect the existence of yacc if target is cygwin while running
the configure script.
Comment 1 Alan Modra 2008-08-15 05:32:52 UTC
Were you building from a release tarball, a snapshot, or cvs?  If from a proper
release you should have deffilep.c and deffilep.h so yacc is not needed. 
Otherwise, yes, you do need yacc available.
Comment 2 Hans-Peter Nilsson 2012-05-12 09:52:03 UTC
Apparently a misdiagnosed generic error (not cygwin-specific), as was reported *with a quote from the build log* in <http://sourceware.org/ml/binutils/2012-05/msg00151.html>.  It took us a long time to diagnose this because this bug report only was something like "main is duplicated" and provided no information of the log. :]
The error now (first) happening for a different file is likely due to changes since 2008.
Comment 3 Alan Modra 2022-07-21 23:55:52 UTC
Missing bison/flex is diagnosed.