All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Stephen Cameron <stephenmcameron@gmail.com>
Cc: "Neto,
	Antonio Jose Rodrigues" <Antonio.Jose.Rodrigues.Neto@netapp.com>,
	"fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: Re: YACC y.tab.c Usage: /usr/bin/yacc [options] filename
Date: Mon, 06 Oct 2014 20:18:11 -0600	[thread overview]
Message-ID: <54334D63.70909@kernel.dk> (raw)
In-Reply-To: <CADzpL0SQ56xmwT5umYu+OdCMu5YwaV6vngruLzpPyoEu=_iy+w@mail.gmail.com>

On 2014-10-06 19:26, Stephen Cameron wrote:
> On Mon, Oct 6, 2014 at 8:10 PM, Jens Axboe <axboe@kernel.dk> wrote:
>> On 2014-10-06 16:25, Stephen Cameron wrote:
>>>
>>> On Mon, Oct 6, 2014 at 5:10 PM, Neto, Antonio Jose Rodrigues
>>> <Antonio.Jose.Rodrigues.Neto@netapp.com> wrote:
>>>>
>>>>
>>>>
>>> [...]
>>>>
>>>>
>>>> gcc -o lex.yy.o -std=gnu99 -Wwrite-strings -Wall
>>>> -Wdeclaration-after-statement -O3 -g -ffast-math  -D_GNU_SOURCE -include
>>>> config-host.h -DBITS_PER_LONG=64 -DFIO_VERSION='"fio-2.1.13-26-gb220c"'
>>>> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFIO_INTERNAL
>>>> -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG -c lex.yy.c
>>>> exp/expression-parser.l:23:19: error: y.tab.h: No such file or directory
>>>> exp/expression-parser.l: In function ‘yylex’:
>>>> exp/expression-parser.l:51: error: ‘yylval’ undeclared (first use in this
>>>> function)
>>>> exp/expression-parser.l:51: error: (Each undeclared identifier is
>>>> reported
>>>> only once
>>>> exp/expression-parser.l:51: error: for each function it appears in.)
>>>> exp/expression-parser.l:52: error: ‘SUFFIX’ undeclared (first use in this
>>>> function)
>>>> exp/expression-parser.l:122: error: ‘NUMBER’ undeclared (first use in
>>>> this
>>>> function)
>>>> make: *** [lex.yy.o] Error 1
>>>>
>>>>
>>>
>>> Ok, hmm.
>>>
>>> Try making the following change to the Makefile:
>>>
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -277,7 +277,7 @@ y.tab.o: y.tab.c y.tab.h
>>>           $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
>>>
>>>    y.tab.c: exp/expression-parser.y
>>> -       $(QUIET_YACC)$(YACC) --no-lines -d exp/expression-parser.y
>>> +       $(QUIET_YACC)$(YACC) --no-lines -d -b y exp/expression-parser.y
>>>
>>>    y.tab.h: y.tab.c
>>>
>>> (I cut and pasted the above, so it is probably not a well formatted
>>> patch anymore).
>>>
>>> That is, add " -b y " into the line for yacc.  bison by default
>>> doesn't produce y.tab.c y.tab.h, it produces from xxx.y -> xxx.tab.c
>>> and xxx.tab.h, which makes more sense than what yacc does, but it's
>>> not what the makefile is expecting.  The "-b y" tells bison to use "y"
>>> as the output file prefix, just as yacc normally does.
>>>
>>> then "make clean" and "make YACC=bison" and see if that works.
>>
>>
>> Should we default to using bison? Right now it checks for yacc first, and
>> uses that if available. If not, it checks for bison and uses that. Would be
>> easy enough to move around in configure.
>
> I'm not sure, I haven't proposed a real fix because I'm not sure what
> a real fix should look like.  We're using %parse-param, and I think
> yacc, or bison doing an exceptionally good job of pretending to be
> yacc, can't handle that.  I guess the versions of bison that I have
> seen  do not do such a perfect job of pretending to be yacc, and allow
> %parse-params to work anyway.   So the real fix might be to figure out
> how to get away without using %parse-param, so that yacc can deal with
> it.
>
> Or maybe we just require bison?   Maybe nowadays everyone has bison?

It's probably a safer choice than defaulting to yacc, me thinks... We'll 
see how that goes. I might have to extend and improve it to check not 
just if it's there, but if it actually works for our case as well. But 
baby steps, perhaps this is enough.

> Neto also mentioned that he wasn't able to build with arithmetic
> configured off.  I didn't try to chase that down.

I think that's a build issue due to hand editing stuff and attempting a 
build. The current code builds fine if it's off, I definitely tested 
that prior to pulling things in.

-- 
Jens Axboe



  reply	other threads:[~2014-10-07  2:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 21:12 YACC y.tab.c Usage: /usr/bin/yacc [options] filename Neto, Antonio Jose Rodrigues
2014-10-06 21:44 ` Stephen Cameron
     [not found]   ` <D05885C8.51DCC%Antonio.Jose.Rodrigues.Neto@netapp.com>
2014-10-06 22:04     ` Stephen Cameron
2014-10-06 22:10       ` Neto, Antonio Jose Rodrigues
2014-10-06 22:25         ` Stephen Cameron
2014-10-06 22:28           ` Neto, Antonio Jose Rodrigues
2014-10-06 22:31             ` Stephen Cameron
2014-10-07  1:18               ` Jens Axboe
2014-10-07  1:10           ` Jens Axboe
2014-10-07  1:26             ` Stephen Cameron
2014-10-07  2:18               ` Jens Axboe [this message]
2014-10-07 13:39                 ` Neto, Antonio Jose Rodrigues
2014-10-07 13:51                   ` Neto, Antonio Jose Rodrigues
2014-10-07 14:17                     ` Jens Axboe
2014-10-07 14:29                       ` Jens Axboe
2014-10-07 14:44                         ` Neto, Antonio Jose Rodrigues
2014-10-07 14:55                           ` Jens Axboe
2014-10-07 15:00                             ` Neto, Antonio Jose Rodrigues
2014-10-07 15:11                               ` Jens Axboe
2014-10-07 15:14                                 ` Neto, Antonio Jose Rodrigues
2014-10-07 14:16                   ` Jens Axboe
2014-10-06 22:34   ` Bruce Cran
2014-10-06 23:02     ` Stephen Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54334D63.70909@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=Antonio.Jose.Rodrigues.Neto@netapp.com \
    --cc=fio@vger.kernel.org \
    --cc=stephenmcameron@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.