php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29190 OpenSSL include path cause FreeType 1 headers to be found instead of FreeType 2
Submitted: 2004-07-15 20:15 UTC Modified: 2005-03-06 20:48 UTC
From: Bjorn dot Wiberg at its dot uu dot se Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.0.3 OS: IBM AIX 5.2.0.0 ML5
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: Bjorn dot Wiberg at its dot uu dot se
New email:
PHP Version: OS:

 

 [2004-07-15 20:15 UTC] Bjorn dot Wiberg at its dot uu dot se
Description:
------------
If OpenSSL support is configured (OpenSSL installed from RPM), and both FreeType 1 and 2 are installed on the system, OpenSSL causes GDLIB_CFLAGS to list -I/opt/freeware/include before -I/usr/include/freetype2, such that the chosen FreeType version (2) accidentally includes /opt/freeware/include/freetype/freetype.h (from FreeType 1.x) instead of the correct one, /usr/include/freetype2/freetype/freetype.h (from FreeType 2).

This causes a compile failure.


Reproduce code:
---------------
Install RPMs "openssl-0.9.6m-1" and "openssl-devel-0.9.6m-1" (or later) from http://www.bullfreeware.com/listaix52.html.

Configure PHP 5 with the following directives (from config.nice):

CPPFLAGS='-I/usr/local/include' \
LDFLAGS='-L/lib -L/opt/freeware/lib -L/usr/local/lib' \
CC='/usr/local/bin/gcc' \
'./configure' \
'--enable-bcmath' \
'--enable-calendar' \
'--enable-dba' \
'--enable-exif' \
'--enable-embedded-mysqli' \
'--enable-debug' \
'--enable-filepro' \
'--enable-gd-jis-conv' \
'--enable-gd-native-ttf' \
'--enable-mbstring' \
'--enable-memory-limit' \
'--enable-versioning' \
'--enable-zend-multibyte' \
'--prefix=/apache/php' \
'--with-apxs2=/apache/bin/apxs' \
'--with-apxs2filter=/apache/bin/apxs' \
'--with-freetype-dir' \
'--with-gd' \
'--with-gdbm' \
'--with-gettext' \
'--with-inifile' \
'--with-jpeg-dir' \
'--with-ldap' \
'--with-libxml-dir' \
'--with-mime-magic' \
'--with-mnogosearch' \
'--with-mysql=/usr/local/mysql' \
'--with-openssl=/opt/freeware' \
'--with-png-dir' \
'--with-tiff-dir' \
'--with-ttf' \
'--with-xpm-dir' \
'--with-zlib' \
'--with-zlib-dir'

Notice the "--with-openssl" path and "--with-freetype-dir".

Compile with 'make'.

Expected result:
----------------
Compilation success.

Actual result:
--------------
Excerpt from 'make':

...
/usr/local/bin/gcc -I/usr/local/src/php-5.0.0/ext/gd/libgd -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_XPM -DHAVE_LIBFREETYPE -DJISX0208 -Iext/gd/ -I/usr/local/src/php-5.0.0/ext/gd/ -DPHP_ATOM_INC -I/usr/local/src/php-5.0.0/include -I/usr/local/src/php-5.0.0/main -I/usr/local/src/php-5.0.0 -I/usr/local/src/php-5.0.0/Zend -I/opt/freeware/include/libxml2 -I/opt/freeware/include -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/local/src/php-5.0.0/ext/mbstring/oniguruma -I/usr/local/src/php-5.0.0/ext/mbstring/libmbfl -I/usr/local/src/php-5.0.0/ext/mbstring/libmbfl/mbfl -I/usr/local/mnogosearch/include -I/usr/local/mysql/include/mysql -I/usr/local/include -I/usr/local/src/php-5.0.0/TSRM -g -Wall -c /usr/local/src/php-5.0.0/ext/gd/gd.c  -DPIC -o ext/gd/gd.lo
/usr/local/src/php-5.0.0/ext/gd/gd.c: In function `zm_info_gd':
/usr/local/src/php-5.0.0/ext/gd/gd.c:487: error: `FREETYPE_MAJOR' undeclared (first use in this function)
/usr/local/src/php-5.0.0/ext/gd/gd.c:487: error: (Each undeclared identifier is reported only once
/usr/local/src/php-5.0.0/ext/gd/gd.c:487: error: for each function it appears in.)
/usr/local/src/php-5.0.0/ext/gd/gd.c:487: error: `FREETYPE_MINOR' undeclared (first use in this function)
/usr/local/src/php-5.0.0/ext/gd/gd.c: At top level:
/usr/local/src/php-5.0.0/TSRM/tsrm_virtual_cwd.h:182: warning: `php_realpath_hack' defined but not used
make: The error code from the last command is 1.


Stop.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-15 20:19 UTC] Bjorn dot Wiberg at its dot uu dot se
A "manual" solution is to edit the Makefile after running configure, making sure that the GDLIB_CFLAGS line starts with:

GDLIB_CFLAGS = -I/usr/include/freetype2

...followed by whatever was on that line previously.

It would be nice if the configure script somehow would put FreeType include paths before the OpenSSL ones, as that would solve the problem permanently.

Best regards,
Bj?rn
 [2004-07-15 20:26 UTC] Bjorn dot Wiberg at its dot uu dot se
Similar errors (of course) occur with PHP 4.3.8 on the same system:


...
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1066: error: `ft_kerning_default' u
ndeclared (first use in this function)
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1066: error: `delta' undeclared (fi
rst use in this function)
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1072: warning: implicit declaration
 of function `FT_Load_Glyph'
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1084: error: `glyph_bbox' undeclare
d (first use in this function)
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1115: error: dereferencing pointer
to incomplete type
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1115: error: `ft_glyph_format_bitma
p' undeclared (first use in this function)
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1115: error: `ft_render_mode_normal
' undeclared (first use in this function)
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1126: error: dereferencing pointer
to incomplete type
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1126: error: dereferencing pointer
to incomplete type
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1126: error: dereferencing pointer
to incomplete type
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1133: error: dereferencing pointer
to incomplete type
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c:1134: error: dereferencing pointer
to incomplete type
/usr/local/src/php-4.3.8/ext/gd/libgd/gdft.c: At top level:
/usr/local/src/php-4.3.8/TSRM/tsrm_virtual_cwd.h:170: warning: `php_realpath_hac
k' defined but not used
make: The error code from the last command is 1.


Stop.


The solution is the same one, i.e., to change the GDLIB_CFLAGS line in the Makefile after running configure.

Best regards,
Bj?rn
 [2005-02-11 10:58 UTC] Bjorn dot Wiberg at its dot uu dot se
Hello Tony!

I just tried with php5-STABLE-200502110730; unfortunately, the problem is still there:

/../

/bin/sh /usr/local/src/php5-STABLE-200502110730/libtool --silent --preserve-dup-deps --mode=compile /usr/local/bin/gcc -I/usr/local/src/php5-STABLE-200502110730/ext/gd/libgd -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_XPM -DHAVE_LIBFREETYPE -DJISX0208 -Iext/gd/ -I/usr/local/src/php5-STABLE-200502110730/ext/gd/ -DPHP_ATOM_INC -I/usr/local/src/php5-STABLE-200502110730/include -I/usr/local/src/php5-STABLE-200502110730/main -I/usr/local/src/php5-STABLE-200502110730 -I/usr/local/src/php5-STABLE-200502110730/Zend -I/opt/freeware/include/libxml2 -I/opt/freeware/include -I/usr/local/include -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/local/src/php5-STABLE-200502110730/ext/mbstring/oniguruma -I/usr/local/src/php5-STABLE-200502110730/ext/mbstring/libmbfl -I/usr/local/src/php5-STABLE-200502110730/ext/mbstring/libmbfl/mbfl -I/usr/local/mnogosearch/include -I/usr/local/mysql/include/mysql  -I/usr/local/include -I/usr/local/src/php5-STABLE-200502110730/TSRM  -g -O2   -c /usr/local/src/php5-STABLE-200502110730/ext/gd/gd.c -o ext/gd/gd.lo 
/usr/local/src/php5-STABLE-200502110730/ext/gd/gd.c: In function `zm_info_gd':
/usr/local/src/php5-STABLE-200502110730/ext/gd/gd.c:504: error: `FREETYPE_MAJOR' undeclared (first use in this function)
/usr/local/src/php5-STABLE-200502110730/ext/gd/gd.c:504: error: (Each undeclared identifier is reported only once
/usr/local/src/php5-STABLE-200502110730/ext/gd/gd.c:504: error: for each function it appears in.)
/usr/local/src/php5-STABLE-200502110730/ext/gd/gd.c:504: error: `FREETYPE_MINOR' undeclared (first use in this function)
make: *** [ext/gd/gd.lo] Error 1
root@spinus:/usr/local/src/php5-STABLE-200502110730#

/../

An excerpt from the generated Makefile shows GDLIB_CFLAGS as:

GDLIB_CFLAGS = -I/usr/local/src/php5-STABLE-200502110730/ext/gd/libgd -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_XPM -DHAVE_LIBFREETYPE -DJISX0208

The -I for FreeType seems to be gone there (a change from e.g. PHP 5.0.3). Instead, the INCLUDES line reads:

INCLUDES = -I$(top_builddir)/Zend -I/opt/freeware/include/libxml2 -I/opt/freeware/include -I/usr/local/include -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/local/src/php5-STABLE-200502110730/ext/mbstring/oniguruma -I/usr/local/src/php5-STABLE-200502110730/ext/mbstring/libmbfl -I/usr/local/src/php5-STABLE-200502110730/ext/mbstring/libmbfl/mbfl -I/usr/local/mnogosearch/include -I/usr/local/mysql/include/mysql

However, as you can see, the -I/opt/freeware/include still appears before -I/usr/lib/freetype2, which causes the problem.

I'd be happy to try compiling again whenever you want me to.

Best regards,
Bj?rn
 [2005-03-06 20:48 UTC] sniper@php.net
Bogus installations of some wierd RPMs are not any PHP problem. Install the stuff from sources and make sure you don't have multiple versions of headers/libraries of ANY software in your system relating to PHP.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Sep 19 18:01:27 2024 UTC