patches toward allowing fedora 9 build; flex-2.5.35; gcc-4.3.0

RESOLVED FIXED

Status

RESOLVED FIXED
10 years ago
6 months ago

People

(Reporter: segg2, Assigned: cjones)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061712 Fedora/3.0-1.fc9 Firefox/3.0
Build Identifier: pork-0.9

the thunk @@ -255,13 +255,10 @@ should move The #ifndef one line earlier
for example in
in generated file elsa/lexer.yy.cc, line 312 should now looks like following
#include "sm_flexlexer.h"
#ifndef NO_YYFLEXLEXER_METHODS
int yyFlexLexer::yywrap() { return 1; }
int yyFlexLexer::yylex()
	{
previous result was
#include "sm_flexlexer.h"

int yyFlexLexer::yywrap() { return 1; }
#ifndef NO_YYFLEXLEXER_METHODS
int yyFlexLexer::yylex() {


the thunk @@ -279,10 +276,11 @@ is about a C comment ending '*/' that should not have being removed by executing run-flex.pl
in generated file elsa/lexer.yy.cc, line 10704 should now looks like following
/* The contents of this function are C++ specific, so the () macro is not used.
 */
#ifndef NO_YYFLEXLEXER_METHODS
yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
{



Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Actual Results:  
1) in elkhound directory, it should clear warning
2) in elsa directory, it also should allow the linking of pparse to not fail on
double definition of yywrap().
(Reporter)

Comment 1

10 years ago
Created attachment 328432 [details] [diff] [review]
diiff file

Comment 2

10 years ago
Comment on attachment 328432 [details] [diff] [review]
diiff file

Congrads you've uncovered yet another ugly part of elsa!

>--- pork-0.9/oink-stack/smbase/run-flex.pl.yy	2008-07-02 14:31:32.000000000 -0400
>+++ pork-0.9/oink-stack/smbase/run-flex.pl	2008-07-07 18:25:38.000000000 -0400
>@@ -255,13 +255,10 @@
>   }
> 
>   elsif ($state == 4) {
>-    if ($line =~ m/^int yyFlexLexer::yylex/) {
>+    if ($lines[$i+1] =~ m/^int yyFlexLexer::yywrap/) {

No ::yywrap in 2.5.4

>       $state++;
>-      $i++;       # skip the '{' line, to keep #line numbers in sync
>-      chomp($line);
>-      $lineno += 3;
>-      print OUT ("#ifndef NO_YYFLEXLEXER_METHODS\n" .
>-                 $line . " {\n");
>+      $lineno++;
>+      print OUT ("#ifndef NO_YYFLEXLEXER_METHODS\n");
>       next;
>     }
>   }
>@@ -279,10 +276,11 @@
>   }
> 
>   elsif ($state == 6) {
>-    if ($lines[$i+1] =~ m/^yyFlexLexer::yyFlexLexer/) {
>+    if ($lines[$i] =~ m/^yyFlexLexer::yyFlexLexer/) {
>       $state++;
>-      $lineno++;
>-      print OUT ("#ifndef NO_YYFLEXLEXER_METHODS\n");
>+      $lineno += 2;
>+      print OUT ("#ifndef NO_YYFLEXLEXER_METHODS\n" .
>+                 $line . "");
I'm pretty sure that $line ... part isn't meant to be there.
>       next;
>     }
>   }


I'll see if i can make this work for me

Comment 3

10 years ago
nevermind, this blows my mind. I'll still accept a patch, but it's easier for me to use 2.5.4 than to read this code.
(Reporter)

Comment 4

10 years ago
(In reply to comment #2)
> (From update of attachment 328432 [details] [diff] [review])
> Congrads you've uncovered yet another ugly part of elsa!
> 
> >--- pork-0.9/oink-stack/smbase/run-flex.pl.yy	2008-07-02 14:31:32.000000000 -0400
> >+++ pork-0.9/oink-stack/smbase/run-flex.pl	2008-07-07 18:25:38.000000000 -0400
> >@@ -255,13 +255,10 @@
> >   }
> > 
> >   elsif ($state == 4) {
> >-    if ($line =~ m/^int yyFlexLexer::yylex/) {
> >+    if ($lines[$i+1] =~ m/^int yyFlexLexer::yywrap/) {
> 
> No ::yywrap in 2.5.4

developers of ulterior version of the flex++ do not maintain compatibility.
see new patch for another mechanism taht should succeed
 
> >       $state++;
> >-      $i++;       # skip the '{' line, to keep #line numbers in sync
> >-      chomp($line);
> >-      $lineno += 3;
> >-      print OUT ("#ifndef NO_YYFLEXLEXER_METHODS\n" .
> >-                 $line . " {\n");
> >+      $lineno++;
> >+      print OUT ("#ifndef NO_YYFLEXLEXER_METHODS\n");
> >       next;
> >     }
> >   }
> >@@ -279,10 +276,11 @@
> >   }
> > 
> >   elsif ($state == 6) {
> >-    if ($lines[$i+1] =~ m/^yyFlexLexer::yyFlexLexer/) {
> >+    if ($lines[$i] =~ m/^yyFlexLexer::yyFlexLexer/) {
> >       $state++;
> >-      $lineno++;
> >-      print OUT ("#ifndef NO_YYFLEXLEXER_METHODS\n");
> >+      $lineno += 2;
> >+      print OUT ("#ifndef NO_YYFLEXLEXER_METHODS\n" .
> >+                 $line . "");
> I'm pretty sure that $line ... part isn't meant to be there.

i let you proposed the proper "line" :-)

> >       next;
> >     }
> >   }
> 
> 
> I'll see if i can make this work for me
> 

(Reporter)

Comment 5

10 years ago
Created attachment 328649 [details] [diff] [review]
in smbase diff file against run-flex.pl
Attachment #328432 - Attachment is obsolete: true

Updated

10 years ago
Blocks: 438061

Comment 6

10 years ago
Created attachment 328711 [details] [diff] [review]
Fixed patch to include \n

Gilles,
I'm impressed that you got this work. Can you confirm that my fixed patch still works for you. It was missing a \n before

If it works, I'll apply it.
Attachment #328649 - Attachment is obsolete: true
(Reporter)

Comment 7

10 years ago
new commit for run-flex.pl on 444296 comment #9
the patch include traces of state to terminal, which should be removed later on.
I'm seeing what appears to be the same issue as in comment #1, but on a different flex-generated lexer; see the error below.

I'm using flex 2.5.34 on Ubuntu 8.04.

Looking into the problem.


**** Making all in ast
make[1]: Entering directory `/home/higgins/gcc-dehydra/pork/oink-stack/ast'
g++ -c -o agramlex.yy.o agramlex.yy.cc -g -Wall -Wno-deprecated -D__UNIX__ -DNDEBUG -D__LINUX__ -I../smbase
/home/higgins/gcc-dehydra/pork/oink-stack/ast/agramlex.yy.cc:1299: warning: "/*" within comment
    /* The contents of this function are C++ specific, so the () macro is not used.
/home/higgins/gcc-dehydra/pork/oink-stack/ast/agramlex.yy.cc:2036: error: Not in a #if (#ifdef) section
    #endif
1 error in preprocessor.
make[1]: *** [agramlex.yy.o] Error 1
The patch in comment #9 for bug #444296 fixed the problem.

Taras, it appears that that patch is not applied to the version of Pork one gets from following the instructions here (https://developer.mozilla.org/En/Installing_Pork).  Please advise: is the wiki or the repository out of sync?
Created attachment 383829 [details] [diff] [review]
fix for flex 2.5.35

Hit flex issues during compilation for the third time.  Can we get this fix committed?
Attachment #383829 - Flags: review?(tglek)

Comment 11

9 years ago
thanks guys 
http://hg.mozilla.org/elsa/rev/15b1e10be17a
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Comment 12

9 years ago
Comment on attachment 383829 [details] [diff] [review]
fix for flex 2.5.35

stale r+
Attachment #383829 - Flags: review?(tglek) → review+

Updated

7 years ago
Assignee: nobody → jones.chris.g

Updated

6 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.