git: 8bd17eb4fc9f - main - emulators/qemu-user-static: unbreak with kern.elf64.allow_wx=0

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Mon, 11 Sep 2023 22:03:43 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8bd17eb4fc9ff06ef48956ddd6299b5d4871b713

commit 8bd17eb4fc9ff06ef48956ddd6299b5d4871b713
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-09-11 20:26:38 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-09-11 21:15:38 +0000

    emulators/qemu-user-static: unbreak with kern.elf64.allow_wx=0
    
    $ qemu-aarch64-static /dev/null
    qemu_mprotect__osdep: mprotect failed: Permission denied
    mprotect of jit buffer: Permission denied
---
 emulators/qemu-user-static-devel/Makefile | 6 ++++--
 emulators/qemu-user-static/Makefile       | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/emulators/qemu-user-static-devel/Makefile b/emulators/qemu-user-static-devel/Makefile
index 8969ee4d55e4..cc9cb0c72d8e 100644
--- a/emulators/qemu-user-static-devel/Makefile
+++ b/emulators/qemu-user-static-devel/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	qemu
 PORTVERSION=	6.2.50
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	emulators
 PKGNAMESUFFIX=	-user-static-devel
 DIST_SUBDIR=	qemu/${PORTVERSION}
@@ -21,7 +21,7 @@ BUILD_DEPENDS=	${LOCALBASE}/lib/libglib-2.0.a:devel/glib20 \
 		bash:shells/bash \
 		meson>=0.57.1_1:devel/meson
 
-USES=		bison compiler:c11 cpe gmake ninja:build perl5 pkgconfig python:build
+USES=		bison compiler:c11 cpe elfctl gmake ninja:build perl5 pkgconfig python:build
 
 USE_GITHUB=	yes
 GH_TUPLE=	qemu-bsd-user:qemu-bsd-user:64ff0f053df \
@@ -49,6 +49,8 @@ CONFIGURE_ARGS=	--prefix=${PREFIX} --cc=${CC} \
 		--disable-capstone \
 		--extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\"
 
+ELF_FEATURES=	+wxneeded:*-bsd-user/qemu-*
+
 TEST_TARGET=	check
 
 .include <bsd.port.pre.mk>
diff --git a/emulators/qemu-user-static/Makefile b/emulators/qemu-user-static/Makefile
index e070be60d3bf..ddb9ebef1478 100644
--- a/emulators/qemu-user-static/Makefile
+++ b/emulators/qemu-user-static/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	qemu
 PORTVERSION=	3.1.0
-PORTREVISION=	13
+PORTREVISION=	14
 CATEGORIES=	emulators
 PKGNAMESUFFIX=	-user-static
 DIST_SUBDIR=	qemu/${PORTVERSION}
@@ -15,13 +15,14 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 ONLY_FOR_ARCHS=		amd64 powerpc powerpc64
 CONFLICTS_INSTALL=	qemu-user-static-devel
 
-USES=		bison compiler:c11 cpe gmake perl5 pkgconfig python:build
+USES=		bison compiler:c11 cpe elfctl gmake perl5 pkgconfig python:build
 USE_GITHUB=	yes
 GH_TUPLE=	qemu-bsd-user:qemu-bsd-user:527096e0c8	\
 		qemu:keycodemapdb:10739aa:keycodemapdb/ui/keycodemapdb
 HAS_CONFIGURE=	yes
 USE_PERL5=	build
 MAKE_ENV+=	BSD_MAKE="${MAKE}" V=1
+ELF_FEATURES=	+wxneeded:*-bsd-user/qemu-*
 
 USE_RC_SUBR=	qemu_user_static
 SUB_LIST=	NAME=qemu_user_static