commit: 70a43aaf58504bb01c77faf58c96abe0b0ca856d Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Fri Oct 4 11:11:22 2024 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Oct 4 11:49:01 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=70a43aaf
toolchain.eclass: add ewarns to explain USE=-debug behaviour w/ unreleased GCC We sometimes have people surprised by the behaviour with USE=-debug for unreleased versions of GCC. For more detail on that & context, see: * 564b130fd1bc8a35ac4d673d5211654c49af3fda * 85db50a7c626a1844c8eb2d03051c8c5d320c205 * 3f9a5248fb796417d63ae1c1234b534a88f22f14 Add some ewarns to explain the situation to users so they understand their options and also don't wrongly think GCC will be slow when released. Bug: https://bugs.gentoo.org/904481 Signed-off-by: Sam James <sam <AT> gentoo.org> eclass/toolchain.eclass | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index a2eba0a9297e..5b978f6871db 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1148,7 +1148,15 @@ toolchain_src_configure() { # unless USE=debug. Note that snapshots on stable branches don't count as "non-released" # for these purposes. if grep -q "experimental" gcc/DEV-PHASE ; then - # - USE=debug for pre-releases: yes,extra,rtl + # Tell users about the non-obvious behavior here so they don't think + # e.g. the next GCC release is super slow to compile things. + ewarn "Unreleased GCCs default to extra runtime checks even with USE=-debug," + ewarn "matching upstream default behavior. We recommend keeping these enabled." + ewarn "The checks (sometimes substantially) increase build time but provide important protection" + ewarn "from potential miscompilations (wrong code) by turning them into build-time errors." + ewarn "To override (not recommended), set: GCC_CHECKS_LIST=\"release\"." + + # - USE=debug for pre-releases: yes,extra,rtl (stornger than USE=debug for releases) # - USE=-debug for pre-releases: yes,extra (following upstream default) confgcc+=( --enable-checking="${GCC_CHECKS_LIST:-$(usex debug yes,extra,rtl yes,extra)}" ) else
