Authentication-Results: name.execsw.org; dkim=pass (1024-bit key) header.d=netbsd.org header.i=@netbsd.org header.b=WiyRWmrf; dkim=pass (1024-bit key) header.d=netbsd.org header.i=@netbsd.org header.b=q2m14Ffx Received: by mail.netbsd.org (Postfix, from userid 605) id C50CC84EB1; Tue, 19 Mar 2024 21:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org; s=20240131; t=1710882769; bh=75WzRkvMS7EEQo/ouCarRXiokq686NAK4wDplXRyIuI=; h=Date:From:Subject:To:Reply-To:List-Id:List-Unsubscribe; b=WiyRWmrfcioltHCKMc11O0B5L3XUNKOXFlo8+auc/lb/8PzE9lN7cG1OXgg8B94ik KVHCOMOQyLPShtPp3pOW847cFxYVUiWVdfYUoisWRIZ9K9NN+dqgd78HdSVJgMeQUD KedQonGWS/X1nBUz1u+E5XJ7FaI3eAfVd16eTXpE= Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id B70DE84E78 for ; Tue, 19 Mar 2024 21:12:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Authentication-Results: mail.netbsd.org (amavisd-new); dkim=pass (1024-bit key) header.d=netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 5uwvX43W44hU for ; Tue, 19 Mar 2024 21:12:48 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 16D8484CD8 for ; Tue, 19 Mar 2024 21:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org; s=20240131; t=1710882768; bh=75WzRkvMS7EEQo/ouCarRXiokq686NAK4wDplXRyIuI=; h=Date:From:Subject:To:Reply-To; b=q2m14FfxoxSdggx+6P58pXnwiRXDEDPnfWYc+fN8KyRcriT/aPTo7/cr3fKVWdQZ4 dkfW+i/OWpOqcK4qf4Qb9JRlYJqH4LEH8CDsjRcHWdWCR13PANt7FxAkDrhFYIB3ja t4xW8uFF01XOkpRg84mDee1jflssaJcBbu5Uib/w= Received: by cvs.NetBSD.org (Postfix, from userid 500) id 0F4F4FA2C; Tue, 19 Mar 2024 21:12:48 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1710882768295830" MIME-Version: 1.0 Date: Tue, 19 Mar 2024 21:12:48 +0000 From: "Amitai Schleier" Subject: CVS commit: pkgsrc/mk/compiler To: pkgsrc-changes@NetBSD.org Reply-To: schmonz@netbsd.org X-Mailer: log_accum Message-Id: <20240319211248.0F4F4FA2C@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1710882768295830 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: schmonz Date: Tue Mar 19 21:12:47 UTC 2024 Modified Files: pkgsrc/mk/compiler: clang.mk Log Message: clang.mk: paper over new macOS and upstream defaults. As soon as 2024Q1 branches, we should: 1. Do a bulk build with all these -Wno-error tweaks removed, so we can see how much is broken. 2. If it's "too much" breakage and we'll have to keep overriding these compiler defaults for "a while", find a way to accomplish them with fewer compiler invocations. (Some ideas: define a default FORCE_C_STD, or apply overrides keyed on CC_VERSION or similar.) Do a bulk build to make sure things continue to work as before. 3. Otherwise, fix as much as we can before 2024Q2. This will help with gcc 14 (which has many similar new defaults) as well. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 pkgsrc/mk/compiler/clang.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1710882768295830 Content-Disposition: inline Content-Length: 2723 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mk/compiler/clang.mk diff -u pkgsrc/mk/compiler/clang.mk:1.42 pkgsrc/mk/compiler/clang.mk:1.43 --- pkgsrc/mk/compiler/clang.mk:1.42 Wed Oct 18 08:48:51 2023 +++ pkgsrc/mk/compiler/clang.mk Tue Mar 19 21:12:47 2024 @@ -1,4 +1,4 @@ -# $NetBSD: clang.mk,v 1.42 2023/10/18 08:48:51 jperkin Exp $ +# $NetBSD: clang.mk,v 1.43 2024/03/19 21:12:47 schmonz Exp $ # # This is the compiler definition for the clang compiler. # @@ -80,15 +80,44 @@ CWRAPPERS_PREPEND.cc+= -Qunused-argument _WRAP_EXTRA_ARGS.CXX+= -Qunused-arguments CWRAPPERS_APPEND.cxx+= -Qunused-arguments -# Xcode 12 has a zealous new default. Turn it off until we're ready, -# while allowing callers (or users, via CFLAGS/CPPFLAGS) to override. -.if ${OPSYS} == "Darwin" -_NOERROR_IMPLICIT_cmd= ${CCPATH} -\#\#\# -E -x c /dev/null 2>&1 \ +# Xcode 12 and upstream Clang 16 have a zealous new default that the +# wide world of random third-party software isn't ready for. Turn it +# back off by default. +# +# Packages and users can override via CFLAGS/CPPFLAGS. +_NOERROR_IMPLICIT_cmd= ${CCPATH} -\#\#\# -E -x c /dev/null \ + 2>&1 \ | ${GREP} -q Werror=implicit-function-declaration \ && ${ECHO} -Wno-error=implicit-function-declaration \ || ${TRUE} CWRAPPERS_PREPEND.cc+= ${_NOERROR_IMPLICIT_cmd:sh} -.endif + +# Xcode 15 (Apple clang-1500.3.9.4) and upstream Clang 16 have several +# more zealous new defaults. We can't default them off as precisely +# (they don't show up in `clang -###` output), so we simply attempt to +# turn them off for any clang that doesn't complain when we try. +# +# Packages and users can override via CFLAGS/CPPFLAGS. +# +# As soon as 2024Q1 branches, we should: +# +# 1. Do a bulk build with all these -Wno-error tweaks removed, so we can +# see how much is broken. +# 2. If it's "too much" breakage and we'll have to keep overriding these +# compiler defaults for "a while", find a way to accomplish them with +# fewer compiler invocations. (Some ideas: define a default +# FORCE_C_STD, or apply overrides keyed on CC_VERSION or similar.) Do +# a bulk build to make sure things continue to work as before. +# 3. Otherwise, fix as much as we can before 2024Q2. This will help with +# gcc 14 (which has many similar new defaults) as well. +_WERROR_CLANG16= implicit-int int-conversion incompatible-pointer-types +_NOERROR_CLANG16_cmd= for _warn_ in ${_WERROR_CLANG16}; do \ + ${CCPATH} -\#\#\# -Wno-error=$${_warn_} -x c /dev/null \ + >/dev/null 2>&1 \ + && ${ECHO} -Wno-error=$${_warn_} \ + || ${TRUE}; \ + done +CWRAPPERS_PREPEND.cc+= ${_NOERROR_CLANG16_cmd:sh} .for _version_ in ${_CXX_STD_VERSIONS} _CXX_STD_FLAG.${_version_}?= -std=${_version_} --_----------=_1710882768295830--