From nobody Tue Jun 27 23:11:53 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 4QrL7s5hNMz4kXT7; Tue, 27 Jun 2023 23:11:53 +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 4QrL7s530Jz4JSF; Tue, 27 Jun 2023 23:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687907513; 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=QinmUXArk40HtmnErXqAm3B91gpafM47vNYYH/v0rKM=; b=e/G7xmG7/q0nUl7GwBSNIrUOfcTFIPXJRpnTZKgd1DR+rMGQ3WZ7srhu1A8kGgKCvvXm0q H2v7lehbVyry03ooK47EqebLye03CnLful/hvlHnNsuRchhijktv5wM8C0tX9OZa8ZgpdL sY0perD+KKKLAEDL8LKmimXq1R0j6g/S4p3X3JHad1vAk35POecQ7JjVbPYl3BW7Ke/43j Zk7XDZPuXa8TJIV/reFaGtnjc4Py7WJa8Ynbj5xs6fiujFcm+sHttjVsNN0+c2xtAqaniR DxgzsPISrgHzMfaQA3xaE6KnNRpS2sQdCVOKRTK6wjFeTkHTOPY1wvBhWRW1Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687907513; 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=QinmUXArk40HtmnErXqAm3B91gpafM47vNYYH/v0rKM=; b=Fg3Kpbx9hzpnnHWhW/gVWYak5O4LIe5aDxTM57dVRWshAYJxKtacQxkQmrQ5VM04Me0w+U yWNQYi1nFnYTw+x//AtSh691qcr4MO4Nmjpq92p9aa60bwI/C3yplawOY7HS2LRUTxq08r UUExm55IlomQwOEaCDiJiIOU2k3IOl4a4XoxnlbpC44kchExn9MMVzK71ywyTg5258TLth GljkuXJGF9HTUW4LOTdBI/5ZE1EPnCGtOZTwaYNFi771kgLOxxtOjkC7TLeOnZgFWegTRN jev0JlfaR4ARLt8jTfJPC8Rvpvxxa1HrwuUDRFBw7OqDhqWwdeGFgNEkVp39sQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687907513; a=rsa-sha256; cv=none; b=q3elPYzvKr31MN4kOMkfxP1YBFkkN0Wb3dHZ6PFVGuzX3sIydJDauH9RuuljSLGRVZwau/ YfU451vb5++t9YDTLJ1eI+v7eXFZQ+IOl6Ca8Y8Or+IZHHzN3+AvML6267R4ywfdbkwZwt mWH4NlLi2++SxbW0qgZonPLDDvCGpv410NEcrnRn5VrPNU8C8ENaiQisee59ATgsDMgavj eBw/G8W7lpGi80iqEjv5cLjkrvsLaaHRBMb4ZgBy/CgeF1h/9glH0U/J5LNBcuG8/3ib2S X13xyOOIJ2bCxKfVN2FKoP6dHWCkxHnW/U89pyVKQXyTdRy6w8OVjcJPhPEOkA== 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 4QrL7s3WDwz19Vn; Tue, 27 Jun 2023 23:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35RNBrFl008986; Tue, 27 Jun 2023 23:11:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35RNBrkU008985; Tue, 27 Jun 2023 23:11:53 GMT (envelope-from git) Date: Tue, 27 Jun 2023 23:11:53 GMT Message-Id: <202306272311.35RNBrkU008985@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: 10afc5eada47 - main - Makefile.libcompat: Handle MK_FOO varying for native and compat arches 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: 10afc5eada472f7903238c7021a00f722f49a789 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=10afc5eada472f7903238c7021a00f722f49a789 commit 10afc5eada472f7903238c7021a00f722f49a789 Author: Jessica Clarke AuthorDate: 2023-06-27 23:10:30 +0000 Commit: Jessica Clarke CommitDate: 2023-06-27 23:10:30 +0000 Makefile.libcompat: Handle MK_FOO varying for native and compat arches Currently Makefile.libcompat queries a few MK_FOO variables to determine what is being built. However, it is plausible (and indeed, downstream in CheriBSD, this is the case) that these may vary between the native and the compat architecture. In order to correctly determine their values for the compat architecture, we need to defer their evaluation until we are in the compat sub-make where src.opts.mk will give us the right value for the compat MACHINE_ARCH. Reviewed by: brooks, jhb, imp Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D40570 --- Makefile.libcompat | 56 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/Makefile.libcompat b/Makefile.libcompat index 05e77a980b6a..11668bf54eda 100644 --- a/Makefile.libcompat +++ b/Makefile.libcompat @@ -39,20 +39,6 @@ LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR=*} \ MK_INCLUDES=no \ -DLIBRARIES_ONLY -_LC_LIBDIRS.yes= lib -_LC_LIBDIRS.yes+= gnu/lib -_LC_LIBDIRS.${MK_CDDL:tl}+= cddl/lib -_LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib -_LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib - -.if ${MK_FILE} != "no" -_libmagic= lib/libmagic -.endif -.if ${MK_PMC} != "no" -_jevents= lib/libpmc/pmu-events -.endif - - # Shared logic build${libcompat}: .PHONY @echo @@ -65,16 +51,14 @@ build${libcompat}: .PHONY ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \ -p ${WORLDTMP}/usr/lib/debug/usr >/dev/null .endif -.for _dir in lib/ncurses/tinfo ${_libmagic} ${_jevents} -.for _t in ${_obj} build-tools - ${_+_}cd ${.CURDIR}/${_dir}; \ + ${_+_}cd ${.CURDIR}; \ WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ - ${MAKE} DESTDIR= \ + ${MAKE} -f Makefile.inc1 \ + DESTDIR= \ OBJTOP=${LIBCOMPAT_OBJTOP} \ OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ - DIRPRFX=${_dir}/ \ -DNO_LINT \ -DNO_CPU_CFLAGS \ MK_ASAN=no \ @@ -83,15 +67,41 @@ build${libcompat}: .PHONY MK_SSP=no \ MK_UBSAN=no \ MK_WERROR=no \ - ${_t} -.endfor -.endfor + _lc_build-tools ${_+_}cd ${.CURDIR}; \ ${LIBCOMPATWMAKE} -f Makefile.inc1 -DNO_FSCHG libraries distribute${libcompat} install${libcompat}: .PHONY + ${_+_}cd ${.CURDIR}; \ + ${LIBCOMPATIMAKE} -f Makefile.inc1 _lc_${.TARGET:S/${libcompat}$//} + +# These depend on MK_*, which could vary between the native and compat +# architectures. Thus targets using them are run within a compat sub-make +# rather than the native make environment. + +_LC_LIBDIRS.yes= lib +_LC_LIBDIRS.yes+= gnu/lib +_LC_LIBDIRS.${MK_CDDL:tl}+= cddl/lib +_LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib +_LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib + +.if ${MK_FILE} != "no" +_libmagic= lib/libmagic +.endif +.if ${MK_PMC} != "no" +_jevents= lib/libpmc/pmu-events +.endif + +_lc_build-tools: +.for _dir in lib/ncurses/tinfo ${_libmagic} ${_jevents} +.for _t in ${_obj} build-tools + ${_+_}cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ ${_t} +.endfor +.endfor + +_lc_distribute _lc_install: .for _dir in ${_LC_LIBDIRS.yes} - ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATIMAKE} ${.TARGET:S/${libcompat}$//} + ${_+_}cd ${.CURDIR}/${_dir}; ${MAKE} ${.TARGET:S/^_lc_//} .endfor .endif # !targets(__<${_this:T}>__)