From 17eeda78f49fd0f938c9664fc374db40b1dccafa Mon Sep 17 00:00:00 2001 From: q66 Date: Tue, 25 May 2021 01:52:42 +0200 Subject: [PATCH] webkit2gtk: add options for clang+lto, add big endian 32bit jsc fix also explicitly add libgcrypt-devel which is needed but since some recent change was not being pulled in (probably some dep changed) --- srcpkgs/webkit2gtk/patches/be32-jsc-fix.patch | 13 +++++++++ srcpkgs/webkit2gtk/template | 28 +++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/webkit2gtk/patches/be32-jsc-fix.patch diff --git a/srcpkgs/webkit2gtk/patches/be32-jsc-fix.patch b/srcpkgs/webkit2gtk/patches/be32-jsc-fix.patch new file mode 100644 index 00000000000..e6f5f5ecd01 --- /dev/null +++ b/srcpkgs/webkit2gtk/patches/be32-jsc-fix.patch @@ -0,0 +1,13 @@ +This should fix a recent regression in JSC CLoop on BE/32bit. + +--- Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm ++++ Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm +@@ -425,7 +425,7 @@ end) + op(llint_get_host_call_return_value, macro () + functionPrologue() + pushCalleeSaves() +- loadp Callee[cfr], t0 ++ loadp Callee + PayloadOffset[cfr], t0 + convertCalleeToVM(t0) + loadi VM::encodedHostCallReturnValue + TagOffset[t0], t1 + loadi VM::encodedHostCallReturnValue + PayloadOffset[t0], t0 diff --git a/srcpkgs/webkit2gtk/template b/srcpkgs/webkit2gtk/template index a8d2b2426a4..ae7e80744d0 100644 --- a/srcpkgs/webkit2gtk/template +++ b/srcpkgs/webkit2gtk/template @@ -2,7 +2,7 @@ # ping q66 before touching this pkgname=webkit2gtk version=2.32.1 -revision=1 +revision=2 wrksrc="webkitgtk-${version}" build_style=cmake build_helper="gir" @@ -29,7 +29,7 @@ makedepends="at-spi2-core-devel libjpeg-turbo-devel libpng-devel libsecret-devel ruby-devel geoclue2-devel libnotify-devel hyphen-devel woff2-devel freetype-devel libopenjpeg2-devel libatomic-devel qt5-devel libmanette-devel libwpe-devel wpebackend-fdo-devel - $(vopt_if x11 libXt-devel) + libgcrypt-devel $(vopt_if x11 libXt-devel) $(vopt_if wayland 'MesaLib-devel libxkbcommon-devel wayland-devel wayland-protocols')" short_desc="GTK+3 port of the WebKit2 browser engine" maintainer="q66 " @@ -39,13 +39,16 @@ distfiles="${homepage}/releases/webkitgtk-${version}.tar.xz" checksum=136117317f70f66486f71b8edf5e46f8776403c5d8a296e914b11a36ef836917 make_check=no -build_options="gir wayland x11 bubblewrap jit sampling_profiler minibrowser" +build_options="gir wayland x11 bubblewrap jit sampling_profiler minibrowser + clang lto" build_options_default="gir wayland x11 bubblewrap minibrowser" desc_option_bubblewrap="Enable bubblewrap sandbox" desc_option_jit="JavaScript JIT (Only some architectures)" desc_option_sampling_profiler="Sampling profiler support (JIT + glibc only)" desc_option_minibrowser="Build the minibrowser" +desc_option_clang="Use Clang to build" +desc_option_lto="Enable ThinLTO (needs Clang)" export CFLAGS="-DNDEBUG" export CXXFLAGS="$CFLAGS" @@ -72,6 +75,20 @@ if [ "$build_option_bubblewrap" ]; then depends+=" bubblewrap xdg-dbus-proxy" fi +if [ "$build_option_lto" -a -z "$build_option_clang" ]; then + broken="LTO needs Clang" +fi + +if [ "$build_option_clang" ]; then + hostmakedepends+=" clang lld" + configure_args+=" -DUSE_LD_LLD=ON" + nocross=yes +fi + +if [ "$build_option_lto" ]; then + configure_args+=" -DLTO_MODE=thin" +fi + # only a few platform support JIT case "$XBPS_TARGET_MACHINE" in aarch64*|x86_64*) @@ -102,6 +119,11 @@ if [ "$build_option_sampling_profiler" -a -z "$build_option_jit" ]; then fi pre_configure() { + if [ "$build_option_clang" ]; then + export CC=clang + export CXX=clang++ + fi + # the debug builds are huge and cause problems when debugging export CFLAGS="${CFLAGS/-g/-g1}" export CXXFLAGS="${CXXFLAGS/-g/-g1}"