php.net |  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: slangley at google dot com
New email:
PHP Version: OS:

 

 [2013-01-10 05:01 UTC] slangley at google dot com
Description:
------------
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 -
I/home/foo/build/x86_64/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)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

https://bugs.php.net/bug.php?id=62480

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: Wed Apr 24 14:01:30 2024 UTC