Bug #81032 [NEW]: GD install is affected by external libgd installation
| From: | flaviohbatista at gmail dot com | Date: | Tue, 11 May 2021 23:51:57 +0000 |
| Subject: | Bug #81032 [NEW]: GD install is affected by external libgd installation | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-233789@lists.php.net to get a copy of this message | ||
From: flaviohbatista at gmail dot com
Operating system: MacOS
PHP version: Irrelevant
Package: GD related
Bug Type: Bug
Bug description:GD install is affected by external libgd installation
Description:
------------
Description:
When installing the GD extension using the bundled libgd, if any of the
libraries used by libgd (e.g. libjpeg), are installed in a path that
also happen to have a libgd installation, the extension code will
include the external libgd files instead of the local ones.
Example:
1. Assume that
libjpeg is installed at /usr/local/include;
2. Assume that libgd is also installed at /usr/local/include;
3. The build system will add /usr/local/include to CFLAGS (through
pkg-config) for libjpeg;
3. Once you run make, you may end up in an error referring to
/usr/local/include/gd.h instead of the bundled gd.h.
Root cause:
The bundled libgd fork includes gd.h and other gd-specific header
files using #include <foo.h> rather than #include "foo.h",
which
instructs the preprocessor to look for foo.h in the standard system
directories and, if the file wasn't found, fall back to search in
additional directories added to the search path.
Reference: https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
Solution:
Replace #include <foo.h> with #include "foo.h", to ensure
that the
lookup will be executed in the local path first and then in the search
path as fall back if the file was not found.
Actual result:
--------------
/Users/flavio/Documents/open-source/php-src/ext/gd/gd.c:571:48: error:
implicit declaration of function 'gdPngGetVersionString' is invalid in
C99 [-Werror,-Wimplicit-function-declaration]
php_info_print_table_row(2, "libPNG Version",
gdPngGetVersionString());
^
/Users/flavio/Documents/open-source/php-src/ext/gd/gd.c:571:48: note:
did you mean 'gdVersionString'?
/usr/local/include/gd.h:1687:27: note: 'gdVersionString' declared here
BGD_DECLARE(const char *) gdVersionString(void);
--
Edit bug report at https://bugs.php.net/bug.php?id=81032&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81032&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81032&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81032&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81032&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81032&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81032&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81032&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81032&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81032&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81032&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81032&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81032&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81032&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81032&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81032&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81032&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81032&r=mysqlcfg