Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Dec 2020 04:10:54 +0000
From:      bugzilla-noreply@freebsd.org
To:        gecko@FreeBSD.org
Subject:   [Bug 239873] www/firefox and mail/thunderbird don't like the new ASLR "stackgap" feature
Message-ID:  <bug-239873-21738-Yy14jhumRa@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-239873-21738@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239873

--- Comment #8 from sigsys@gmail.com ---
This does it for all USE_GECKO ports (www/firefox, www/firefox-esr and
mail/thunderbird).

diff --git a/Mk/bsd.commands.mk b/Mk/bsd.commands.mk
index f1a229d04948..0d38d7b321bb 100644
--- a/Mk/bsd.commands.mk
+++ b/Mk/bsd.commands.mk
@@ -36,6 +36,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
diff --git a/Mk/bsd.gecko.mk b/Mk/bsd.gecko.mk
index b58e697c52a9..1881080a9d87 100644
--- a/Mk/bsd.gecko.mk
+++ b/Mk/bsd.gecko.mk
@@ -110,6 +110,7 @@ PLISTF?=    ${WRKDIR}/plist_files

 MOZCONFIG?=            ${WRKSRC}/.mozconfig
 MOZILLA_PLIST_DIRS?=   bin lib share/pixmaps share/applications
+MOZILLA_ELFCTLFIX_BINS?=       lib/${MOZILLA}/${MOZILLA}
lib/${MOZILLA}/${MOZILLA_BIN}

 # Adjust -C target-cpu if -march/-mcpu is set by bsd.cpu.mk
 .if ${ARCH} == amd64 || ${ARCH} == i386
@@ -376,7 +377,14 @@ pre-configure-script:
        @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}"
WRKDIR="${WRKDIR}" \
                ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh

-post-install-script: gecko-create-plist
+post-install-script: gecko-elfctlfix gecko-create-plist
+
+gecko-elfctlfix:
+# Avoids "too much recursion" errors when the ASLR "stackgap" is globally
enabled.
+.for bin in ${MOZILLA_ELFCTLFIX_BINS}
+       @if test -x ${ELFCTL} && ${ELFCTL} -l | ${GREP} -q aslrstkgap; then \
+               ${ELFCTL} -e +aslrstkgap ${STAGEDIR}${PREFIX}/${bin}; fi
+.endfor

 gecko-create-plist:
 # Create the plist

-- 
You are receiving this mail because:
You are the assignee for the bug.

help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-239873-21738-Yy14jhumRa>