From nobody Sun Jan 5 13:50:49 2025 X-Original-To: dev-commits-ports-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 4YQzGx5Yg8z5jjCj; Sun, 05 Jan 2025 13:50:49 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YQzGx4hxHz4pGV; Sun, 5 Jan 2025 13:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736085049; 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=LWPL2GreQAc938hMR0sMoAo7/EGTs73IkXqo6egqIg8=; b=s1thxCDVq/deWxmEY6RZN+NXkJYxpdRfJCD2K27zs7L7X+WJPC6EgHluigOdRmWl4Sit5w aA5oXruRw0WCyXFXPMC/E3dGbeiYWlik/0x2UDRXtUeQKs/qoDCmzOfxrLH6982vfO7jp3 NWpsGi+lmCSSwvm8hQ2+wIp2uTO7StASvz/0qewlyIaostHuowYTVO74i9d9mFdbet/ROa JzugDAJhTboMBN7ariABkuStV8HnHeGDum8Q8V6kKvuWuxdBomYQS1rzTVjRR0xIdqTfMy AbreZM+QwACf3MUegsneLb+nd5qtyb5fCTjvrEsxpZgLflh8bNBiJJi9BPjW5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736085049; 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=LWPL2GreQAc938hMR0sMoAo7/EGTs73IkXqo6egqIg8=; b=IhVUSZx4Nnv+xbNMkKGnpq/NBc/cPwZTJ3nBo0ZqeEyMntM6NkxZ6QYs4nonzISg+A1OI4 qMQMcuDZKVb8I6JIv3fASFgtgPBRt/+WnUgqHL5HWz5/kWG+nBGVC5GDFqIS6a0kFM1T3s Mw4aEMpQYKOiHOHGCHpdPZL4UTJ5Yxvyp6A9QKhXMy9EJMq+KZL2rifDbQg4rJRkuzMRC9 goybMZqV4mLW/I/CItwcI7GTy3wM5cjgc8frJejXnM8VEL4wkJbX8AyvIt6/CcKMT399z8 sBivlkjGac6sWE3CBCOPkxXlKoAW9Zt2GbT6UG6lS2euiicJLUvrZE4BkhAYxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736085049; a=rsa-sha256; cv=none; b=RvofjrgqwRwsdn0UYsP4E55E2ClBaULCaN+RzQ+kmdR+ywt2Yym30ti55TulNjOvhZHzwf 2FM2iChwI46rU0uGOqsKb8DeefKN9uVhO/MDbBDvnnJmSgvqb2M6d9Ea/PsQ+OrY98+Siw FopzG6Sd5O8hJ2T5uplkbzwCUHuLNBQhGY5OI8EIqsAO2bN/GDIIZCmfx6lqdse3zrf6aY uPYHrGrKc40oEggSVdPFKHyVkZUCHqFlOLE65DdMHB8c/ontpEAglkNpB7T609gB5T0hAu RPxsWQxYC7E9FqLxMl1V3TKqj5LjKN1W7NeHs/blvNCDBljJYLDLUE4ajELzVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YQzGx3mnhzhSG; Sun, 05 Jan 2025 13:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 505Donnt037659; Sun, 5 Jan 2025 13:50:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 505DonpA037656; Sun, 5 Jan 2025 13:50:49 GMT (envelope-from git) Date: Sun, 5 Jan 2025 13:50:49 GMT Message-Id: <202501051350.505DonpA037656@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Joseph Mingrone Subject: git: 7a0d64f7840e - main - Mk/Uses/elfctl.mk: Add `build` and `stage` arguments List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a0d64f7840e94f000f3cacbd959147d54cfe37b Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/ports/commit/?id=7a0d64f7840e94f000f3cacbd959147d54cfe37b commit 7a0d64f7840e94f000f3cacbd959147d54cfe37b Author: Joseph Mingrone AuthorDate: 2025-01-04 22:11:25 +0000 Commit: Joseph Mingrone CommitDate: 2025-01-05 13:50:45 +0000 Mk/Uses/elfctl.mk: Add `build` and `stage` arguments Introduce new arguments, `build` and `stage`, to control the location and timing of ELF feature flag modifications. Files listed in ELF_FEATURES are interpreted as relative to: - ${BUILD_WRKSRC} when the `build` argument is supplied - ${STAGEDIR} when the `stage` argument is supplied Operating on binaries under ${STAGEDIR} is useful when binaries are modified after the build phase. Conversely, working with binaries under ${BUILD_WRKSRC} is preferable when test targets are run against the build tree. Reviewed by: arrowd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48324 --- Mk/Uses/elfctl.mk | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/Mk/Uses/elfctl.mk b/Mk/Uses/elfctl.mk index 442f13db596f..446a57c43425 100644 --- a/Mk/Uses/elfctl.mk +++ b/Mk/Uses/elfctl.mk @@ -1,26 +1,39 @@ -# Change an ELF binary's feature control note +# Set ELF binary feature control notes # # Feature: elfctl -# Usage: USES=elfctl -# Valid ARGS: none +# Usage: USES=elfctl or USES=elfctl:ARGS +# Valid ARGS: build (default, implicit), stage # -# Variables +# Files listed in ELF_FEATURES are relative to: +# - ${BUILD_WRKSRC} when the `build` argument is supplied +# - ${STAGEDIR} when the `stage` argument is supplied. # -# ELF_FEATURES= featurelist:path/to/file1 \ -# featurelist:path/to/file1 \ - featurelist:path/to/file2 +# Variables: # -# The file paths listed in ELF_FEATURES are relative to ${BUILD_WRKSRC}. +# ELF_FEATURES= featurelist:path/to/file1 \ +# featurelist:path/to/file2 # .if !defined(_INCLUDE_USES_ELFCTL_MK) _INCLUDE_USES_ELFCTL_MK= yes -. if ! empty(ELF_FEATURES) -_USES_build+= 720:elfctl-post-build -elfctl-post-build: +. if empty(elfctl_ARGS) +elfctl_ARGS= build +. endif + +. if ${elfctl_ARGS} == "build" +_ELFCTL_TOPDIR= ${BUILD_WRKSRC} +. elif ${elfctl_ARGS} == "stage" +_ELFCTL_TOPDIR= ${STAGEDIR} +. else +IGNORE= USES=elfctl - invalid args: [${elfctl_ARGS}] specified +. endif + +. if !empty(ELF_FEATURES) +_USES_${elfctl_ARGS}+= 720:elfctl-post-${elfctl_ARGS} +elfctl-post-${elfctl_ARGS}: . for feat in ${ELF_FEATURES} - ${ELFCTL} -i -e ${feat:C/:.*//} ${BUILD_WRKSRC}/${feat:C/.*://} + ${ELFCTL} -i -e ${feat:C/:.*//} ${_ELFCTL_TOPDIR}/${feat:C/.*://} . endfor . endif