Saturday, December 28, 2019

WIP: Tor Browser 9.0.2

Hi,

Below is a work in progress diff that updates the Tor Browser suite
to 9.0.2. I want to stress that I don't have any experience with
the Mozilla or Tor Browser code base so I would like someone more
familiar with those code bases to look at my diff very critically.

About the diff:

According to the release notes of Tor Browser 9.0 [1], the Tor Button
and Tor Launcher have been integrated more tightly into the browser.
This means that the ports for those can be removed. The source code of
the Tor Launcher is supposed to be copied into the Tor Browser source
during the build [2] [3]; the post-extract target takes care of that.

During the configure stage, I got the following error:
mozbuild.configure.options.InvalidOptionError: --disable-eme is not available in this configuration
In interest of getting as far as I could I patched away that flag (for
now; see patch-_mozconfig) but that is not a proper solution. I'm still
looking for a solution (hints are appreciated, of course).

I think it is necessary to first address the --disable-eme problem
before we can even think about committing this.

Did I use the @conflict and @pkgpath markers in PLIST correctly? I want
to express the fact that tor-launcher conflicts with tb-browser because
share/tor-browser/torrc-defaults used to be shipped with tor-launcher
but it now shipped with tb-browser.

I built and tested this on amd64, seems to work fine here.

Feedback appreciated.

Thanks,
Caspar Schutijser

1: https://blog.torproject.org/new-release-tor-browser-90
2: https://gitweb.torproject.org/builders/tor-browser-build.git/commit/?id=6d94f73dc055c1739a67ffd422f7f5bf29218723
3: https://trac.torproject.org/projects/tor/wiki/doc/TorBrowser/Hacking#BuildingJustFirefox

--

Index: devel/quirks/Makefile
===================================================================
RCS file: /cvs/ports/devel/quirks/Makefile,v
retrieving revision 1.823
diff -u -p -r1.823 Makefile
--- devel/quirks/Makefile 27 Dec 2019 05:11:30 -0000 1.823
+++ devel/quirks/Makefile 28 Dec 2019 08:04:18 -0000
@@ -5,7 +5,7 @@ CATEGORIES = devel databases
DISTFILES =

# API.rev
-PKGNAME = quirks-3.214
+PKGNAME = quirks-3.215
PKG_ARCH = *
MAINTAINER = Marc Espie <espie@openbsd.org>

Index: devel/quirks/files/Quirks.pm
===================================================================
RCS file: /cvs/ports/devel/quirks/files/Quirks.pm,v
retrieving revision 1.840
diff -u -p -r1.840 Quirks.pm
--- devel/quirks/files/Quirks.pm 27 Dec 2019 05:11:30 -0000 1.840
+++ devel/quirks/files/Quirks.pm 28 Dec 2019 08:04:18 -0000
@@ -1353,6 +1353,8 @@ my $obsolete_reason = {
'py-libnacl' => 3,
'py3-libnacl' => 3,
'py3-typing' => 5,
+ 'torbutton' => 5,
+ 'tor-launcher' => 5,
};

# reasons for obsolete packages
Index: meta/tor-browser/Makefile
===================================================================
RCS file: /cvs/ports/meta/tor-browser/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- meta/tor-browser/Makefile 2 Sep 2019 06:35:42 -0000 1.18
+++ meta/tor-browser/Makefile 28 Dec 2019 08:04:18 -0000
@@ -4,14 +4,12 @@ COMMENT= Tor Browser meta package

MAINTAINER= Sean Levy <attila@stalphonsos.com>

-PKGNAME= tor-browser-8.0.9
-ONLY_FOR_ARCHS = amd64 i386
+PKGNAME= tor-browser-9.0.2
+ONLY_FOR_ARCHS = amd64 i386 aarch64

-RUN_DEPENDS= www/tor-browser/browser>=8.0.9 \
- www/tor-browser/torbutton>=2.0.13 \
- www/tor-browser/tor-launcher>=0.2.16.6p1 \
- www/tor-browser/noscript>=10.6.1 \
- www/tor-browser/https-everywhere>=2019.1.31p0 \
- net/tor>=0.3.5.8
+RUN_DEPENDS= www/tor-browser/browser>=9.0.2 \
+ www/tor-browser/noscript>=11.0.9 \
+ www/tor-browser/https-everywhere>=2019.11.7 \
+ net/tor>=0.4.1.6

.include <bsd.port.mk>
Index: www/tor-browser/Makefile
===================================================================
RCS file: /cvs/ports/www/tor-browser/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- www/tor-browser/Makefile 13 Nov 2016 21:15:43 -0000 1.1.1.1
+++ www/tor-browser/Makefile 28 Dec 2019 08:04:18 -0000
@@ -2,8 +2,6 @@

SUBDIR =
SUBDIR += browser
- SUBDIR += torbutton
- SUBDIR += tor-launcher
SUBDIR += noscript
SUBDIR += https-everywhere

Index: www/tor-browser/Makefile.inc
===================================================================
RCS file: /cvs/ports/www/tor-browser/Makefile.inc,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile.inc
--- www/tor-browser/Makefile.inc 13 Jul 2019 10:59:27 -0000 1.18
+++ www/tor-browser/Makefile.inc 28 Dec 2019 08:04:18 -0000
@@ -2,11 +2,10 @@

MAINTAINER ?= Sean Levy <attila@stalphonsos.com>
HOMEPAGE ?= https://www.torproject.org
-MASTER_SITES ?= https://bits.torbsd.org/pub/OpenBSD/distfiles/
PERMIT_PACKAGE ?= Yes
CATEGORIES = www
BROWSER_NAME = tor-browser
-TB_VERSION = 8.0.9
+TB_VERSION = 9.0.2
TB_PREFIX = tb

SUBST_VARS += BROWSER_NAME TB_VERSION
Index: www/tor-browser/browser/Makefile
===================================================================
RCS file: /cvs/ports/www/tor-browser/browser/Makefile,v
retrieving revision 1.37
diff -u -p -r1.37 Makefile
--- www/tor-browser/browser/Makefile 1 Oct 2019 04:39:32 -0000 1.37
+++ www/tor-browser/browser/Makefile 28 Dec 2019 08:04:18 -0000
@@ -4,22 +4,23 @@
# Makefile when editing this one (ESR versions not always the same).

COMMENT = modified version of Firefox ESR for browsing over Tor
-ONLY_FOR_ARCHS = amd64 i386
-
-BROKEN = (unintentionally) broken by lang/rust 1.38.0
+ONLY_FOR_ARCHS = amd64 i386 aarch64

MOZILLA_VERSION = ${TB_VERSION}
MOZILLA_PROJECT = ${BROWSER_NAME}
MOZILLA_CODENAME = browser
+TL_VERSION = 0.2.20.2

-EXTRACT_SUFX = .tar.gz
+EXTRACT_SUFX = .tar.xz
PATCHORIG = .pat.orig

PKGNAME = ${TB_PREFIX}-browser-${TB_VERSION}
-DISTNAME = ${BROWSER_NAME}-${TB_VERSION}
-REVISION = 1
+DISTNAME = src-firefox-tor-browser-68.3.0esr-9.0-1-build1
+
+DISTFILES += ${DISTNAME}.tar.xz \
+ src-tor-launcher-${TL_VERSION}.tar.xz

-SO_VERSION = 4.0
+SO_VERSION = 5.0
MOZILLA_LIBS = xul clearkey lgpllibs mozavcodec mozavutil mozgtk
MOZILLA_LIBS += freebl3 nss3 nssckbi nssdbm3
MOZILLA_LIBS += nssutil3 smime3 softokn3 ssl3
@@ -28,6 +29,8 @@ MOZILLA_LIBS += nspr4 mozsqlite3 plc4 p
# mozilla public license
PERMIT_PACKAGE= Yes

+MASTER_SITES = https://dist.torproject.org/torbrowser/${TB_VERSION}/
+
MODULES = www/mozilla lang/python

MODPY_RUNDEP = No
@@ -39,8 +42,6 @@ MODCLANG_ARCHS = amd64 i386
MOZILLA_USE_BUNDLED_LIBEVENT = Yes
# firefox >= 46 defaults to gtk+3
MOZILLA_USE_GTK3 = Yes
-# 56 requires 59.1
-MOZILLA_USE_BUNDLED_ICU = Yes
# 59 is broken with system cairo and the option is being dropped
MOZILLA_USE_BUNDLED_CAIRO = Yes
# #1460600
@@ -49,19 +50,33 @@ MOZILLA_USE_BUNDLED_HUNSPELL = Yes
MOZILLA_USE_BUNDLED_NSPR = Yes
MOZILLA_USE_BUNDLED_NSS = Yes
MOZILLA_USE_BUNDLED_SQLITE = Yes
+# 61 requires both versions of python
+BUILD_DEPENDS += lang/python/${MODPY_DEFAULT_VERSION_3}
+# 63 requires node because why not #1483595
+BUILD_DEPENDS += lang/node
+# 63 requires cbindgen #1478813
+BUILD_DEPENDS += devel/cbindgen>=0.9.0
+.if (${MACHINE_ARCH}==amd64) || (${MACHINE_ARCH}==i386)
+# 67 requires nasm for bundled libdav1d
+BUILD_DEPENDS += devel/nasm
+.endif

# firefox >= 53 needs rust
BUILD_DEPENDS += lang/rust
# stylo build needs LLVM
BUILD_DEPENDS += devel/llvm

-WANTLIB += X11-xcb Xcursor Xi fribidi intl xcb xcb-shm ${COMPILER_LIBCXX}
+# uses pledge()
+WANTLIB += X11-xcb Xcursor Xi intl xcb xcb-shm ${COMPILER_LIBCXX}

# Regression tests are too hard to adapt to run here
NO_TEST = Yes

+WRKDIST = ${WRKDIR}/${DISTNAME:S/src-//}
+
CONFIGURE_STYLE = simple
CONFIGURE_ARGS += --prefix=${PREFIX}
+MAKE_ENV += BUILD_VERBOSE_LOG="1" CARGOFLAGS="-j${MAKE_JOBS}"

# app-name etc. for tor-browser
CONFIGURE_ARGS += --with-app-name=${BROWSER_NAME} \
@@ -75,13 +90,16 @@ MAKE_ENV += BUILD_OPT=1 \
XCFLAGS="-I${LOCALBASE}/include ${CFLAGS}"
BUILD_DEPENDS += devel/py-virtualenv

-RUN_DEPENDS += net/tor>=0.3.4.8
+RUN_DEPENDS += net/tor>=0.4.1.6

-# bug 857628
-CONFIGURE_ARGS += --enable-pie
CONFIGURE_ARGS += --enable-release #1386371
-# rust-simd doesn't work with lang/rust>=1.33
-#CONFIGURE_ARGS += --enable-rust-simd #1261841
+CONFIGURE_ARGS += --enable-sandbox --enable-content-sandbox
+CONFIGURE_ARGS += --with-libclang-path=${LOCALBASE}/lib
+CONFIGURE_ARGS += --with-clang-path=${LOCALBASE}/bin/clang
+
+post-extract:
+ mv ${WRKDIR}/tor-launcher-${TL_VERSION}/ \
+ ${WRKSRC}/browser/extensions/tor-launcher

post-patch:
# hack config/baseconfig.mk to not use MOZ_APP_VERSION in a few places
@@ -90,6 +108,8 @@ post-patch:
# drop in sh front end to configure.py so CONFIGURE_STYLE=simple works
${SUBST_PROGRAM} ${FILESDIR}/configure ${WRKSRC}/configure
${SUBST_PROGRAM} ${FILESDIR}/configure ${WRKSRC}/js/src/configure
+ sed -i 's/"files":{[^}]*}/"files":{}/' \
+ ${WRKSRC}/third_party/rust/bindgen/.cargo-checksum.json

BROWSER_DIR = ${PREFIX}/lib/${BROWSER_NAME}
BROWSER_CFG = ${BROWSER_DIR}/${BROWSER_NAME}.cfg
@@ -123,5 +143,10 @@ post-install:
# link default48.png to default.png to be used by default
# by non-icccm compliant wm
ln -f ${BROWSER_DIR}/browser/chrome/icons/default/default{48,}.png
+
+ # install torrc-defaults for Tor Launcher
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/${BROWSER_NAME}
+ ${SUBST_DATA} ${FILESDIR}/torrc-defaults \
+ ${PREFIX}/share/${BROWSER_NAME}/torrc-defaults

.include <bsd.port.mk>
Index: www/tor-browser/browser/distinfo
===================================================================
RCS file: /cvs/ports/www/tor-browser/browser/distinfo,v
retrieving revision 1.16
diff -u -p -r1.16 distinfo
--- www/tor-browser/browser/distinfo 9 May 2019 06:31:17 -0000 1.16
+++ www/tor-browser/browser/distinfo 28 Dec 2019 08:04:18 -0000
@@ -1,2 +1,4 @@
-SHA256 (mozilla/tor-browser-8.0.9.tar.gz) = B2YOSrwnXSihuHRczush6oYeo9LPFSJGNqoTlE3cmAI=
-SIZE (mozilla/tor-browser-8.0.9.tar.gz) = 387604509
+SHA256 (mozilla/src-firefox-tor-browser-68.3.0esr-9.0-1-build1.tar.xz) = 8fezl2ui7kquB5CudU4Up7RIb9cOwHCJ/s1nn1OioAU=
+SHA256 (mozilla/src-tor-launcher-0.2.20.2.tar.xz) = YrAqGTnvO8p3mqnhlGinmt8YfiAMPVRoERAvJEid0MA=
+SIZE (mozilla/src-firefox-tor-browser-68.3.0esr-9.0-1-build1.tar.xz) = 348519124
+SIZE (mozilla/src-tor-launcher-0.2.20.2.tar.xz) = 222840
Index: www/tor-browser/browser/files/torrc-defaults
===================================================================
RCS file: www/tor-browser/browser/files/torrc-defaults
diff -N www/tor-browser/browser/files/torrc-defaults
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ www/tor-browser/browser/files/torrc-defaults 28 Dec 2019 08:04:18 -0000
@@ -0,0 +1,33 @@
+# If non-zero, try to write to disk less frequently than we would otherwise.
+AvoidDiskWrites 1
+# Where to send logging messages. Format is minSeverity[-maxSeverity]
+# (stderr|stdout|syslog|file FILENAME).
+Log notice stdout
+# Bind to this address to listen to connections from SOCKS-speaking
+# applications.
+## XXX I think these two directives are actually screwing us over:
+#SocksPort 9150
+#ControlPort 9151
+CookieAuthentication 1
+GeoIPFile ${LOCALBASE}/share/tor/geoip
+GeoIPv6File ${LOCALBASE}/share/tor/geoip6
+
+##
+## N.B. PT not yet done on OpenBSD: 2015-07-21
+##
+
+## fteproxy configuration
+#ClientTransportPlugin fte exec fteproxy --managed
+
+## obfs4proxy configuration
+#ClientTransportPlugin obfs2,obfs3,obfs4,scramblesuit exec obfs4proxy
+
+## flash proxy configuration
+#
+# Change the second number here (9000) to the number of a port that can
+# receive connections from the Internet (the port for which you
+# configured port forwarding).
+#ClientTransportPlugin flashproxy exec flashproxy-client --register :0 :9000
+
+## meek configuration
+#ClientTransportPlugin meek exec meek-client-torbrowser -- meek-client
Index: www/tor-browser/browser/patches/patch-_mozconfig
===================================================================
RCS file: /cvs/ports/www/tor-browser/browser/patches/patch-_mozconfig,v
retrieving revision 1.4
diff -u -p -r1.4 patch-_mozconfig
--- www/tor-browser/browser/patches/patch-_mozconfig 4 Oct 2018 19:56:38 -0000 1.4
+++ www/tor-browser/browser/patches/patch-_mozconfig 28 Dec 2019 08:04:18 -0000
@@ -1,10 +1,11 @@
$OpenBSD: patch-_mozconfig,v 1.4 2018/10/04 19:56:38 sthen Exp $

Disable the updater and related stuff. Does nothing under OpenBSD
+
Index: .mozconfig
--- .mozconfig.orig
+++ .mozconfig
-@@ -12,9 +12,9 @@ ac_add_options --enable-official-branding
+@@ -10,9 +10,9 @@ ac_add_options --enable-official-branding
# Let's support GTK3 for ESR60
ac_add_options --enable-default-toolkit=cairo-gtk3

@@ -17,10 +18,19 @@ Index: .mozconfig

ac_add_options --disable-strip
ac_add_options --disable-install-strip
-@@ -27,3 +27,6 @@ ac_add_options --disable-webrtc
- ac_add_options --disable-eme
- #ac_add_options --disable-ctypes
+@@ -21,8 +21,12 @@ ac_add_options --disable-debug
+ ac_add_options --disable-crashreporter
+ ac_add_options --disable-webrtc
+ # Let's make sure no preference is enabling either Adobe's or Google's CDM.
+-ac_add_options --disable-eme
++# XXX mozbuild.configure.options.InvalidOptionError: --disable-eme is not available in this configuration
++#ac_add_options --disable-eme
ac_add_options --enable-proxy-bypass-protection
+
+ # Disable telemetry
+-ac_add_options MOZ_TELEMETRY_REPORTING=
+\ No newline at end of file
+
+# avoid 1.1GB libxul
+ac_add_options --disable-debug-symbols
++ac_add_options MOZ_TELEMETRY_REPORTING=
Index: www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_components_tl-process_js
===================================================================
RCS file: www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_components_tl-process_js
diff -N www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_components_tl-process_js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_components_tl-process_js 28 Dec 2019 08:04:18 -0000
@@ -0,0 +1,38 @@
+$OpenBSD$
+
+Let geoip/geoip6 file paths be set by prefs like everything else and let
+the new getTorFile() deal with it.
+
+Index: browser/extensions/tor-launcher/src/components/tl-process.js
+--- browser/extensions/tor-launcher/src/components/tl-process.js.orig
++++ browser/extensions/tor-launcher/src/components/tl-process.js
+@@ -376,6 +376,8 @@ TorProcessService.prototype =
+ var torrcFile = TorLauncherUtil.getTorFile("torrc", true);
+ var torrcDefaultsFile =
+ TorLauncherUtil.getTorFile("torrc-defaults", false);
++ var geoipFile = TorLauncherUtil.getTorFile("geoip", false);
++ var geoip6File = TorLauncherUtil.getTorFile("geoip6", false);
+ var hashedPassword = this.mProtocolSvc.TorGetPassword(true);
+ var controlIPCFile = this.mProtocolSvc.TorGetControlIPCFile();
+ var controlPort = this.mProtocolSvc.TorGetControlPort();
+@@ -401,19 +403,14 @@ TorProcessService.prototype =
+ return;
+ }
+
+- // The geoip and geoip6 files are in the same directory as torrc-defaults.
+- var geoipFile = torrcDefaultsFile.clone();
+- geoipFile.leafName = "geoip";
+
+- var geoip6File = torrcDefaultsFile.clone();
+- geoip6File.leafName = "geoip6";
+-
+ var args = [];
+ if (torrcDefaultsFile)
+ {
+ args.push("--defaults-torrc");
+ args.push(torrcDefaultsFile.path);
+ }
++ args.push("--ignore-missing-torrc");
+ args.push("-f");
+ args.push(torrcFile.path);
+ args.push("DataDirectory");
Index: www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_defaults_preferences_torlauncher-prefs_js
===================================================================
RCS file: www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_defaults_preferences_torlauncher-prefs_js
diff -N www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_defaults_preferences_torlauncher-prefs_js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_defaults_preferences_torlauncher-prefs_js 28 Dec 2019 08:04:18 -0000
@@ -0,0 +1,28 @@
+$OpenBSD$
+
+Set all path-related prefs to minimize patching of tl-util.jsm/tl-process.js
+
+Index: browser/extensions/tor-launcher/src/defaults/preferences/torlauncher-prefs.js
+--- browser/extensions/tor-launcher/src/defaults/preferences/torlauncher-prefs.js.orig
++++ browser/extensions/tor-launcher/src/defaults/preferences/torlauncher-prefs.js
+@@ -43,14 +43,17 @@ pref("extensions.torlauncher.socks_port_flags", "IPv6T
+ // The tor_path is relative to the application directory. On Linux and
+ // Windows this is the Browser/ directory that contains the firefox
+ // executables, and on Mac OS it is the TorBrowser.app directory.
+-pref("extensions.torlauncher.tor_path", "");
++pref("extensions.torlauncher.tor_path", "/usr/local/bin/tor");
++pref("extensions.torlauncher.torrc-defaults_path", "/usr/local/share/tor-browser/torrc-defaults");
++pref("extensions.torlauncher.geoip_path", "/usr/local/share/tor/geoip");
++pref("extensions.torlauncher.geoip6_path", "/usr/local/share/tor/geoip6");
+
+ // The torrc_path and tordatadir_path are relative to the data directory,
+ // which is TorBrowser-Data/ if it exists as a sibling of the application
+ // directory. If TorBrowser-Data/ does not exist, these paths are relative
+ // to the TorBrowser/ directory within the application directory.
+-pref("extensions.torlauncher.torrc_path", "");
+-pref("extensions.torlauncher.tordatadir_path", "");
++pref("extensions.torlauncher.torrc_path", "torrc");
++pref("extensions.torlauncher.tordatadir_path", "tor_data");
+
+ // BridgeDB-related preferences (used for Moat).
+ pref("extensions.torlauncher.bridgedb_front", "ajax.aspnetcdn.com");
Index: www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_modules_tl-util_jsm
===================================================================
RCS file: www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_modules_tl-util_jsm
diff -N www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_modules_tl-util_jsm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_modules_tl-util_jsm 28 Dec 2019 08:04:18 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+Force DataOutsideOfAppDir on OpenBSD since it will always be true
+(turned on in ../browser/patches/patch-patch-xpcom_io_TorFileUtils_cpp)
+
+Index: browser/extensions/tor-launcher/src/modules/tl-util.jsm
+--- browser/extensions/tor-launcher/src/modules/tl-util.jsm.orig
++++ browser/extensions/tor-launcher/src/modules/tl-util.jsm
+@@ -810,7 +810,7 @@ let TLUtilInternal = // Private
+ mStringBundle : null,
+ mOS : "",
+ // mIsUserDataOutsideOfAppDir is true when TorBrowser-Data is used.
+- mIsUserDataOutsideOfAppDir: undefined, // Boolean (cached; access via
++ mIsUserDataOutsideOfAppDir: true, // Boolean (cached; access via
+ // this._isUserDataOutsideOfAppDir)
+ mAppDir: null, // nsIFile (cached; access via this._appDir)
+ mDataDir: null, // nsIFile (cached; access via this._dataDir)
Index: www/tor-browser/browser/patches/patch-config_system-headers_mozbuild
===================================================================
RCS file: www/tor-browser/browser/patches/patch-config_system-headers_mozbuild
diff -N www/tor-browser/browser/patches/patch-config_system-headers_mozbuild
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ www/tor-browser/browser/patches/patch-config_system-headers_mozbuild 28 Dec 2019 08:04:18 -0000
@@ -0,0 +1,27 @@
+$OpenBSD: patch-config_system-headers_mozbuild,v 1.1 2019/12/23 20:18:53 kurt Exp $
+
+https://hg.mozilla.org/mozilla-central/rev/d3885b9d42d3
+
+Index: config/system-headers.mozbuild
+--- config/system-headers.mozbuild.orig
++++ config/system-headers.mozbuild
+@@ -814,7 +814,6 @@ system_headers = [
+ 'synch.h',
+ 'syncmgr.h',
+ 'sys/atomic_op.h',
+- 'sys/auxv.h',
+ 'sys/bitypes.h',
+ 'sys/byteorder.h',
+ 'syscall.h',
+@@ -1345,6 +1344,11 @@ if CONFIG['MOZ_WAYLAND']:
+ 'wayland-client.h',
+ 'wayland-egl.h',
+ 'wayland-util.h',
++ ]
++
++if CONFIG['OS_TARGET'] in ('Android', 'Linux', 'FreeBSD'):
++ system_headers += [
++ 'sys/auxv.h',
+ ]
+
+ if CONFIG['OS_TARGET'] == 'Linux' and CONFIG['CPU_ARCH'].startswith('mips'):
Index: www/tor-browser/browser/patches/patch-intl_icu_source_Makefile_in
===================================================================
RCS file: /cvs/ports/www/tor-browser/browser/patches/patch-intl_icu_source_Makefile_in,v
retrieving revision 1.3
diff -u -p -r1.3 patch-intl_icu_source_Makefile_in
--- www/tor-browser/browser/patches/patch-intl_icu_source_Makefile_in 3 Oct 2018 14:55:36 -0000 1.3
+++ www/tor-browser/browser/patches/patch-intl_icu_source_Makefile_in 28 Dec 2019 08:04:18 -0000
@@ -1,4 +1,4 @@
-$OpenBSD: patch-intl_icu_source_Makefile_in,v 1.3 2018/10/03 14:55:36 sthen Exp $
+$OpenBSD: patch-intl_icu_source_Makefile_in,v 1.5 2019/09/03 16:31:12 landry Exp $

https://bugzilla.mozilla.org/show_bug.cgi?id=990196

@@ -10,10 +10,11 @@ gmake[6]: Leaving directory '/usr/obj/po
Makefile:77: recipe for target 'buildicu' failed

Patch taken from www/firefox-esr
+
Index: intl/icu/source/Makefile.in
--- intl/icu/source/Makefile.in.orig
+++ intl/icu/source/Makefile.in
-@@ -331,7 +331,7 @@ $(top_builddir)/config/pkgdataMakefile:
+@@ -337,7 +337,7 @@ $(top_builddir)/config/pkgdataMakefile:

$(top_builddir)/config/icu-config: $(top_builddir)/Makefile $(top_srcdir)/config/icu-config-top $(top_srcdir)/config/icu-config-bottom $(top_builddir)/config/Makefile.inc @platform_make_fragment@ $(top_srcdir)/config/make2sh.sed
-$(RMV) $@
Index: www/tor-browser/browser/patches/patch-js_src_jit_ProcessExecutableMemory_cpp
===================================================================
RCS file: www/tor-browser/browser/patches/patch-js_src_jit_ProcessExecutableMemory_cpp
diff -N www/tor-browser/browser/patches/patch-js_src_jit_ProcessExecutableMemory_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ www/tor-browser/browser/patches/patch-js_src_jit_ProcessExecutableMemory_cpp 28 Dec 2019 08:04:18 -0000
@@ -0,0 +1,29 @@
+$OpenBSD: patch-js_src_jit_ProcessExecutableMemory_cpp,v 1.4 2019/10/29 14:46:01 kurt Exp $
+
+Don't ComputeRandomAllocationAddress on OpenBSD
+https://bugzilla.mozilla.org/show_bug.cgi?id=1586912
+
+Index: js/src/jit/ProcessExecutableMemory.cpp
+--- js/src/jit/ProcessExecutableMemory.cpp.orig
++++ js/src/jit/ProcessExecutableMemory.cpp
+@@ -318,6 +318,12 @@ static void DecommitPages(void* addr, size_t bytes) {
+ }
+ #else // !XP_WIN
+ static void* ComputeRandomAllocationAddress() {
++#ifdef __OpenBSD__
++ // OpenBSD already has random mmap and the idea that all x64 cpus
++ // have 48-bit address space is not correct. Returning nullptr
++ // allows OpenBSD do to the right thing.
++ return nullptr;
++#else
+ uint64_t rand = js::GenerateRandomSeed();
+
+ # ifdef HAVE_64BIT_BUILD
+@@ -337,6 +343,7 @@ static void* ComputeRandomAllocationAddress() {
+ // Ensure page alignment.
+ uintptr_t mask = ~uintptr_t(gc::SystemPageSize() - 1);
+ return (void*)uintptr_t(rand & mask);
++

No comments:

Post a Comment