emulators/wine: Fix crash due to ASLR

ASLR has been enabled by default on -CURRENT and -STABLE and this
causes Wine to crash. The clean solution would be to implement some
memory mapping code that already exists for macOS and Linux, but this
is not an essy task.

In order to allow use of Wine on systems with ASLR mark the Wine
executables as not compatible with ASLR using elfctl. This allows
to keeps ASLR enabled on the system for all other binaries.

If the required memory mapping functionality is made available, the
elfctl commands should be removed from this and the other Wine ports.

Approved by:	portmgr (implicit)
This commit is contained in:
Stefan Eßer 2022-07-24 23:05:50 +02:00
parent 4ec605c57c
commit 116e5db787

View File

@ -1,5 +1,6 @@
PORTNAME= wine
DISTVERSION= 6.0.4
PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= emulators
MASTER_SITES= SF/${PORTNAME}/Source \
@ -158,9 +159,11 @@ post-install:
.if ${ARCH} == i386
${MV} ${STAGEDIR}${PREFIX}/bin/wineserver ${STAGEDIR}${PREFIX}/bin/wineserver32
${MV} ${STAGEDIR}${PREFIX}/bin/wine ${STAGEDIR}${PREFIX}/bin/wine.bin
-${ELFCTL} -e +noaslr ${STAGEDIR}${PREFIX}/bin/wine.bin
${INSTALL_SCRIPT} ${FILESDIR}/wine.sh ${STAGEDIR}${PREFIX}/bin/wine
.else
${MV} ${STAGEDIR}${PREFIX}/bin/wine64 ${STAGEDIR}${PREFIX}/bin/wine64.bin
-${ELFCTL} -e +noaslr ${STAGEDIR}${PREFIX}/bin/wine64.bin
${INSTALL_SCRIPT} ${FILESDIR}/wine.sh ${STAGEDIR}${PREFIX}/bin/wine64
${INSTALL_SCRIPT} ${FILESDIR}/wine-wow64.sh ${STAGEDIR}${PREFIX}/bin/wine
${INSTALL_SCRIPT} ${FILESDIR}/pkg32.sh ${STAGEDIR}${DATADIR}/pkg32.sh