|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-10-02 08:56 UTC] smillerdev at me dot com
Description: ------------ Compiling PHP on the latest macOS 10.15 fails in Homebrew CI because Apple changed the way readdir_r is defined as far as I can tell. https://github.com/Homebrew/homebrew-core/pull/61828 https://github.com/Homebrew/homebrew-core/pull/61820 Actual result: -------------- /private/tmp/php@7.2-20201002-12382-1t37dvh/php-7.2.34/main/reentrancy.c:139:23: error: too few arguments to function call, expected 3, have 2 readdir_r(dirp, entry); ~~~~~~~~~ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/dirent.h:110:1: note: 'readdir_r' declared here int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r); ^ 1 error generated. make: *** [main/reentrancy.lo] Error 1 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 15:00:02 2025 UTC |
Relevant part: conftest.c:277:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] main() { ^ conftest.c:284:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration] exit(1); ^ conftest.c:284:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' conftest.c:286:5: error: implicit declaration of function 'close' is invalid in C99 [-Werror,-Wimplicit-function-declaration] close(dir); ^ conftest.c:289:3: error: implicit declaration of function 'close' is invalid in C99 [-Werror,-Wimplicit-function-declaration] close(dir); ^ 1 warning and 3 errors generated. configure:15832: $? = 1 configure: program exited with status 1 It fails due to implicit declaration warnings that become errors under -Werror. While we can fix the missing includes, running configure with -Werror will also break other checks -- and if I remember correct, some of them are ones done by autoconf itself, so we cannot easily address them. This is why we have an --enable-werror option that enables -Werror only for the build of PHP itself, not for configure checks. Where does the -Werror flag come from in your case? Is this a new default flag in macos 10.15?In php 7.4.12 and 7.3.24 there is still one implicit declaration of exit in the configure tests that should be fixed: php-7.3.24/config.log: configure:96698: checking whether dlsym() requires a leading underscore in symbol names configure:96769: ccache /usr/bin/clang -o conftest -pipe -Os -Werror=implicit-function-declaration -arch x86_64 -fvisibility=hidden -I/opt/local/include -no-cpp-precomp conftest.c >&5 configure:96765:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration] exit (status); ^ configure:96765:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' 1 error generated. php-7.4.12/config.log: configure:83023:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]