From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 019A3159C9C for ; Mon, 12 Aug 2024 01:19:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4B0DFE2B28; Mon, 12 Aug 2024 01:19:49 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2857CE2B28 for ; Mon, 12 Aug 2024 01:19:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4DD033430FF for ; Mon, 12 Aug 2024 01:19:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D9A321E0D for ; Mon, 12 Aug 2024 01:19:46 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1723425570.15ce82749db7922e462f900df9b7edbda37f152b.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/toolchain.eclass X-VCS-Directories: eclass/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 15ce82749db7922e462f900df9b7edbda37f152b X-VCS-Branch: master Date: Mon, 12 Aug 2024 01:19:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 238ed5cc-b59a-42f2-8682-42863666f764 X-Archives-Hash: c5bd164f135ac4d615bc47a91d3eb8d8 commit: 15ce82749db7922e462f900df9b7edbda37f152b Author: Sam James gentoo org> AuthorDate: Mon Aug 12 01:06:45 2024 +0000 Commit: Sam James gentoo org> CommitDate: Mon Aug 12 01:19:30 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15ce8274 toolchain.eclass: don't pass user flags in src_test This is obvious in hindsight. The flags we were passing *precisely because* we wanted e.g. -Wno-format to be passed to every test also included -O2 or whatever from the user's flags which breaks tests that may require no optimisation and so on. Instead of trying to filter out options in a whack-a-mole game, let's introduce special GCC_TESTS_* *FLAGS variables which we append the needed -Wno-* to (etc.) which users can also specify if they really want or need to. Note that this isn't as scary or as weird as it sounds. We were only trying to jam these flags in **purely** to counteract some defaults we set, these tests really aren't supposed to be run with arbitrary flags stuck in, but a workaround we added started to introduce way more than intended. The torture tests are fine with being run with various optimisation flags but the rest of the testesuite isn't. This fixes 361c3758642891759b0ed60a8f96bc0776d19f15 and some of the attempts afterwards, although not everything in those commits was bad. Fixes: 361c3758642891759b0ed60a8f96bc0776d19f15 Signed-off-by: Sam James gentoo.org> eclass/toolchain.eclass | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index b2d4692bc2e1..326daf66586c 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1941,15 +1941,19 @@ toolchain_src_test() { # Workaround our -Wformat-security default which breaks # various tests as it adds unexpected warning output. - append-flags -Wno-format-security -Wno-format + GCC_TESTS_CFLAGS+=" -Wno-format-security -Wno-format" + GCC_TESTS_CXXFLAGS+=" -Wno-format-security -Wno-format" + # Workaround our -Wtrampolines default which breaks # tests too. - append-flags -Wno-trampolines + GCC_TESTS_CFLAGS+=" -Wno-trampolines" + GCC_TESTS_CXXFLAGS+=" -Wno-trampolines" # A handful of Ada (and objc++?) tests need an executable stack - append-ldflags -Wl,--no-warn-execstack + GCC_TESTS_LDFLAGS+=" -Wl,--no-warn-execstack" # Avoid confusing tests like Fortran/C interop ones where # CFLAGS are used. - append-flags -Wno-complain-wrong-lang + GCC_TESTS_CFLAGS+=" -Wno-complain-wrong-lang" + GCC_TESTS_CXXFLAGS+=" -Wno-complain-wrong-lang" # Issues with Ada tests: # gnat.dg/align_max.adb @@ -1960,11 +1964,12 @@ toolchain_src_test() { # # TODO: This isn't ideal given it obv. affects codegen # and we want to be sure it works. - append-flags -fno-stack-clash-protection + GCC_TESTS_CFLAGS+=" -fno-stack-clash-protection" + GCC_TESTS_CXXFLAGS+=" -fno-stack-clash-protection" # configure defaults to '-O2 -g' and some tests expect it # accordingly. - append-flags -g + GCC_TESTS_CFLAGS+=" -g" # TODO: Does this handle s390 (-m31) correctly? # TODO: What if there are multiple ABIs like x32 too? @@ -1980,23 +1985,23 @@ toolchain_src_test() { nonfatal emake -C "${WORKDIR}"/build -k "${GCC_TESTS_CHECK_TARGET}" \ RUNTESTFLAGS=" \ ${GCC_TESTS_RUNTESTFLAGS} \ - CFLAGS_FOR_TARGET='${CFLAGS_FOR_TARGET:-${CFLAGS}}' \ - CXXFLAGS_FOR_TARGET='${CXXFLAGS_FOR_TARGET:-${CXXFLAGS}}' \ - LDFLAGS_FOR_TARGET='${LDFLAGS_FOR_TARGET:-${LDFLAGS}}' \ - CFLAGS='${CFLAGS}' \ - CXXFLAGS='${CXXFLAGS}' \ - FCFLAGS='${FCFLAGS}' \ - FFLAGS='${FFLAGS}' \ - LDFLAGS='${LDFLAGS}' \ + CFLAGS_FOR_TARGET='${GCC_TESTS_CFLAGS_FOR_TARGET:-${GCC_TESTS_CFLAGS}}' \ + CXXFLAGS_FOR_TARGET='${GCC_TESTS_CXXFLAGS_FOR_TARGET:-${GCC_TESTS_CXXFLAGS}}' \ + LDFLAGS_FOR_TARGET='${TEST_LDFLAGS_FOR_TARGET:-${GCC_TESTS_LDFLAGS}}' \ + CFLAGS='${GCC_TESTS_CFLAGS}' \ + CXXFLAGS='${GCC_TESTS_CXXFLAGS}' \ + FCFLAGS='${GCC_TESTS_FCFLAGS}' \ + FFLAGS='${GCC_TESTS_FFLAGS}' \ + LDFLAGS='${GCC_TESTS_LDFLAGS}' \ " \ - CFLAGS_FOR_TARGET="${CFLAGS_FOR_TARGET:-${CFLAGS}}" \ - CXXFLAGS_FOR_TARGET="${CXXFLAGS_FOR_TARGET:-${CXXFLAGS}}" \ - LDFLAGS_FOR_TARGET="${LDFLAGS_FOR_TARGET:-${LDFLAGS}}" \ - CFLAGS="${CFLAGS}" \ - CXXFLAGS="${CXXFLAGS}" \ - FCFLAGS="${FCFLAGS}" \ - FFLAGS="${FFLAGS}" \ - LDFLAGS="${LDFLAGS}" + CFLAGS_FOR_TARGET="${GCC_TESTS_CFLAGS_FOR_TARGET:-${GCC_TESTS_CFLAGS}}" \ + CXXFLAGS_FOR_TARGET="${GCC_TESTS_CXXFLAGS_FOR_TARGET:-${GCC_TESTS_CXXFLAGS}}" \ + LDFLAGS_FOR_TARGET="${GCC_TESTS_LDFLAGS_FOR_TARGET:-${GCC_TESTS_LDFLAGS}}" \ + CFLAGS="${GCC_TESTS_CFLAGS}" \ + CXXFLAGS="${GCC_TESTS_CXXFLAGS}" \ + FCFLAGS="${GCC_TESTS_FCFLAGS}" \ + FFLAGS="${GCC_TESTS_FFLAGS}" \ + LDFLAGS="${GCC_TESTS_LDFLAGS}" ) # Produce an updated failure manifest.