php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60108 GD cannot be compiled with system libgd
Submitted: 2011-10-21 12:13 UTC Modified: 2013-02-18 00:35 UTC
Votes:46
Avg. Score:4.7 ± 0.7
Reproduced:44 of 45 (97.8%)
Same Version:17 (38.6%)
Same OS:25 (56.8%)
From: ondrej@php.net Assigned: pajoye (profile)
Status: No Feedback Package: GD related
PHP Version: 5.4.0beta2 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ondrej@php.net
New email:
PHP Version: OS:

 

 [2011-10-21 12:13 UTC] ondrej@php.net
Description:
------------
When compiled with system-wide (not embedded) libgd library the compilation fails with:

In file included from /tmp/buildd/php5-5.4.0~beta2/ext/gd/gd.c:103:0:
/tmp/buildd/php5-5.4.0~beta2/ext/gd/gd_ctx.c: In function '_php_image_stream_putc':
/tmp/buildd/php5-5.4.0~beta2/ext/gd/gd_ctx.c:51:41: error: 'struct gdIOCtx' has no member named 'data'
/tmp/buildd/php5-5.4.0~beta2/ext/gd/gd_ctx.c: In function '_php_image_stream_putbuf':
/tmp/buildd/php5-5.4.0~beta2/ext/gd/gd_ctx.c:58:41: error: 'struct gdIOCtx' has no member named 'data'
/tmp/buildd/php5-5.4.0~beta2/ext/gd/gd_ctx.c: In function '_php_image_stream_ctxfree':
/tmp/buildd/php5-5.4.0~beta2/ext/gd/gd_ctx.c:67:8: error: 'struct gdIOCtx' has no member named 'data'
/tmp/buildd/php5-5.4.0~beta2/ext/gd/gd_ctx.c:68:3: error: 'struct gdIOCtx' has no member named 'data'
/tmp/buildd/php5-5.4.0~beta2/ext/gd/gd_ctx.c:69:6: error: 'struct gdIOCtx' has no member named 'data'
In file included from /tmp/buildd/php5-5.4.0~beta2/ext/gd/gd.c:103:0:
/tmp/buildd/php5-5.4.0~beta2/ext/gd/gd_ctx.c: In function '_php_image_output_ctx':
/tmp/buildd/php5-5.4.0~beta2/ext/gd/gd_ctx.c:153:6: error: 'gdIOCtx' has no member named 'data'


You need to wrap the _stream_ stuff inside the #ifdef HAVE_GD_BUNDLED



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-16 08:15 UTC] brad at njoe dot com
Confirmed the same build errors against the latest snapshot (php5.4-
2011111160530) with a system-wide libgd installed (version 2.0.36 versus the 
bundled 2.0.35).

I also noted that the standard libgd version 2.0.35 doesn't include the 'void 
*data' member in the gdIOCtx struct. Modifying my /usr/include/gd_io.h to 
include this struct member seems to have also fixed(?) the build error, but that 
made me wonder...

... Why is the "bundled" libgd more of a "bundled+customized-for-PHP" library? 
It would seem that the 'void *data' member was introduced by the PHP dev team, 
unless I'm mistaken. Is this member's data important, and, if so, why is the 
"bundled" library modified to contain it (meaning that you really don't have an 
option between using the "bundled" library or your own system-wide version).
 [2011-11-16 10:07 UTC] pajoye@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: pajoye
 [2012-04-17 19:48 UTC] bero at bero dot eu
Problem still occurs in php 5.4.1-RC2.

Given apparently gd is maintained by php people these days, maybe the best fix is to make a new gd release containing all needed bits?
 [2012-11-21 22:48 UTC] public at petergeil dot name
Confirmed ... problem still occurs in latest 5.4.8 release when compiled on Ubuntu 10.04 amd64 against libgd2-noxpm 2.0.36~rc1. However, adding a data member to gdIOCtx struct helps. (Thanks Brad)
 [2012-11-22 06:07 UTC] laruence@php.net
ondrej, seems you have got a fix? could you make a patch for that?

thanks
 [2012-11-22 10:09 UTC] pajoye@php.net
-Status: Assigned +Status: Feedback
 [2012-11-22 10:09 UTC] pajoye@php.net
The fix is not only about adding that as far as I remember. Some refactoring in 
the ctx code would be necessary or drop stream output support completely when the 
system GD (<2.1) is used.

I wonder if adding the data member to the ctx struct in 2.0.x would break the ABI. 
I think it won't. Thoughts? That could be the most easier fix, and forward 
compatible by keeping stream output support for system gd users.
 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 07 03:01:26 2024 UTC