This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question: bison 2.4.1 breaks binutils/ld/deffilep.y, with fix


On Tue, 28 Apr 2009, Joel E. Denny wrote:

> On Tue, 28 Apr 2009, Danny Backx wrote:
> 
> > This started for me as a report from Ismail that the cegcc build broke
> > on his Mac. I asked about this on the binutils list, got a reply from
> > H-P that Ismail went on to verify.
> > 
> > Now the result (below) appears to be that the MacOS problem in the
> > binutils/ld only appears when combined with bison 2.4.1.
> > I don't see the issue on my x86 linux PC (I moved bison to 2.4.1 but the
> > binutils build wouldn't break).
> > 
> > Can anyone confirm that the patch below (moving some lines in
> > binutils/ld/deffilep.y up) is legitimate ?
> 
> Bison 2.3a changed the handling of the relative positions of %union and 
> %{...%} in the .y file in a backward-incompatible manner.  Based on the 
> rest of your email, that appears to be the problem you encountered.  It 
> also looks like you're generating a deterministic (that is, LALR(1) not 
> GLR) parser in C.  In that case, the only change is that all %{...%} 
> before the first %union are now inserted before rather than after the 
> token definitions.  Those %{...%} appearing after the first %union are 
> still inserted after the token definitions.  For a complete explanation, 
> see the section for 2.3a in Bison's NEWS file.
> 
> I apologize for the inconvenience here.  The goal of the change was 
> consistency among Bison's skeletons, but I was clearly naive to think 
> users were not likely to be dependent on the previous behavior.  
> Unfortunately, reverting at this point may just further frustrate all 
> users who have managed to update.
> 
> While Bison will continue to support %{...%}, you might encourage the 
> maintainers of CeGCC to switch from %{...%} to %code {...}, which 

binutils not CeGCC.

> eliminates many of these subtle ordering issues.  See the section 
> "Prologue Alternatives" in the Bison manual for a complete explanation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]