From:             lullol at yopmail dot com
Operating system: Linux
PHP version:      5.4Git-2012-09-22 (Git)
Package:          Compile Failure
Bug Type:         Bug
Bug description:dozens of implicit declarations in custom configure tests

Description:
------------
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 
function.
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)

  _cv_have_broken_glibc_fopen_append
  ac_cv_what_readdir_r
  ac_cv_crypt_blowfish
  ac_cv_crypt_md5
  ac_cv_crypt_SHA256
  ac_cv_crypt_SHA512
  ac_cv_crypt_des
  ac_cv_crypt_ext_des
  ac_cv_pwrite
  ac_cv_pread

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 
exit().

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.




-- 
Edit bug report at https://bugs.php.net/bug.php?id=63138&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63138&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63138&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63138&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63138&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63138&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63138&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63138&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63138&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63138&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63138&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63138&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63138&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63138&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63138&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63138&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63138&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63138&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63138&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63138&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63138&r=mysqlcfg

Reply via email to