Bug #66204 [NEW]: disabling XPM support in GD still enables gdImageCreateFromXpm() for PHP

From: Date: Fri, 29 Nov 2013 15:33:37 +0000
Subject: Bug #66204 [NEW]: disabling XPM support in GD still enables gdImageCreateFromXpm() for PHP
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183012@lists.php.net to get a copy of this message
From:             rob dot de dot langhe at twistfare dot be
Operating system: Solaris-10
PHP version:      5.5.6
Package:          GD related
Bug Type:         Bug
Bug description:disabling XPM support in GD still enables gdImageCreateFromXpm() for PHP

Description:
------------
We do not want to include X11 (XPM) support.

So we built the LIBGD library (version 2.1.0) with GCC (version 4.7.1)
using both the flags "--with-xpm=no --without-xpm"
However the generated library "libgd.so.3.0.0" still contains a function
"gdImageCreateFromXpm()" which is used by PHP to see if XPM is anyhow
available in the "libgd" library:

When building the PHP version 5.5.6 using the flag "--with-xpm-dir=no"
gives the following output from "configure" :
...
configure:37479: checking for the location of libXpm
configure:37494: result: no
...
configure:42617: checking for gdImageCreateFromXpm in -lgd
configure:42642: /our_base_dir/bin/gcc -o conftest -m32
-I/our_base_dir/include -fvisibility=hidden  -D_POSIX_PTHREAD_SEMANTICS
-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -L/our_base_dir/lib -lxml2 -m32
-R/usr/ucblib -L/usr/ucblib
-R/our_base_dir/lib/gcc/sparc-sun-solaris2.10/4.7.1 -L/
our_base_dir/lib/gcc/sparc-sun-solaris2.10/4.7.1 -R/our_base_dir/lib
-L/our_base_dir/lib conftest.c -lgd  -lgd -lpng -lz -lpng -lz -lz -lrt
-lm -lnsl -lsocket  -lgcc -lxml2 -lz -lm -lso
cket -lnsl -lxml2 -lz -lm -lsocket -lnsl >&5
configure:42642: $? = 0
configure:42651: result: yes
...

With the "conftest.c" file containing a call to that function
"gdImageCreateFromXpm()", to see if the compiler finds that function in
the "libgd.so.3.0.0" library, which it does despite that we disabled the
support for XPM in the building of LIBGD.

$ cat conftest.c
#ifdef __cplusplus
extern "C"
#endif
char gdImageCreateFromXpm ();
int
main ()
{
return gdImageCreateFromXpm ();
  ;
  return 0;
}

After "configure" is done, the "config.status" contains the flag
D["HAVE_GD_XPM"]=" 1"
so that PHP will attempt to build with X11 support, and fails during
compilation because we do not (and don't want) have the X11 libraries
installed:

$ make
...
/bin/bash /our_base_dir/src/php-5.5.6/libtool --silent
--preserve-dup-deps --mode=compile /our_base_dir/bin/gcc
-I/our_base_dir/include -Iext/gd/ -I/our_base_dir/src/php-5.5.6/ext/gd/
-DPHP_ATOM_INC -I/our_base_dir/src/php-5.5.6/include
-I/our_base_dir/src/php-5.5.6/main -I/our_base_dir/src/php-5.5.6
-I/our_base_dir/src/php-5.5.6/ext/date/lib
-I/our_base_dir/src/php-5.5.6/ext/ereg/regex -I/usr/include/libxml2
-I/our_base_dir/include
-I/our_base_dir/src/php-5.5.6/ext/sqlite3/libsqlite
-I/our_base_dir/src/php-5.5.6/TSRM -I/our_base_dir/src/php-5.5.6/Zend 
-D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT  -m32
-I/our_base_dir/include -fvisibility=hidden -DZTS  -c
/our_base_dir/src/php-5.5.6/ext/gd/gd.c -o ext/gd/gd.lo
/bin/bash /our_base_dir/src/php-5.5.6/libtool --silent
--preserve-dup-deps --mode=compile /our_base_dir/bin/gcc
-I/our_base_dir/include -Iext/gd/ -I/our_base_dir/src/php-5.5.6/ext/gd/
-DPHP_ATOM_INC -I/our_base_dir/src/php-5.5.6/include
-I/our_base_dir/src/php-5.5.6/main -I/our_base_dir/src/php-5.5.6
-I/our_base_dir/src/php-5.5.6/ext/date/lib
-I/our_base_dir/src/php-5.5.6/ext/ereg/regex -I/usr/include/libxml2
-I/our_base_dir/include
-I/our_base_dir/src/php-5.5.6/ext/sqlite3/libsqlite
-I/our_base_dir/src/php-5.5.6/TSRM -I/our_base_dir/src/php-5.5.6/Zend 
-D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT  -m32
-I/our_base_dir/include -fvisibility=hidden -DZTS  -c
/our_base_dir/src/php-5.5.6/ext/gd/gd_compat.c -o ext/gd/gd_compat.lo
/our_base_dir/src/php-5.5.6/ext/gd/gd.c:57:22: fatal error: X11/xpm.h:
No such file or directory

Any idea how we can really force the disabling of XPM support in the
libgd library ?


Expected result:
----------------
A way to really disable the XPM support in the libgd library.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=66204&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66204&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66204&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66204&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66204&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66204&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66204&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66204&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66204&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66204&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66204&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66204&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66204&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66204&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66204&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66204&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66204&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66204&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66204&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66204&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66204&r=mysqlcfg



Thread (8 messages)

« previous php.bugs (#183012) next »