tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sysutils/xentools418 CHECK_RELRO_SKIP



> On Jan 8, 2024, at 1:56 PM, Brook Milligan <brook%nmsu.edu@localhost> wrote:
> 
> The sysutils/xentools418 package has the following in Makefile:
> 
> CHECK_RELRO_SKIP+=    lib/debug/usr/pkg/libexec/xen/boot/xen-shim-syms
> 
> For nonstandard prefixes, the RELRO check fails with "missing RELRO” because the actual xen-shim-syms file (which has something other than /usr/pkg in its path) is not skipped.  It would seem that the correct fix would be to replace /usr/pkg with ${PREFIX} in that line, but that also fails in the same way.  Replacing /usr/pkg with the actual nonstandard prefix does skip the check as intended, but is clearly not the solution.
> 
> What is the best way of fixing this?

OK, after some tries, I did find a way to handle this with the two patches below:

— sysutils/xentools418/Makefile.orig	2023-11-21 04:37:03.000000000 -0700
+++ sysutils/xentools418/Makefile	2024-01-08 15:16:20.948063872 -0700
@@ -40,7 +40,7 @@
 			tools/qemu-xen/scripts/qemu-binfmt-conf.sh
 CHECK_RELRO_SKIP=	libexec/xen/boot/hvmloader
 CHECK_RELRO_SKIP+=	libexec/xen/boot/xen-shim
-CHECK_RELRO_SKIP+=	lib/debug/usr/pkg/libexec/xen/boot/xen-shim-syms
+CHECK_RELRO_SKIP+=	lib/debug/@PREFIX@/libexec/xen/boot/xen-shim-syms
 
 EGDIR=			${PREFIX}/share/examples/xen
 MESSAGE_SUBST+=		EGDIR=${EGDIR}



— mk/check/check-relro.mk.orig	2022-11-23 04:55:43.000000000 -0700
+++ mk/check/check-relro.mk	2024-01-08 15:11:35.835400766 -0700
@@ -76,7 +76,7 @@
 	${EGREP} -h ${_CHECK_RELRO_ERE:Q} |				\
 	while read file; do						\
 		case "$$file" in					\
-		${CHECK_RELRO_SKIP:@p@${p}) continue ;;@}		\
+		${CHECK_RELRO_SKIP:@p@${p:S,/@PREFIX@,${PREFIX},g}) continue ;;@}		\
 		*) ;;							\
 		esac;							\
 		${ECHO} $$file;						\


Is this the best solution?  Other ideas?

Cheers,
Brook



Home | Main Index | Thread Index | Old Index