From patchwork Sat Jul 20 00:21:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam James X-Patchwork-Id: 94251 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 777BD38708DE for ; Sat, 20 Jul 2024 00:23:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id E7BDD38708C1 for ; Sat, 20 Jul 2024 00:22:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E7BDD38708C1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E7BDD38708C1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721434975; cv=none; b=gPTDP7PSJhV24O0mvdKCQdW9AxNrpAGEsrguxNkzSRcb5AShYnIQUSvbAAqeYRJULDdT/Ap8/wUqPJm/m3L66ezrMcC7fWGwWa9r6f8LXRtq6wvzY1xOtcwVs4AjyS40xYXb9Lach9X9kz4lun0xD2rB21da3Sd0ZqbGrG7Lb8U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721434975; c=relaxed/simple; bh=+aalIyvY36NmidWTuBSnH9UlUfnAwNBwiy73aAp5w/4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=NmmRN20cjVodVJeQzvUVWOAVKLc34sLRaVIKHFSYYhO+RhEzNBP9YPv66MYP+16Ai2jaaju8lbt9bj0Xdx96qrlQVm5q65WMPMkB0LzWH7pwRFfzRmKnFGxw5xKIo3jIV3mPxWkruNn/lRH9wul700mfDVxraCp8gIVE0FZZ6SY= ARC-Authentication-Results: i=1; server2.sourceware.org From: Sam James To: gcc-patches@gcc.gnu.org Cc: Sam James Subject: [PATCH] gcc: stop adding -fno-common for checking builds Date: Sat, 20 Jul 2024 01:21:59 +0100 Message-ID: <10f5258be165041e2d5bd767fac9e76c08857b0d.1721434919.git.sam@gentoo.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Originally added in r0-44646-g204250d2fcd084 and r0-44627-gfd350d241fecf6 whic moved -fno-common from all builds to just checking builds. Since r10-4867-g6271dd984d7f92, GCC defaults to -fno-common. There's no need to pass it specially for checking builds. We could keep it for older bootstrap compilers with checking but I don't see much value in that, it was already just a bonus before. gcc/ChangeLog: * Makefile.in (NOCOMMON_FLAG): Delete. (GCC_WARN_CFLAGS): Drop NOCOMMON_FLAG. (GCC_WARN_CXXFLAGS): Drop NOCOMMON_FLAG. * configure.ac: Ditto. * configure: Regenerate. gcc/d/ChangeLog: * Make-lang.in (WARN_DFLAGS): Drop NOCOMMON_FLAG. --- This came out of a discussion with pinskia last year but I punted it until stage1. Been running with it since then. gcc/Makefile.in | 8 ++------ gcc/configure | 8 ++------ gcc/configure.ac | 3 --- gcc/d/Make-lang.in | 2 +- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index f4bb4a88cf31..4fc86ed7938b 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -185,10 +185,6 @@ C_LOOSE_WARN = @c_loose_warn@ STRICT_WARN = @strict_warn@ C_STRICT_WARN = @c_strict_warn@ -# This is set by --enable-checking. The idea is to catch forgotten -# "extern" tags in header files. -NOCOMMON_FLAG = @nocommon_flag@ - NOEXCEPTION_FLAGS = @noexception_flags@ ALIASING_FLAGS = @aliasing_flags@ @@ -215,8 +211,8 @@ VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@ .-warn = $(STRICT_WARN) build-warn = $(STRICT_WARN) rtl-ssa-warn = $(STRICT_WARN) -GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) $($@-warn) -GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn) +GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $($@-warn) +GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $($@-warn) # 1 2 3 ... 9999 one_to_9999_0:=1 2 3 4 5 6 7 8 9 diff --git a/gcc/configure b/gcc/configure index 4faae0fa5fb8..01acca7fb5cc 100755 --- a/gcc/configure +++ b/gcc/configure @@ -862,7 +862,6 @@ valgrind_command valgrind_path_defines valgrind_path TREECHECKING -nocommon_flag noexception_flags warn_cxxflags warn_cflags @@ -7605,17 +7604,14 @@ do done IFS="$ac_save_IFS" -nocommon_flag="" if test x$ac_checking != x ; then $as_echo "#define CHECKING_P 1" >>confdefs.h - nocommon_flag=-fno-common else $as_echo "#define CHECKING_P 0" >>confdefs.h fi - if test x$ac_extra_checking != x ; then $as_echo "#define ENABLE_EXTRA_CHECKING 1" >>confdefs.h @@ -21410,7 +21406,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 21413 "configure" +#line 21409 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -21516,7 +21512,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 21519 "configure" +#line 21515 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 3da1eaa70646..3f20c107b6aa 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -697,16 +697,13 @@ do done IFS="$ac_save_IFS" -nocommon_flag="" if test x$ac_checking != x ; then AC_DEFINE(CHECKING_P, 1, [Define to 0/1 if you want more run-time sanity checks. This one gets a grab bag of miscellaneous but relatively cheap checks.]) - nocommon_flag=-fno-common else AC_DEFINE(CHECKING_P, 0) fi -AC_SUBST(nocommon_flag) if test x$ac_extra_checking != x ; then AC_DEFINE(ENABLE_EXTRA_CHECKING, 1, [Define to 0/1 if you want extra run-time checking that might affect code diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in index eaea6e039cf7..077668faae64 100644 --- a/gcc/d/Make-lang.in +++ b/gcc/d/Make-lang.in @@ -55,7 +55,7 @@ CHECKING_DFLAGS = -frelease else CHECKING_DFLAGS = endif -WARN_DFLAGS = -Wall -Wdeprecated $(NOCOMMON_FLAG) +WARN_DFLAGS = -Wall -Wdeprecated # D front-end doesn't use exceptions, but it does require RTTI. NOEXCEPTION_DFLAGS = $(filter-out -fno-rtti, $(NOEXCEPTION_FLAGS))