Skip to content

Commit

Permalink
emulators/wine: Fix crash due to ASLR
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
stesser committed Jul 24, 2022
1 parent 4ec605c commit 116e5db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions emulators/wine/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PORTNAME= wine
DISTVERSION= 6.0.4
PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= emulators
MASTER_SITES= SF/${PORTNAME}/Source \
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 116e5db

Please sign in to comment.