Bug #18248 Updated: build problem after upgrade to GD2
| From: | sniper@php.net | Date: | Fri, 12 Jul 2002 01:58:20 +0000 |
| Subject: | Bug #18248 Updated: build problem after upgrade to GD2 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13896@lists.php.net to get a copy of this message | ||
ID: 18248
Updated by: sniper@php.net
Reported By: nospam@1111-internet.com
-Status: Feedback
+Status: Closed
Bug Type: GD related
Operating System: FreeBSD 4.0
PHP Version: 4.2.1
New Comment:
The precedence actually _is_ to use .so before .a, IIRC.
Anyway, having different versions of same library (be it static/shared)
in libpath is always a headache which is almost impossible to detect.
And sysadmins should be aware
of this too..
Previous Comments:
------------------------------------------------------------------------
[2002-07-11 17:46:49] nospam@1111-internet.com
I think between your suggestions and some more sleuthing on my end I
may have resolved this problem...
I had both an old libjpeg.a and a newer libjpeg.so in /usr/local/lib -
the php config was favoring libjpeg.a which I think caused the problem
with multiple definitions of jpeg functions as I cited earlier. Getting
rid of the libjpeg.a and essentially forcing php to honor the
inherently shared libjpeg.so allowed the build and install with my full
desired configuration to go through successfully. I've yet to test the
new gd functions, but I'm encouraged that they will work fine.
I might suggest that you change the build process to give precedence to
lib<whatever>.so over lib<whatever>.a if both exist, rather than the
other way around. I'd imagine it would save a lot of people a lot of
headaches.
Otherwise feel free to close this bug.
Thanks much!
Chuck
------------------------------------------------------------------------
[2002-07-10 21:39:04] sniper@php.net
First of all, these configure options: --with-zlib-dir and
--with-jpeg-dir don't accept anything else but a path.
'shared' is not useful with these.
Second, did you clean up your system of all the
remains of the old GD before installing new version?
Then try with ONLY the GD related configure options.
(without mcrypt, pdflib, ftp)
------------------------------------------------------------------------
[2002-07-10 18:40:55] nospam@1111-internet.com
I tried all of the following combinations (plus the other config
options indicated in my original report) using snapshot
"php4-200207091500" and got the following results - none of which solve
my original problem:
--with-gd=/usr/local, --with-jpeg-dir: Result A
--with-gd=/usr/local, --with-jpeg-dir=/usr/local: Result A
--with-gd=/usr/local, --with-jpeg-dir=shared: Result A
--with-gd=/usr/local, no --with-jpeg-dir: Result C
--with-gd=php, --with-jpeg-dir: Result A
--with-gd=php, --with-jpeg-dir=/usr/local: Result A
--with-gd=php, --with-jpeg-dir=shared: Result A
--with-gd=php, no --with-jpeg-dir: Result D
no --with-gd, --with-jpeg-dir: Result B
no --with-gd, --with-jpeg-dir=/usr/local: Result B
no --with-gd, --with-jpeg-dir=shared: Result B
no --with-gd, no --with-jpeg-dir: Result B
Result A:
stops at
jpeg function multiple definitions
Result B:
stops at
ext/mysql/libmysql/my_tempnam.lo: In function `my_tempnam':
/usr/local/src/php_src/php4-200207091500/ext/mysql/libmysql/my_tempnam.c(.text+0x51):
warning: tempnam() possibly used unsafely; consider using mkstemp()
(I think this build is successful and this message is a warning only -
but this only arises when --with-gd is not included)
Result C:
stops at
checking for mcrypt support... yes
checking for mcrypt_module_open in -lmcrypt... no
checking for init_mcrypt in -lmcrypt... no
configure: error: Sorry, I was not able to diagnose which libmcrypt
version you have installed.
gmake: *** No targets specified and no makefile found. Stop.
Result D:
stops at
ext/mysql/libmysql/my_tempnam.lo: In function `my_tempnam':
/usr/local/src/php_src/php4-200207091500/ext/mysql/libmysql/my_tempnam.c(.text+0x51):
warning: tempnam() possibly used unsafely; consider using mkstemp()
ext/gd/gd.lo: In function `php_imagettftext_common':
/usr/local/src/php_src/php4-200207091500/ext/gd/gd.c(.text+0x9413):
undefined reference to `gdttf'
gmake: *** [sapi/cli/php] Error 1
------------------------------------------------------------------------
[2002-07-09 18:49:13] sniper@php.net
Does this happen with this snapshot:
http://snaps.php.net/php4-latest.tar.gz
And when NOT using --with-gd=php
------------------------------------------------------------------------
[2002-07-09 14:27:56] nospam@1111-internet.com
I got some more clues from the tail of the config.log - which is
included below. I had previously been having problems with the
--with-jpeg-dir configure line when I recently upgraded from php 4.0.6
to 4.2.1 - whereby using --with-jpeg-dir=/usr/local started producing
errors with multiple definitions of about 100 jpeg-related functions
right at the end of the configure process, i.e.:
/usr/local/lib/libjpeg.a(jcapimin.o): In function
`jpeg_CreateCompress':
jcapimin.o(.text+0x0): multiple definition of `jpeg_CreateCompress'
/usr/local/lib/libjpeg.a(jcapimin.o)(.text+0x0): first defined here
/usr/local/lib/libjpeg.a(jcapimin.o): In function
`jpeg_destroy_compress':
jcapimin.o(.text+0x114): multiple definition of
`jpeg_destroy_compress'
/usr/local/lib/libjpeg.a(jcapimin.o)(.text+0x114): first defined here
(...)
I figured that this was due to the fact that --with-jpeg-dir can apply
to both gd and directly to the php configuration, so I changed the
configuration to --with-jpeg-dir=shared, which made everything work ok
- until the new mcrypt problems arose when I changed to gd 2.0.1.
Reverting the configuration to --with-jpeg-dir=/usr/local with gd 2.0.1
gets me past the mcrypt problem but still runs into the multiple
function definition problem which kills the build.
So I suspect that this whole thing might actually be a config issue
with libjpeg...
Here's the aforementioned config.log tail:
(gd functions are tested and confirmed)
(...)
configure:34119: checking for mcrypt support
configure:34181: checking for mcrypt_module_open in -lmcrypt
configure:34200: gcc -o conftest -g -O2 -DMOD_SSL=208108 -DEAPI
-DUSE_EXPAT
-L/usr/local/lib -lltdl
-R/usr/local/lib -L/usr/local/lib conftest.c -lmcrypt -lgd -lttf
-lpng -lz -lz -lcrypt -lm -lcrypt 1>&5
/usr/local/lib/libgd.so: undefined reference to `jpeg_read_scanlines'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_simple_progression'
/usr/local/lib/libgd.so: undefined reference to `jpeg_set_defaults'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_start_decompress'
/usr/local/lib/libgd.so: undefined reference to `jpeg_destroy'
/usr/local/lib/libgd.so: undefined reference to `jpeg_write_marker'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_destroy_decompress'
/usr/local/lib/libgd.so: undefined reference to `jpeg_std_error'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_CreateDecompress'
/usr/local/lib/libgd.so: undefined reference to `jpeg_read_header'
/usr/local/lib/libgd.so: undefined reference to `jpeg_start_compress'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_destroy_compress'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_finish_decompress'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_resync_to_restart'
/usr/local/lib/libgd.so: undefined reference to `jpeg_CreateCompress'
/usr/local/lib/libgd.so: undefined reference to `jpeg_finish_compress'
/usr/local/lib/libgd.so: undefined reference to `jpeg_set_quality'
/usr/local/lib/libgd.so: undefined reference to `jpeg_write_scanlines'
configure: failed program was:
#line 34189 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char mcrypt_module_open();
int main() {
mcrypt_module_open()
; return 0; }
configure:34321: checking for init_mcrypt in -lmcrypt
configure:34340: gcc -o conftest -g -O2 -DMOD_SSL=208108 -DEAPI
-DUSE_EXPAT
-L/usr/local/lib
-R/usr/local/lib -L/usr/local/lib conftest.c -lmcrypt -lgd -lttf
-lpng -lz -lz -lcrypt -lm -lcrypt 1>&5
/usr/local/lib/libgd.so: undefined reference to `jpeg_read_scanlines'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_simple_progression'
/usr/local/lib/libgd.so: undefined reference to `jpeg_set_defaults'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_start_decompress'
/usr/local/lib/libgd.so: undefined reference to `jpeg_destroy'
/usr/local/lib/libmcrypt.so: undefined reference to `lt_dlerror'
/usr/local/lib/libgd.so: undefined reference to `jpeg_write_marker'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_destroy_decompress'
/usr/local/lib/libgd.so: undefined reference to `jpeg_std_error'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_CreateDecompress'
/usr/local/lib/libmcrypt.so: undefined reference to `lt_dlclose'
/usr/local/lib/libgd.so: undefined reference to `jpeg_read_header'
/usr/local/lib/libgd.so: undefined reference to `jpeg_start_compress'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_destroy_compress'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_finish_decompress'
/usr/local/lib/libgd.so: undefined reference to
`jpeg_resync_to_restart'
/usr/local/lib/libgd.so: undefined reference to `jpeg_CreateCompress'
/usr/local/lib/libmcrypt.so: undefined reference to `lt_dlexit'
/usr/local/lib/libgd.so: undefined reference to `jpeg_finish_compress'
/usr/local/lib/libmcrypt.so: undefined reference to
`lt_dlsetsearchpath'
/usr/local/lib/libmcrypt.so: undefined reference to `lt_dlopenext'
/usr/local/lib/libmcrypt.so: undefined reference to `lt_dlsym'
/usr/local/lib/libgd.so: undefined reference to `jpeg_set_quality'
/usr/local/lib/libgd.so: undefined reference to `jpeg_write_scanlines'
/usr/local/lib/libmcrypt.so: undefined reference to `lt_dlinit'
configure: failed program was:
#line 34329 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char init_mcrypt();
int main() {
init_mcrypt()
; return 0; }
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18248
--
Edit this bug report at http://bugs.php.net/?id=18248&edit=1