|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63955 Build fails if statically linking mbstring & libpng where png has a custom dir
Submitted: 2013-01-10 05:01 UTC Modified: 2013-10-15 22:52 UTC
From: slangley at google dot com Assigned:
Status: Closed Package: mbstring related
PHP Version: 5.4Git-2013-01-10 (Git) OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
18 - 12 = ?
Subscribe to this entry?

 [2013-01-10 05:01 UTC] slangley at google dot com
THere is a build failure if you try and build a statically linked binary with 
both mbstring & libpng where png has a custom library dir.

This is because the png library has a header file config.h, and mbstring creates 
a header file config.h. During the build, the include path for libpng is 
included before the include path for the config generated mbstring path, so that 
when files inside mbstring try to #include "config.h" the first config.h 
discovered in the search patch is the one for png, not the one for mbstring.

e.g. the include path looks like

-I/home/foo/png_headers/include -I/home/foo/php/ext/mbstring/oniguruma -

Probably need to rename the config.h generated for mbstring by the configure 
script to something a little less likely to have conflicts.

Test script:
./configure --enable-embed=static --enable-mbstring --with-gd --with-png-dir=/some/custom/path
make all

Expected result:
Should build and link correctly.

Actual result:
ext/mbstring/oniguruma/regparse.c: In function ‘onig_scan_unsigned_number’:
ext/mbstring/oniguruma/regparse.c:1567: error: ‘SIZEOF_INT’ undeclared (first use 
in this function)
ext/mbstring/oniguruma/regparse.c:1567: error: (Each undeclared identifier is 
reported only once
ext/mbstring/oniguruma/regparse.c:1567: error: for each function it appears in.)
ext/mbstring/oniguruma/regparse.c: In function ‘scan_unsigned_hexadecimal_number’:
ext/mbstring/oniguruma/regparse.c:1595: error: ‘SIZEOF_INT’ undeclared (first use 
in this function)
ext/mbstring/oniguruma/regparse.c: In function ‘scan_unsigned_octal_number’:
ext/mbstring/oniguruma/regparse.c:1623: error: ‘SIZEOF_INT’ undeclared (first use 
in this function)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-29 05:08 UTC]
-Status: Open +Status: Feedback
 [2013-06-29 05:08 UTC]
It seems you have the same issue.

Please refer to this bug, it it helps.

Don't forget to mention about your OS (i.e. distribution and version)
 [2013-10-15 11:54 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 "Re-Opened". Thank you.
 [2013-10-15 22:52 UTC] slangley at google dot com
-Status: No Feedback +Status: Closed
 [2013-10-15 22:52 UTC] slangley at google dot com
I fixed it by fixing the paths to refer to the correct location of config.h.

I'll upstream a PR someday.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC