Repository navigation
php 8.3 build error with gcc-4.2: cc1: error: unrecognized command line option "-Wno-implicit-fallthrough" #13330
Copy link
Copy link
Closed
Labels
Description
Description
Trying to install php 8.3 on older macOS with the default system compiler fails:
/bin/sh /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/libtool --silent --preserve-dup-deps --tag CC --mode=compile /usr/bin/gcc-4.2 -std=gnu99 -Iext/date/ -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/ext/date/ -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/main -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/ext/date/lib -I/opt/local/include/libxml2 -I/opt/local/include -I/opt/local/include/editline -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/TSRM -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/Zend -I/opt/local/include -D_GNU_SOURCE -fno-common -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -pipe -Os -arch ppc -fvisibility=hidden -DZEND_SIGNALS -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/ext/date/lib/parse_tz.c -o ext/date/lib/parse_tz.lo -MMD -MF ext/date/lib/parse_tz.dep -MT ext/date/lib/parse_tz.lo
/bin/sh /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/libtool --silent --preserve-dup-deps --tag CC --mode=compile /usr/bin/gcc-4.2 -std=gnu99 -Iext/date/ -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/ext/date/ -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/main -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/ext/date/lib -I/opt/local/include/libxml2 -I/opt/local/include -I/opt/local/include/editline -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/TSRM -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/Zend -I/opt/local/include -D_GNU_SOURCE -fno-common -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -pipe -Os -arch ppc -fvisibility=hidden -DZEND_SIGNALS -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php83/work/php-8.3.2/ext/date/lib/parse_posix.c -o ext/date/lib/parse_posix.lo -MMD -MF ext/date/lib/parse_posix.dep -MT ext/date/lib/parse_posix.lo
cc1: error: unrecognized command line option "-Wno-implicit-fallthrough"
make: *** [ext/date/php_date.lo] Error 1
make: *** Waiting for unfinished jobs....
cc1: error: unrecognized command line option "-Wno-implicit-fallthrough"
make: *** [ext/date/lib/parse_date.lo] Error 1
cc1: error: unrecognized command line option "-Wno-implicit-fallthrough"
make: *** [ext/date/lib/parse_posix.lo] Error 1
cc1: error: unrecognized command line option "-Wno-implicit-fallthrough"
make: *** [ext/date/lib/parse_tz.lo] Error 1
cc1: error: unrecognized command line option "-Wno-implicit-fallthrough"
make: *** [ext/date/lib/dow.lo] Error 1
cc1: error: unrecognized command line option "-Wno-implicit-fallthrough"
make: *** [ext/date/lib/astro.lo] Error 1
It does build fine with gcc 13.2.0, however. (So no issue with older macOS as such.)
Can this be fixed for gcc 4.2 or should we just switch to using a newer compiler for those systems in Macports?
PHP Version
PHP 8.3
Operating System
macOS 10.6
See also: https://trac.macports.org/ticket/69114
Activity
devnexen commentedon Feb 5, 2024
So far the date, hash. pcre, opcache extensions use this flag. And Zend uses its opposite.
Those had been introduced, for gcc, in the 7.x releases serie.
Is there a possibility to patch macports removing these ?
barracuda156 commentedon Feb 5, 2024
@devnexen We can fix it locally, of course, if fixing it here is too bothersome.
So just removing this flag should presumably work, and C11 is not required, right?
Or maybe it is possible to have a configure check for this flag? And then it will be fixed for everyone and not just Macports users.
devnexen commentedon Feb 5, 2024
c99, I believe, is the minimum.
@petk might help shed a light on this topic, however though we can t maintain backward compatibility forever it makes everything more and more complex overtime.
petk commentedon Feb 5, 2024
Yes, all these flags should be appended conditionally by checking if they are available. They probably weren't checked yet because they seem so common on GCC and Clang. We can add these checks something like this:
barracuda156 commentedon Feb 5, 2024
@devnexen Thank you, C99 should work for gcc-4.2.
@petk I will try your patch now, many thanks.
barracuda156 commentedon Feb 5, 2024
@petk Perhaps something else also sets it? While I see this during configure:
The flag is nevertheless passed:
I had to modify the patch a bit for PHP 8.3.2:
Or did I just miss something?
devnexen commentedon Feb 5, 2024
Is it a fresh build (or at least is
buildconf -fis involved) with your last try ?petk commentedon Feb 5, 2024
No, nothing should set it automagically from somewhere else. Try recreating the configure script, yes. Or, you can also simply test this by removing all the
-Wno-implicit-fallthroughoccurrences in the php-src code instead of adding this patch.Otherwise, what might happen here is also that there will be further obstacles later on in the configuration phase. Let's see if these flags are the only issues.
barracuda156 commentedon Feb 5, 2024
Yes, I verified now, it still passes the flag and fails in result.
barracuda156 commentedon Feb 5, 2024
Ah, I guess Macports just does not use autotools here, so we indeed need to patch configure.
Append -Wno-implicit-fallthrough flag conditionally
Append -Wno-implicit-fallthrough flag conditionally (#13331)