Created attachment 805687 [details] /etc/portage/bashrc hook See https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213 for the background. Clang 15 (it's been reverted in 15.0.1) turns on the following as -Werror-by-default: * -Werror=implicit-function-declaration * -Werror=implicit-int * -Werror=strict-prototypes This has led to various build failures, but also build failures or runtime problems caused by configure tests giving the wrong result! --- I've attached a cheesy /etc/portage/bashrc hook which creates /var/tmp/clang/${CATEGORY}/${PF}/clang{14,15}.log & clang.diff which allows easy checking for "error.*implicit", etc.
(In reply to Sam James from comment #0) > Created attachment 805687 [details] > /etc/portage/bashrc hook > > I've attached a cheesy /etc/portage/bashrc hook which creates > /var/tmp/clang/${CATEGORY}/${PF}/clang{14,15}.log & clang.diff which allows > easy checking for "error.*implicit", etc. I'm updating this at https://gist.github.com/thesamesam/4ddaa95f3f42c2be312b676476cbf505.
appeared recently at the tinderbox image 17.1_no_multilib_hardened-j4-20220916-220004
Created attachment 808402 [details] emerge-info.txt
Created attachment 808405 [details] clang.tar.bz2
Created attachment 808408 [details] emerge-history.txt
Created attachment 808414 [details] environment
Created attachment 808417 [details] etc.portage.tar.bz2
Created attachment 808420 [details] logs.tar.bz2
Created attachment 808423 [details] mail-filter:mapson-3.3.1:20220917-161113.log
Created attachment 808426 [details] temp.tar.bz2
* Finding these bugs This is NOT a complete list. Toralf is actively filing more, but there's two class of bugs here: 1. Explicit build failures like these (things being reported here) 2. Silent wrong configure results (see linked Discourse thread above, e.g. bug 869539) where things will compile but be wrong at runtime. To look into this, we need to diff configure before/after and look for errors with -Werror that didn't appear before. No bugs are being filed for these yet as it's harder to automate. To help with those, run the gist linked above in /etc/portage/bashrc, and grep -rsin "error.*" /var/tmp/clang or similar. Toralf is also helping to collect data for this and we may be able to automatically file bugs for it in future, but we need to avoid noise/false positives. -- * Reproducing these issues mgorny is working on Clang config support to make testing this easier, but to reproduce issues, just use: ``` CC=clang CXX=clang++ CFLAGS="-O2 -Werror=implicit-function-declaration -Werror=implicit-int -Werror=strict-prototypes" ``` No need for CXXFLAGS as C++ doesn't have these issues. -- * Fixing these issues 1. Please upstream patches wherever possible! This is going to affect every distro & it's going to affect GCC in time. Reducing duplication of work is important with the scale of the task here. 2. Almost all of these fixes require revbumps as they affect code generation. The only time you don't is when you'd get certain failure immediately with say, an ancient autoconf version, like bug 870571 -- and even then, you need to be careful to catch any others in configure & during the actual building of the package.
Relevant upstream fix: https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=8b5e2016c7ed2d67f31b03a3d2e361858ff5299b
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbcc188c5ef6bc63190cc07c93452652c682f5bb commit dbcc188c5ef6bc63190cc07c93452652c682f5bb Author: Sam James <sam@gentoo.org> AuthorDate: 2022-09-19 16:10:24 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-09-19 16:26:41 +0000 sys-devel/autoconf: backport K&R decls fix to 2.13 Backport the K&R decls fix to 2.13 to avoid configure tests failing (often "silently", i.e. doesn't fail the build of the package overall, just leads to wrong results) with newer compilers like the upcoming Clang 16. A consequence of this whole fuss is that we're going to have to eautoreconf in a bunch of older packages, but as Ionen pointed out on IRC, this means we get some other stuff for free like Python 3.10 fixes, so it's not all bad. Undecided how to handle any packages with a generated configure from autoconfs not in tree. We may just patch the configure manually. Will see. See linked bug 870412 and the Discourse thread therein for details if unfamiliar. As I remarked on IRC, it's unfortunate to have to backport anything which will then infect generated configure, as it's somewhat a repeat of the --runstatedir situation, and it leads to confusion/hassle when sending patches upstream where a generated/bootstrapped configure is required. But this is different - it's a (serious) bug being fixed rather than a gratuitous (although) understandable given we weren't sure if we'd ever see another autoconf release backport of a new feature. Bug: https://bugs.gentoo.org/806376 Bug: https://bugs.gentoo.org/870412 Thanks-to: Arsen Arsenovic <arsen@aarsen.me> Signed-off-by: Sam James <sam@gentoo.org> sys-devel/autoconf/autoconf-2.13-r3.ebuild | 51 +++ .../files/autoconf-2.13-K-R-decls-clang.patch | 346 +++++++++++++++++++++ 2 files changed, 397 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79c0b97504177b9ee374e3d96af8b03349b86d12 commit 79c0b97504177b9ee374e3d96af8b03349b86d12 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-09-19 16:07:54 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-09-19 16:26:40 +0000 sys-devel/autoconf: backport K&R decls fix to 2.69 Backport the K&R decls fix to 2.69 to avoid configure tests failing (often "silently", i.e. doesn't fail the build of the package overall, just leads to wrong results) with newer compilers like the upcoming Clang 16. A consequence of this whole fuss is that we're going to have to eautoreconf in a bunch of older packages, but as Ionen pointed out on IRC, this means we get some other stuff for free like Python 3.10 fixes, so it's not all bad. Undecided how to handle any packages with a generated configure from autoconfs not in tree. We may just patch the configure manually. Will see. See linked bug 870412 and the Discourse thread therein for details if unfamiliar. As I remarked on IRC, it's unfortunate to have to backport anything which will then infect generated configure, as it's somewhat a repeat of the --runstatedir situation, and it leads to confusion/hassle when sending patches upstream where a generated/bootstrapped configure is required. But this is different - it's a (serious) bug being fixed rather than a gratuitous (although) understandable given we weren't sure if we'd ever see another autoconf release backport of a new feature. Bug: https://bugs.gentoo.org/806376 Bug: https://bugs.gentoo.org/870412 Thanks-to: Arsen Arsenovic <arsen@aarsen.me> Signed-off-by: Sam James <sam@gentoo.org> sys-devel/autoconf/autoconf-2.69-r7.ebuild | 63 ++++ .../files/autoconf-2.69-K-R-decls-clang.patch | 387 +++++++++++++++++++++ 2 files changed, 450 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0acd23de8af61e7b900c3ff2c0fcbfe0b0ddc3a3 commit 0acd23de8af61e7b900c3ff2c0fcbfe0b0ddc3a3 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-09-19 03:01:26 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-09-19 16:26:40 +0000 sys-devel/autoconf: backport K&R decls fix to 2.71 Backport the K&R decls fix to 2.71 to avoid configure tests failing (often "silently", i.e. doesn't fail the build of the package overall, just leads to wrong results) with newer compilers like the upcoming Clang 16. A consequence of this whole fuss is that we're going to have to eautoreconf in a bunch of older packages, but as Ionen pointed out on IRC, this means we get some other stuff for free like Python 3.10 fixes, so it's not all bad. Undecided how to handle any packages with a generated configure from autoconfs not in tree. We may just patch the configure manually. Will see. See linked bug 870412 and the Discourse thread therein for details if unfamiliar. Patches: - AC_C_BIGENDIAN-lto.patch ("Port AC_C_BIGENDIAN to cross gcc -std=c11 -flto") - AC_LANG_CALL_C_cxx.patch ("Port AC_LANG_CALL(C) to C++") - K-R-decls-clang.patch ("Port to compilers that moan about K&R func decls") The first two are included to make the latter apply cleanly, but they're also both harmless and desirable. As I remarked on IRC, it's unfortunate to have to backport anything which will then infect generated configure, as it's somewhat a repeat of the --runstatedir situation, and it leads to confusion/hassle when sending patches upstream where a generated/bootstrapped configure is required. But this is different - it's a (serious) bug being fixed rather than a gratuitous (although) understandable given we weren't sure if we'd ever see another autoconf release backport of a new feature. Backports to 2.69 & 2.13 to follow. Bug: https://bugs.gentoo.org/806376 Bug: https://bugs.gentoo.org/870412 Thanks-to: Arsen Arsenovic <arsen@aarsen.me> Signed-off-by: Sam James <sam@gentoo.org> sys-devel/autoconf/autoconf-2.71-r3.ebuild | 87 +++++++++++++ .../files/autoconf-2.71-AC_C_BIGENDIAN-lto.patch | 50 ++++++++ .../files/autoconf-2.71-AC_LANG_CALL_C_cxx.patch | 30 +++++ .../files/autoconf-2.71-K-R-decls-clang.patch | 136 +++++++++++++++++++++ 4 files changed, 303 insertions(+)
Note that Clang 15/16 doesn't set -Werror=strict-prototypes, but rather that some configure scripts force -Werror.
See https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240 for latest summary and the gist of this whole thing if you're wondering what this is about.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=85723dbd4d8fa6392001adeb8ca695a29e530949 commit 85723dbd4d8fa6392001adeb8ca695a29e530949 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-11-09 01:16:27 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-11-09 01:17:50 +0000 bin: replace check-implicit-pointer-usage.py Always die on -Wimplicit-function-declaration as Clang 16 is going to make it fatal and it's always pretty dubious. The licencing of check-implicit-pointer-usage.py is also unclear, but the tool has been broken since GCC 4.5(!) Bug: https://bugs.gentoo.org/365655 Bug: https://bugs.gentoo.org/870412 Signed-off-by: Sam James <sam@gentoo.org> bin/check-implicit-pointer-usage.py | 79 ----------------------------------- bin/install-qa-check.d/90gcc-warnings | 46 ++++---------------- 2 files changed, 7 insertions(+), 118 deletions(-)
(In reply to Sam James from comment #15) > See > https://archives.gentoo.org/gentoo-dev/message/ > dd9f2d3082b8b6f8dfbccb0639e6e240 for latest summary and the gist of this > whole thing if you're wondering what this is about. And now https://wiki.gentoo.org/wiki/Modern_C_porting.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=541ccf270b9b9b5631072a654cd3add5ccd433e7 commit 541ccf270b9b9b5631072a654cd3add5ccd433e7 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-11-18 01:01:13 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-11-18 01:02:05 +0000 sys-devel/autoconf: backport further Clang 16 fixes (2.69) It turns out we had some of these fixes already in our 2.69 from previous backporting work which ended up catching stuff which wasn't actually applied upstream yet, so the patch change here is much smaller than for 2.71. Bug: https://bugs.gentoo.org/870412 Signed-off-by: Sam James <sam@gentoo.org> ...conf-2.69-r7.ebuild => autoconf-2.69-r8.ebuild} | 0 .../files/autoconf-2.69-K-R-decls-clang.patch | 29 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc030538dc51e0bccceea9372bfab68cda588b8c commit cc030538dc51e0bccceea9372bfab68cda588b8c Author: Sam James <sam@gentoo.org> AuthorDate: 2022-11-18 00:55:29 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-11-18 01:02:04 +0000 sys-devel/autoconf: backport further Clang 16 fixes (2.71) Bug: https://bugs.gentoo.org/870412 Signed-off-by: Sam James <sam@gentoo.org> ...conf-2.71-r4.ebuild => autoconf-2.71-r5.ebuild} | 1 + .../files/autoconf-2.13-K-R-decls-clang.patch | 2 +- .../files/autoconf-2.71-K-R-decls-clang-deux.patch | 94 ++++++++++++++++++++++ .../files/autoconf-2.71-K-R-decls-clang.patch | 2 +- 4 files changed, 97 insertions(+), 2 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=0fdbbbdb5a80e331adf701f2b2c1f096695447c4 commit 0fdbbbdb5a80e331adf701f2b2c1f096695447c4 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-11-20 23:32:08 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-11-20 23:33:43 +0000 install-qa-check.d/90gcc-warnings: don't make implicit func decls fatal for now We need to do this at some point (as Clang 16 and GCC 14 are doing it, and they indicate runtime problems anyway), but there's too much breakage for now. We did find some extra bugs though. The main issue is too much high-profile stuff breaks rather than the total number of bugs, wrt Portage behaviour changing being suitable or not. Bug: https://bugs.gentoo.org/870412 Signed-off-by: Sam James <sam@gentoo.org> NEWS | 4 ++++ bin/install-qa-check.d/90gcc-warnings | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d184f1a99a9bbf53b1fc0f288300ed1979099f2 commit 1d184f1a99a9bbf53b1fc0f288300ed1979099f2 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-11-20 23:36:46 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-11-20 23:37:12 +0000 sys-apps/portage: make Portage less noisy on implicit func. decls for now We will undo this again soon, but we need fewer high profiles to be broken first, as it impacts wider testing & bug finding. Bug: https://bugs.gentoo.org/870412 Signed-off-by: Sam James <sam@gentoo.org> ...rtage-3.0.39-implicit-func-decls-no-fatal.patch | 34 ++++++++++++++++++++++ ...tage-3.0.39.ebuild => portage-3.0.39-r1.ebuild} | 1 + 2 files changed, 35 insertions(+)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cece5b154234aa8c9982feae05f67df8db39e270 commit cece5b154234aa8c9982feae05f67df8db39e270 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-11-23 01:12:30 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-11-23 01:12:30 +0000 autotools.eclass: crank up autoconf minimum versions This ensures we have versions which have Clang 16 / GCC 14 / stricter compiler fixes, so 'eautoreconf' will Do The Right Thing. Closes: https://bugs.gentoo.org/870412 Signed-off-by: Sam James <sam@gentoo.org> eclass/autotools.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20bcabbb6778de49da6d64cdab10e5a84c4497fb commit 20bcabbb6778de49da6d64cdab10e5a84c4497fb Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2022-11-24 16:50:55 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2022-11-24 16:53:03 +0000 sys-apps/less: call eautoreconf in all ebuilds This should prevent weirdness with clang-16. Bug: https://bugs.gentoo.org/870412 Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-apps/less/less-608-r1.ebuild | 2 ++ sys-apps/less/less-612.ebuild | 11 +++++++++++ 2 files changed, 13 insertions(+)
Should there be a tracker for suggested last-riting? So many of these packages have more than a 10 year lapse of activity, no reverse-deps, and too many outdated language constructs to be worth fixing.
(In reply to Peter Levine from comment #23) > Should there be a tracker for suggested last-riting? So many of these > packages have more than a 10 year lapse of activity, no reverse-deps, and > too many outdated language constructs to be worth fixing. I'd say CC treecleaner@ on them, with a brief comment explaining why you think it should go. Then periodically, we'll go through and look for bugs blocking this tracker with treecleaner CC'd.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c1172d2e454c89f3bbda6841e06b8230a399d49 commit 9c1172d2e454c89f3bbda6841e06b8230a399d49 Author: Michael Orlitzky <mjo@gentoo.org> AuthorDate: 2023-02-23 22:43:58 +0000 Commit: Michael Orlitzky <mjo@gentoo.org> CommitDate: 2023-02-23 23:33:20 +0000 mail-filter/opendkim: fix two musl/standards issues. New patches to fix a missing include and to correct a few function signatures that violated the C standards. Closes: https://bugs.gentoo.org/870412 Signed-off-by: Michael Orlitzky <mjo@gentoo.org> .../opendkim/files/opendkim-2.10.3-c-std.patch | 155 +++++++++++++++++++++ .../files/opendkim-2.10.3-snprintf-include.patch | 27 ++++ mail-filter/opendkim/opendkim-2.10.3-r30.ebuild | 2 + 3 files changed, 184 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=830c46baf116bf8fca5b981723122ece4bfcbcd9 commit 830c46baf116bf8fca5b981723122ece4bfcbcd9 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-02-28 18:31:14 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-02-28 19:10:36 +0000 profiles/base: add cache vars for -Wimplicit-function-declaration silencing Autoconf has a builtin check to try figure out how to make the compiler error out on implicit function declarations. This check necessarily emits such a warning/error. We know that -Werror=implicit-function-declaration will work on any compiler we care about, so just force that to avoid noise. This means we don't have to try whitelist 'strchr'. Bug: https://bugs.gentoo.org/870412 Signed-off-by: Sam James <sam@gentoo.org> profiles/base/make.defaults | 6 ++++++ 1 file changed, 6 insertions(+)
Bug #899782 [mail-filter/spamassassin-4.0.0-r1 has implicit function declarations in configure logs (GCC-13-SYSTEM)] has a build.log attached. I don't see the configure issue in there, but I do see: ============================================================================== * QA Notice: Found the following implicit function declarations in configure logs: * /var/tmp/portage/mail-filter/spamassassin-4.0.0-r1/work/Mail-SpamAssassin-4.0.0/spamc/config.log:175 - exit ============================================================================== Is there anyway to get that config.log, since I'm not running a GCC-13 system?
No one needs to respond to my last question. configure is autotools, so it has nothing to do with a new gcc. I can ebuild compile spamassassin and find the referenced config.log on my own machine.
If you're landing on this bug and you have no idea what's going on, please see the detailed summary, FAQ, etc at https://wiki.gentoo.org/wiki/Modern_C_porting. Thanks!
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92d6b34449e631c904cc0c30c7d99853647c3ea2 commit 92d6b34449e631c904cc0c30c7d99853647c3ea2 Author: Eli Schwartz <eschwartz93@gmail.com> AuthorDate: 2023-12-06 04:40:13 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-12-06 05:41:01 +0000 dev-util/meson: backport patch to stop hiding vala compiler warnings This is especially bad because it makes these packages disappear entirely from QA checks for, say, Modern C. Although it's only a matter of adding more warnings, and doesn't really affect the resulting packages, we need this live in order to do proper QA. Bug: https://bugs.gentoo.org/870412 Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/34141 Signed-off-by: Sam James <sam@gentoo.org> ...nd-don-t-hide-all-compiler-warnings-for-t.patch | 250 +++++++++++++++++++++ dev-util/meson/meson-1.3.0-r2.ebuild | 135 +++++++++++ 2 files changed, 385 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97798026f33f4983f8d5cdf7d901d96d41b7066a commit 97798026f33f4983f8d5cdf7d901d96d41b7066a Author: Sam James <sam@gentoo.org> AuthorDate: 2024-05-19 13:45:22 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-05-19 13:51:38 +0000 sys-devel/gcc: keyword 14.1.1_p20240518 I think we've reached as far as we can in terms of progress with it masked/unkeyworded, especially given we've been working on this for 2+ years now in preparation (Clang had essentially - but not quite - the same set of changes). It's also in the latest Fedora release and Arch have unleashed it as well, which means it's propagated into people's CI by now which should help. Bug: https://bugs.gentoo.org/870412 Bug: https://bugs.gentoo.org/906027 Bug: https://bugs.gentoo.org/914580 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc/gcc-14.1.1_p20240518.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
All blockers reviewed for gcc-14-stable