php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6464 Compilation w/ curl support fails with _gd_parse error (?)
Submitted: 2000-08-31 08:55 UTC Modified: 2000-12-08 12:48 UTC
From: cahagn_o at epita dot fr Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.0.2 OS: NetBSD 1.3.3
Private report: No CVE-ID: None
 [2000-08-31 08:55 UTC] cahagn_o at epita dot fr
Hi,

OS: NetBSD 1.3.3 x86
gcc: 2.7.2.2+myc2
PHP: 4.0.2

Here's the configure line:

./configure --without-gd --with-curl=/u/guest/www/mbin/i386-NetBSD/

Compiling with or without GD provokes the same failure.
Curl is v.7.1.1 (I also tried v.7.1) and is installed with default parameters (m
ake install) so I guess every include and lib file are present.

GD support works fine when I configure it (GD 1.8.3+png+jpeg)

I'd be happy to see a more detailed config.log about curl support:

configure:9238: checking for CURL support

Here's a little warning:

In file included from /nfs/s5/space/users/guest/www/compil/php-4.0.2/ext/curl/php_curl.h:31, from internal_functions.c:47:
/u/guest/www/mbin/i386-NetBSD/include/curl/curl.h:175: warning: `T' redefined

Here're the warnings that make the compilation fail, this is the final linking step:

/usr/lib/bison.simple:249: Definition of symbol `_gd_parse' (multiply defined) 
/usr/local/share/bison.simple:249: Definition of symbol `_gd_parse' (multiply defined) 

Even though I do not have bison and do not have this file /usr/lib/bison.simple neither the other one.

There seems to be other problems (similar warnings) with this version of gcc (see next bug report :)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-04 19:10 UTC] cahagn_o at epita dot fr
I just tested snapshot php4-200009041145 and it's not
related to GD support. It's rather a parser (bison) issue.
This only appears when compiling Curl support though.

Now that #line lines got removed from current snapshot (it
used to complain with gcc 2.7.2.2), I now get these final
warnings and failure:

parsedate.c:619: Definition of symbol `_gd_parse' (multiply
defined)
/usr/local/share/bison.simple:249: Definition of symbol
`_gd_parse' (multiply defined)
*** Error code 1

Stop.
*** Error code 1

Stop.

I still can't find any reference to
/usr/local/share/bison.simple in the current PHP code. (of
couse, I don't have this file).
I think that's again a #line somewhere or something that gcc
2.7.2.2 don't appreciate.

Don't know about parsedate.c warning and why it only happens
when compiling curl support.

I still have another curl-specifc warning but it's not
relevant here I think:

In file included from
/nfs/s5/space/users/guest/www/compil/php-4.0.2/ext/curl/php_curl.h:31,
from internal_functions.c:47:
/u/guest/www/mbin/i386-NetBSD/include/curl/curl.h:175:
warning: `T' redefined
 [2000-09-10 18:31 UTC] sterling@php.net
Try updating bison to the latest version and seeing whether it still happens
 [2000-09-12 00:48 UTC] cahagn_o at epita dot fr
As stated in the bug report, I _don't_ have bison installed
on this machine. Zeev told me it's not needed anyway.
(see no aggresivity in this statement, it's just to make
myself clear as the previous bug report might have been
confusing :)

I tried latest php snapshot 200009110745 with ./configure
--with-curl=/path/to/curl

I also recompiled cURL 7.2.1 and removed every #line
directive in lib/getdate.c as it gives warnings with gcc
2.7.2.2 here (see bug #6465)

I now get these warnings when linking php:

parsedate.c:619: Definition of symbol `_gd_parse' (multiply
defined)
getdate.y:617: Definition of symbol `_gd_parse' (multiply
defined)

getdate.y is in cURL distribution and it contains one
reference to _gd_parse:

pc1: ~/php/curl-7.2.1 % rgrep gd_parse *
lib/getdate.y:#define yyparse gd_parse
lib/getdate.c:#define yyparse gd_parse

I shouldn't need to have bison and regenerate the parser. I
tried anyway on another box with bison 1.28 and then
recompiled from scratch on NetBSD with gcc 2.7.2.2 and got
the same warnings.

I'm trying to reach cURL's author to see if and how I can
solve this problem.
 [2000-10-02 23:25 UTC] sniper@php.net
What is the situation with this??

--Jani
 [2000-10-04 18:39 UTC] cahagn_o at epita dot fr
The problem still occurs with cURL 7.3 and PHP4.0.3RC2 or
latest snapshot.

parsedate.c:619: Definition of symbol `_gd_parse' (multiply
defined)
getdate.y:617: Definition of symbol `_gd_parse' (multiply
defined)

parsedate.c defines gd_parse in PHP source.
getdate.y (.c) defines gd_parse in cURL source.

I tried regenerating cURL getdate.c from getdate.y with yacc
but the problem still occurs.

Here's a note from cURL source (getdate.y), it might help
understand what happens (I use old gcc 2.7.2.2):

/* Remap normal yacc parser interface names (yyparse, yylex,
yyerror, etc), as well as gratuitiously global symbol names,
so we can have multiple yacc generated parsers in the same
program.  Note that these are only the variables produced by
yacc.  If other parser generators (bison, byacc, etc)
produce additional global names that conflict at link time,
then those parser generators need to be fixed instead of
adding those names to this list. */

#define yymaxdepth gd_maxdepth
#define yyparse gd_parse

Is there any expert in yacc/bison here ? :)

 [2000-12-07 04:00 UTC] sniper@php.net
Is this still happening with PHP4.0.4RC4?? 
(I can't reproduce this..)

--Jani
 [2000-12-07 05:15 UTC] cahagn_o at epita dot fr
Just tested RC4 --with-curl (7.3 I guess)

One build warning I did not have before:

curl.c: In function `php_if_curl_init':
curl.c:303: warning: passing arg 3 of `zend_llist_init' from
incompatible pointer type

And still the same fatal warning when linking:

parsedate.c:619: Definition of symbol `_gd_parse' (multiply
defined)
y.tab.c:1102: Definition of symbol `_gd_parse' (multiply
defined)

./configure
--with-config-file-path=/usr/www/etc/httpd/conf/php_cgi \
            --enable-discard-path \
            --without-mysql \
            --with-curl=/u/guest/www/mbin/i386-NetBSD

You can consider closing this bug unfortunately because:
 - I won't have the time to test PHP on this particular
platform in the future (it takes 1 hour to build !)
 - Adding cURL support would increase the PHP binary even
more and slowing down its execution (running as CGI).

It's really related to old version of gcc, and the file
indicated in previous updates.
 [2000-12-07 19:05 UTC] sniper@php.net
Ok. I'll make this one duplicate of #8146.

--Jani
 [2000-12-08 12:48 UTC] cahagn_o at epita dot fr
Fixed thanks to Sacha's fix seen on bug #8416.

It now compiles fine.
I onlt have a minor warning left with cURL which I didn't
have 1 month ago:

curl.c: In function `php_if_curl_init':
curl.c:303: warning: passing arg 3 of `zend_llist_init' from
incompatible pointer type

Thanks a lot. I hope I had the rights to close this bug
otherwise you may consider closing it.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 23:00:02 2026 UTC