From nobody Fri Feb 18 18:15:23 2022 X-Original-To: dev-commits-ports-main@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 9494819E1426; Fri, 18 Feb 2022 18:15:23 +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 4K0fxl3p1Vz4c6n; Fri, 18 Feb 2022 18:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645208123; 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=Nt2398G6KLzy+acZ6C+NxlaSFDmkK/kAi0weQ0QCiJk=; b=sXcAvW3hD5qgx63jNIv/Nk6Tn0bLJ300Q+vWYbrOxHPh59vNfaTewfmlKFxPwCe+43hV+b K/tdnOy5E8wP1Svk5HvefJ+fL3UqStNeukoZrNxKcIrzUiYHOilHzoFSzdb5DIZs5Bm9VB kaNnY82bSo7Qpzt210CwRVSfrPE+yJdhNVbPi861Cd5whRmJ20HQV7hxdYbpeMgTN0r+Lr 4zZ3bVNY70FerGI0+qNiTgPjmMSMaB78BWOfum+nY30IFnMqFaqFP7ZsqZj+DjTmtFjvku LZSQbUJ/S1US6L01zfTIrnBh7lvOsgGthb/0Zf4601eyfSgciVhV38YIBbsIKg== 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 6233822410; Fri, 18 Feb 2022 18:15:23 +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 21IIFNl3047824; Fri, 18 Feb 2022 18:15:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21IIFNkk047823; Fri, 18 Feb 2022 18:15:23 GMT (envelope-from git) Date: Fri, 18 Feb 2022 18:15:23 GMT Message-Id: <202202181815.21IIFNkk047823@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: 092c4b37c180 - main - Mk/Uses: Add elfctl List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@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: 092c4b37c1802b46f3c54244e5880d4bf7515c0b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645208123; 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=Nt2398G6KLzy+acZ6C+NxlaSFDmkK/kAi0weQ0QCiJk=; b=OXXUWstcrEVpNkvWTz52XXnKxPUKOdwmiESJ7mNbseOeWz0Pg6esvx/y62EffcAU1nexsY gtF3gpcK7eNZGY1+tyUJEQ1TEgG/a9PWC02oQ8MlddXhVzv4NABqt0dX+0YhXurWWPuLvg kY1QkUzDTjP4YpmAd5fB0TG+9ubJuzLQoSxOmlGs/QwVA4OEbU793fX+CPjTL63PRETXBz oqaRll0p7y0uVkPYVRJHMw9a9RlyNVRaLtBJJBmYnf2QEiSSIRPjGa1kSSv76o3xmATYiH JoIUGuGBbQAarn8YxlHC/BvQLBZnF4NcONZcvHl6C4c2gePoq+AFwlB0psHj1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645208123; a=rsa-sha256; cv=none; b=InXu3/bpj7Z0QmSas6V4Lp8PwOtIRWZoyXPQs+T3LIsZRkCs/PYVxvih96l3II0Gtrx72z 0x/oC4jokzRI9krBEi2x33bUkQghXLesRrpMRGaZ72klXKYiUV3GpgCAXZsvnr1E3gNy+a adK3AconNTcRSH6E+jvuudzreG1P5Bwr7M79Q2I+I8cTRvHJ+xf+WVTceGkYcCB6bsJGbV Q+a9dKT8xa0tM0vEpRXJ6gUEXLGDPSOXhsAsiD6ZNEnj30Dh5qfFh5aNKl1/9P9Ac/r4QY NISAT0sFaOVvEYKgCtxF6z+M5+AwwliN0xrjjV2ovt/1/zcBY6ITGjZgWPMMCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/ports/commit/?id=092c4b37c1802b46f3c54244e5880d4bf7515c0b commit 092c4b37c1802b46f3c54244e5880d4bf7515c0b Author: Joseph Mingrone AuthorDate: 2022-01-31 23:11:26 +0000 Commit: Joseph Mingrone CommitDate: 2022-02-18 18:15:08 +0000 Mk/Uses: Add elfctl Add USES=elfctl to change an ELF binary's feature control note. Example: USES= elfctl ELF_FEATURES= +noaslr,wxneeded:foo Reported by: emaste Approved by: brooks, tcberner (portmgr) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34125 --- Mk/Uses/elfctl.mk | 27 +++++++++++++++++++++++++++ Mk/bsd.commands.mk | 1 + 2 files changed, 28 insertions(+) diff --git a/Mk/Uses/elfctl.mk b/Mk/Uses/elfctl.mk new file mode 100644 index 000000000000..442f13db596f --- /dev/null +++ b/Mk/Uses/elfctl.mk @@ -0,0 +1,27 @@ +# Change an ELF binary's feature control note +# +# Feature: elfctl +# Usage: USES=elfctl +# Valid ARGS: none +# +# Variables +# +# ELF_FEATURES= featurelist:path/to/file1 \ +# featurelist:path/to/file1 \ + featurelist:path/to/file2 +# +# The file paths listed in ELF_FEATURES are relative to ${BUILD_WRKSRC}. +# + +.if !defined(_INCLUDE_USES_ELFCTL_MK) +_INCLUDE_USES_ELFCTL_MK= yes + +. if ! empty(ELF_FEATURES) +_USES_build+= 720:elfctl-post-build +elfctl-post-build: +. for feat in ${ELF_FEATURES} + ${ELFCTL} -i -e ${feat:C/:.*//} ${BUILD_WRKSRC}/${feat:C/.*://} +. endfor +. endif + +.endif diff --git a/Mk/bsd.commands.mk b/Mk/bsd.commands.mk index 620c62eb1533..221a04e4b8f2 100644 --- a/Mk/bsd.commands.mk +++ b/Mk/bsd.commands.mk @@ -34,6 +34,7 @@ DIALOG4PORTS?= ${LOCALBASE}/bin/dialog4ports DIFF?= /usr/bin/diff DIRNAME?= /usr/bin/dirname EGREP?= /usr/bin/egrep +ELFCTL?= /usr/bin/elfctl EXPR?= /bin/expr FALSE?= false # Shell builtin FILE?= /usr/bin/file