|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63138 dozens of implicit declarations in custom configure tests
Submitted: 2012-09-22 13:26 UTC Modified: -
Avg. Score:4.8 ± 0.4
Reproduced:8 of 8 (100.0%)
Same Version:1 (12.5%)
Same OS:6 (75.0%)
From: lullol at yopmail dot com Assigned:
Status: Open Package: Compile Failure
PHP Version: 5.4Git-2012-09-22 (Git) OS: Linux
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 — but make sure to vote on the bug!
Your email address:
Solve the problem:
41 + 29 = ?
Subscribe to this entry?

 [2012-09-22 13:26 UTC] lullol at yopmail dot com
basically all custom (i.e. written by php coders rather than autoconf authors) 
configure checks use exit() but fail to include <stdlib.h> which defines this 
they use strcmp without including <string.h>

etc etc

so if your distro toolchain has -Werror-implicit-function-declaration baked in 
(which is basically a very sane feature to use, because it will prevent broken 
code generation on platforms where sizeof(int) != sizeof(void*), like amd64), 
all these tests will fail, and either cause total build failure, cause 
duplicated code to get pulled in, or build without some optional packages which 
are misdetected as not existing.

examples include: (using the cache variable names of those tests)


the broken "what readdir_r" check will cause "old readdir_r" support code get 
compiled, which fails to build because it is using an invalid prototype for 
POSIX readdir_r.

to find all such issues automatically, it is recommended to use "CC=gcc -Werror-
implicit-function-declaration" ./configure, then grep config.log for "error: 
implicit declaration"

additionally, musl libc should be used for this instead of glibc, because the 
latter has numerous namespace issues. for example on glibc, including <stdio.h> 
will automatically cause <stdlib.h> to get pulled in, thus hiding the issue with 

another approach is to manually go through all the custom tests, analyse which 
functions are used and add the headers that define it according to the POSIX or 
C spec.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-22 22:47 UTC] lullol at yopmail dot com
oops, _cv_have_broken_glibc_fopen_append doesn't belong to this group, it is 
broken in its own special way, in that it is triggered whenever you don't use 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Jul 14 04:01:25 2020 UTC