From nobody Sun Jul 09 17:52:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QzZTF0xlQz4mVs2; Sun, 9 Jul 2023 17:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QzZTD6xL1z3td6; Sun, 9 Jul 2023 17:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688925121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LhM1AyQwou3MAutMD1aHj+XvZ/0RVw+QcmMVVLeyoN4=; b=gMUj04ZySANZw2K1vaKYj6kCBZh+NVTcCY1nTSplTNTF3GRaZFGiAEFdwFYbraoXctsXQz w06+B1o0vs6GdAbfoXzRPZHMZSg/TTx6oz1dhbIqmBwtVCrMIZH/wnEAo10INuW8ldSN5q nE5z2720K9fxj6ZY1+uV91mWw7ozUzx/ot/2cxShFY1bupSj04DhYFNLP68SIJf1f0WTGT T4a4l/qpVQUexDUE+AcHrM3+XcJj5JpN/cpq2tgNDQf+HPPmvJQTaOku13J72JFSc9Bsgr jzP9dM8mRR1z5Y9npePUjDjPrkXxdH8sd+7W0uSsk91Lbs0zyHU41dTvaWCKBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688925121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LhM1AyQwou3MAutMD1aHj+XvZ/0RVw+QcmMVVLeyoN4=; b=EJhe4UotpCMgv8W3Rd1QYdjxBHPGbyoJHF1Zea4qvYpDajHQHsOMFdWYmhsZxRsXlM0oMQ SWT6oXMh/5WvlkdD0yeR+MmEch7u0hM9vW/BSpeADAPoJTk6wtoHZL1VLiVmZJNldxjbct XifgHF6vZ6esxQCHl7VD5EPefivfjZSfKwpGBGzZ66LOwt+bsRTWykuQBG2NiXfay0CgaZ 1KyT1KI1JEp63PzN0FRnbNrdEXhZ89EgipoBKunnOYa1k3/jibV3FvR0ExV9pMZsf0/Q53 hi29ZZKvGZJevVfDTeT1u/pTMQoFupiBWpnO1uTCuBscc0gV2Y8HGZPZAwIPpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688925121; a=rsa-sha256; cv=none; b=MH6JRJ8nbk2vOdC6EqOkROLlkBOjscjh6gFb+HhazQ/IRU0eyBy8MiC4YKLQfTma7IUBCG ZiwOM/5Zz7GlCACCxT8QdK6/0sRBvYJwscAI1TQxTGCkTTks+6eAbplwsbq2hb1TPuJn1Y nQuO7nmfAOBUbSjhgd5ptYB8u8Cve2vs7essFUzEPiFZbq76kH9FRxg5bBgoEjvW1aJjZF Y34vMQ3fB04B0+oao6mWStnz+P9FWk9KteRXNihrpF9VCKNkOYkDOmPV3TDvpfXLnVnmxQ 0lsYmhwtM+4ckAK+6vk8MhHEMIGgwZRvvYIY5oO+ESn9F8QkpO6v2o9PU38gaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QzZTD5KqQz1Bcp; Sun, 9 Jul 2023 17:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 369Hq02u097701; Sun, 9 Jul 2023 17:52:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 369Hq0EJ097689; Sun, 9 Jul 2023 17:52:00 GMT (envelope-from git) Date: Sun, 9 Jul 2023 17:52:00 GMT Message-Id: <202307091752.369Hq0EJ097689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 8fad2cda93c7 - main - bsd.compat.mk: Provide new CPP and sub-make variables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8fad2cda93c7930b01f25a2160e5c433085f13e3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8fad2cda93c7930b01f25a2160e5c433085f13e3 commit 8fad2cda93c7930b01f25a2160e5c433085f13e3 Author: Jessica Clarke AuthorDate: 2023-07-09 17:47:42 +0000 Commit: Jessica Clarke CommitDate: 2023-07-09 17:47:42 +0000 bsd.compat.mk: Provide new CPP and sub-make variables Currently the only way to detect for a libcompat build is to consult whether COMPAT_32BIT is defined (or equivalent, for downstreams with other libcompats or past releases with libsoft as COMPAT_SOFTFP). There are two issues with this: 1. COMPAT_32BIT is a new naming scheme that doesn't match the libcompat name, which is unnecessary deviation. 2. When multiple libcompats exist, everywhere that needs to detect a libcompat must check each variable in turn, despite the fact that it normally just wants to know if this is a libcompat build and perhaps what ${LIBCOMPAT} and/or ${libcompat} are for it. As a result, far too many places in the tree need to know about the set of possible libcompats. Instead, introduce two new CPP and sub-make variables, COMPAT_LIBCOMPAT and COMPAT_libcompat, which give the values for ${LIBCOMPAT} and ${libcompat} respectively, so that uses can be made parameterised. For when code really does need to know the specific libcompat, Makefiles can perform a string comparison, but the C preprocessor cannot, so introduce an additional CPP-only COMPAT_LIB${LIBCOMPAT} which is intended to replace the inconsistently-named COMPAT_32BIT (which will be removed in future). Uses of this new variable should still be kept to a minimum, however, given the code duplication needed for new libcompats. Reviewed by: emaste, brooks, jhb Differential Revision: https://reviews.freebsd.org/D40922 --- share/mk/bsd.compat.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk index 444a25101357..4b9bd7b621d2 100644 --- a/share/mk/bsd.compat.mk +++ b/share/mk/bsd.compat.mk @@ -115,11 +115,17 @@ WORLDTMP?= ${SYSROOT} LIB${_LIBCOMPAT}_OBJTOP?= ${OBJTOP}/obj-lib${_libcompat} LIB${_LIBCOMPAT}CFLAGS+= ${LIB${_LIBCOMPAT}CPUFLAGS} \ + -DCOMPAT_LIBCOMPAT=\"${_LIBCOMPAT}\" \ + -DCOMPAT_libcompat=\"${_libcompat}\" \ + -DCOMPAT_LIB${_LIBCOMPAT} \ --sysroot=${WORLDTMP} \ ${BFLAGS} LIB${_LIBCOMPAT}LDFLAGS+= -L${WORLDTMP}/usr/lib${_libcompat} +LIB${_LIBCOMPAT}WMAKEFLAGS+= COMPAT_LIBCOMPAT=${_LIBCOMPAT} \ + COMPAT_libcompat=${_libcompat} + LIB${_LIBCOMPAT}WMAKEENV+= MACHINE=${LIB${_LIBCOMPAT}_MACHINE} LIB${_LIBCOMPAT}WMAKEENV+= MACHINE_ARCH=${LIB${_LIBCOMPAT}_MACHINE_ARCH}