Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66794 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74439 invoked from network); 25 Mar 2013 05:48:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Mar 2013 05:48:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.44 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.215.44 mail-la0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:44064] helo=mail-la0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/E2-58569-915EF415 for ; Mon, 25 Mar 2013 00:48:10 -0500 Received: by mail-la0-f44.google.com with SMTP id eb20so10681636lab.17 for ; Sun, 24 Mar 2013 22:48:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=CNyqjP1PrgE6pzN/xHH8N5l9YVAJ64ChXHoDc+YtoFo=; b=BU4n/bpMWQjiu4R8ldxtzelA/rcQ7Vg+DKMyA0IgrU9XPKGX1IBmcTDGAZdf4MY9Aa Si+v6Bdpc+lqMoAKdjhlhDxVT/kVq60no6LQNVXzR+41nwUy8PFWffi73oJKLfiv+AJd GCyclUwFF8Mbv9eotXuJmw6s3DGMnWtGG/4yUqz7QJH+fRo0ThiAkX6tj1PsNRcnNr2V qWgvVQMQuwi6wYd1iOoGn4I4QitGi4zz+1MVSvVEZI6mPa3oksW/REeJdMEJPgGE/+or DqfrOMVwUtceLHHXQExjejWdTfB2VDaUIJC6eQF5zzKBC/UTC/oBnsdLtZX7V7z6HLYH ZlGg== X-Received: by 10.152.111.67 with SMTP id ig3mr5317057lab.41.1364190486326; Sun, 24 Mar 2013 22:48:06 -0700 (PDT) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.114.66.196 with HTTP; Sun, 24 Mar 2013 22:47:46 -0700 (PDT) In-Reply-To: References: <514C1E14.3070002@fedoraproject.org> <514F370B.7080409@lerdorf.com> <514F8E86.2020601@lerdorf.com> <514FD5AE.9060703@lerdorf.com> <514FE04F.5000402@lerdorf.com> Date: Mon, 25 Mar 2013 13:47:46 +0800 X-Google-Sender-Auth: wGjTlTb0LP4ksjmL2G8eUJTOTos Message-ID: To: Rasmus Lerdorf Cc: Felipe Pena , Remi Collet , internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] PHP 5.5.0beta1 ZTS broken build From: laruence@php.net (Laruence) On Mon, Mar 25, 2013 at 1:43 PM, Laruence wrote: > On Mon, Mar 25, 2013 at 1:27 PM, Rasmus Lerdorf wrote: >> On 03/24/2013 10:24 PM, Laruence wrote: >>> On Mon, Mar 25, 2013 at 1:19 PM, Laruence wrote: >>>> On Mon, Mar 25, 2013 at 1:18 PM, Laruence wrote: >>>>> On Mon, Mar 25, 2013 at 12:42 PM, Rasmus Lerdorf wrote: >>>>>> On 03/24/2013 09:30 PM, Laruence wrote: >>>>>>> On Mon, Mar 25, 2013 at 7:38 AM, Rasmus Lerdorf wrote: >>>>>>>> On 03/24/2013 10:35 AM, Felipe Pena wrote: >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> 2013/3/24 Rasmus Lerdorf : >>>>>>>>>> On 03/22/2013 02:02 AM, Remi Collet wrote: >>>>>>>>>>> While build of 5.5 snapshot works perfectly, beta1 ZTS build is broken >>>>>>>>>>> >>>>>>>>>>> In file included from >>>>>>>>>>> /dev/shm/BUILD/php-5.5.0beta1/ext/tokenizer/tokenizer.c:33:0: >>>>>>>>>>> /dev/shm/BUILD/php-5.5.0beta1/build-ztscli/Zend/zend_language_parser.h:331:5: >>>>>>>>>>> error: conflicting types for 'zendparse' >>>>>>>>>>> In file included from >>>>>>>>>>> /dev/shm/BUILD/php-5.5.0beta1/Zend/zend_globals.h:28:0, >>>>>>>>>>> from /dev/shm/BUILD/php-5.5.0beta1/Zend/zend_compile.h:418, >>>>>>>>>>> from /dev/shm/BUILD/php-5.5.0beta1/Zend/zend_modules.h:26, >>>>>>>>>>> from /dev/shm/BUILD/php-5.5.0beta1/Zend/zend_API.h:26, >>>>>>>>>>> from /dev/shm/BUILD/php-5.5.0beta1/main/php.h:38, >>>>>>>>>>> from >>>>>>>>>>> /dev/shm/BUILD/php-5.5.0beta1/ext/tokenizer/tokenizer.c:25: >>>>>>>>>>> /dev/shm/BUILD/php-5.5.0beta1/Zend/zend_globals_macros.h:35:5: note: >>>>>>>>>>> previous declaration of 'zendparse' was here >>>>>>>>>>> >>>>>>>>>>> Comparing the 201303201430 snapshot (very closed to beta1) and beta1 archive >>>>>>>>>>> >>>>>>>>>>> 201303201430, in bison generated files: >>>>>>>>>>> /* A Bison parser, made by GNU Bison 2.4.1. */ >>>>>>>>>>> beta1: >>>>>>>>>>> /* A Bison parser, made by GNU Bison 2.6.1. */ >>>>>>>>>>> >>>>>>>>>>> So, it seems snapshot script don't use the same environment than the one >>>>>>>>>>> used to generate release. >>>>>>>>>>> >>>>>>>>>>> Any idea how to fix this ? >>>>>>>>>> >>>>>>>>>> I took a quick look at this. The Bison change causing this from their >>>>>>>>>> NEWS file is: >>>>>>>>>> >>>>>>>>>> *** Features deprecated since Bison 1.875 >>>>>>>>>> YYPARSE_PARAM and YYLEX_PARAM, deprecated in favor of >>>>>>>>>> %parse-param and %lex-param, will no longer be supported. >>>>>>>>>> >>>>>>>>>> I was hoping the fix would be as simple as doing: >>>>>>>>>> >>>>>>>>>> -#define YYPARSE_PARAM tsrm_ls >>>>>>>>>> -#define YYLEX_PARAM tsrm_ls >>>>>>>>>> +%parse-param { tsrm_ls } >>>>>>>>>> +%lex-param { tsrm_ls } >>>>>>>>>> >>>>>>>>>> but that doesn't quite do the trick. Need to read up more on how >>>>>>>>>> %parse-param and %lex-param work. If someone wants to do a little light >>>>>>>>>> reading and report back it would be appreciated. >>>>>>>>>> >>>>>>>>> >>>>>>>>> http://www.gnu.org/software/bison/manual/html_node/Parser-Function.html#Parser-Function >>>>>>>>> >>>>>>>>> This page explain how to use it. >>>>>>>> >>>>>>>> Sure, I see how they work, but the problem is that they can't be inside >>>>>>>> the %{ ... %} code block there. They have to be outside and as such >>>>>>>> won't have access to the #ifdef ZTS. So I don't think we can >>>>>>>> conditionally create a reentrant parser like we did before without >>>>>>>> refactoring things a bit. >>>>>>> if %parse-param defined, then the paramenter also is added to yyerror, >>>>>>> yydestroctor etc. >>>>>>> >>>>>>> it will a little big change. >>>>>> >>>>>> Right, but if we handle it like we do with TSRMLS_C throughout the code >>>>>> and always set that %parse-param to this new magic macro we make up and >>>>>> have it point to void *compiler_globals for zendparse() under ZTS mode >>>>>> and void otherwise and make sure it is (re)defined correctly in other >>>>>> places? It might mean we need to refactor zenderror() to take a dummy >>>>>> first arg since it seems to prepend the parse-param type there. Messy. >>>>> >>>>> Hmm, seems fine, a patch is attached: >>>>> https://bugs.php.net/patch-display.php?bug_id=64503&patch=bison_build.patch&revision=latest >>>>> >>>>> >>>>> but there must be some unused parameter term_ls while in non-zts build... >>>> unused parameter warning I mean, :) >>> hmm, how stupid I was, hehe , simply: >>> >>> #ifndef ZTS >>> (void)tsrm_ls; >>> #endif >> >> Commit it to master so we can play with it. I think this is the right >> approach and we can pull it into 5.5b2. It would be really nice to have >> bison 2.6/2.7 support in 5.5. >> >> -Rasmus >> > Hey: > after a deep look, it seems bison 2.7 still supports > YYPARSE_PARAM, the different is, it starts to write the declaration > of yyparse into parse.h > > so, we also needs the YYPARSE_PARAM defination into parse.h. > > following patch also works: > attached here: https://bugs.php.net/patch-display.php?bug_id=64503&patch=bison_build_2.patch&revision=latest thanks > diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y > index ccbc9b1..3424fa7 100644 > --- a/Zend/zend_language_parser.y > +++ b/Zend/zend_language_parser.y > @@ -38,16 +38,17 @@ > #define YYSIZE_T size_t > #define yytnamerr zend_yytnamerr > static YYSIZE_T zend_yytnamerr(char*, const char*); > - > #define YYERROR_VERBOSE > #define YYSTYPE znode > + > +%} > + > +%code requires { > #ifdef ZTS > # define YYPARSE_PARAM tsrm_ls > # define YYLEX_PARAM tsrm_ls > #endif > - > - > -%} > +} > > %pure_parser > %expect 3 > > > could you verify it? > > > -- > Laruence Xinchen Hui > http://www.laruence.com/ -- Laruence Xinchen Hui http://www.laruence.com/