summaryrefslogtreecommitdiff
path: root/libre
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2022-04-30 18:55:13 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2022-05-01 08:41:50 -0400
commit9a3cf89dc421b65e3325fd3cf073605770f9cf7f (patch)
treeed25acbcc1bf4a18a69f305156db2ef98a8fc7b1 /libre
parentb07b6f3066a875a866cce53955ec34362267f7cd (diff)
downloadabslibre-9a3cf89dc421b65e3325fd3cf073605770f9cf7f.tar.gz
abslibre-9a3cf89dc421b65e3325fd3cf073605770f9cf7f.tar.bz2
abslibre-9a3cf89dc421b65e3325fd3cf073605770f9cf7f.zip
[iceweasel]: tweak for i686
Diffstat (limited to 'libre')
-rw-r--r--libre/iceweasel/PKGBUILD47
-rw-r--r--libre/iceweasel/firefox-93.0_x86_math_private_20211110.patch112
-rw-r--r--libre/iceweasel/firefox-99.0.1-fdlibm-double.patch15
3 files changed, 43 insertions, 131 deletions
diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD
index b508e1858..c4801250a 100644
--- a/libre/iceweasel/PKGBUILD
+++ b/libre/iceweasel/PKGBUILD
@@ -74,10 +74,7 @@ makedepends=(unzip zip diffutils yasm mesa imake inetutils xorg-server-xvfb
python-setuptools python-psutil python-zstandard lld dump_syms
wasi-compiler-rt wasi-libc wasi-libc++ wasi-libc++abi)
makedepends+=(quilt libxslt imagemagick git jq python-jsonschema)
-[[ "${CARCH}" == i686 ]] && makedepends=( ${makedepends[*]/jack/jack2} )
-[[ "${CARCH}" == i686 ]] && makedepends=( ${makedepends[*]/llvm/llvm12} )
-makedepends_i686=(gcc10) # cannot build i686 today - rust is unusable
-makedepends_i686+=(wasi-compiler-rt=12.0.1 wasi-libc++=12.0.1 wasi-libc++abi=12.0.1) # wasi-libc=???)
+makedepends_i686=(gcc10)
optdepends=('networkmanager: Location detection via available WiFi networks'
'libnotify: Notification integration'
'pulseaudio: Audio support'
@@ -99,7 +96,7 @@ source+=(https://repo.parabola.nu/other/iceweasel/${pkgname}_${_brandingver}.bra
source_armv7h=(build-arm-libopus.patch)
source_i686=('avoid-libxul-OOM-python-check.patch'
'rust-static-disable-network-test-on-static-libraries.patch'
- 'firefox-93.0_x86_math_private_20211110.patch')
+ 'firefox-99.0.1-fdlibm-double.patch')
sha256sums=('76d22279ce99588a728bb2d034064be0d5918b5900631f2148d4565b8a72e00b'
'SKIP'
'9cdc2602661717712092d28bb494e5b48e518cb930898aca85eaf21f91f7ef58')
@@ -114,12 +111,11 @@ sha256sums+=('d1b9d98cea5356df97fc5c221830de1ced8f826cb39fac9427c407e3eae54c02'
sha256sums_armv7h=('2d4d91f7e35d0860225084e37ec320ca6cae669f6c9c8fe7735cdbd542e3a7c9')
sha256sums_i686=('2f0c81a38c4578f68f5456b618fe84a78974072821488173eb55e0e72287e353'
'10c5276eab2e87f400a6ec15d7ffbef3b0407ee888dea36f1128927ca55b9041'
- '84836b905d23a6cfdd955b9312bbb794e5329af36963c81572195039c68291fc')
+ '62695e56daf8c0b8bb921980d475b3fd169b9134188ad9ffaeb9cd660589c23d')
validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Releases <release@mozilla.com>
validpgpkeys+=('BFA8008A8265677063B11BF47171986E4B745536') # Andreas Grapentin
validpgpkeys+=('3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger
-
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) # anti-feature
# Note: These are for Arch Linux use ONLY. For your own distribution, please # anti-feature
# get your own set of keys. Feel free to contact foutrelis@archlinux.org for # anti-feature
@@ -133,7 +129,7 @@ validpgpkeys+=('3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger
# _mozilla_api_key=e05d56db0a694edc8b5aaebda3f2db6a # anti-feature
-# disable PGO (necessary for 32-bit)
+# disable PGO for 32-bit arches
_should_skip_pgo_armv7h=1 # disable for armv7h
_should_skip_pgo_i686=1 # disable for i686
_should_skip_pgo_x86_64=0 # disable for x86_64
@@ -225,6 +221,7 @@ ac_add_options --with-app-name=${pkgname}
ac_add_options --with-app-basename=${pkgname}
ac_add_options --with-unsigned-addon-scopes=app,system
ac_add_options --allow-addon-sideload
+# export MOZILLA_OFFICIAL=1 # branding over-ride
export MOZ_APP_REMOTINGNAME=${pkgname//-/}
export MOZ_TELEMETRY_REPORTING=
export MOZ_REQUIRE_SIGNING=
@@ -278,9 +275,12 @@ END
patch -p1 -i ../build-arm-libopus.patch
;;
i686)
- # disable LTO and use gcc toolchain (clang has issues on IA32)
- # disable SIMD (SSE2 for i686)
export MOZ_SOURCE_CHANGESET="DEVEDITION_${pkgver//./_}_RELEASE"
+
+ # disable LTO as it has little benefit and uses too many resources
+ # don't compile with clang, use gcc toolchain (clang has issues on IA32)
+ # disable SIMD (SSE2 for i686)
+ # set correct compiler and toochain tools
cat >>../mozconfig <<END
ac_add_options --disable-linker=lld
ac_add_options --enable-linker=bfd
@@ -291,6 +291,7 @@ export CXX=g++-10
export AR=gcc-ar-10
export NM=gcc-nm-10
export RANLIB=gcc-ranlib-10
+export STRIP=strip
END
# readelf: Error: Unable to seek to 0x801db328 for section headers
@@ -307,8 +308,8 @@ END
# /build/iceweasel/src/firefox-96.0.1/modules/fdlibm/src/math_private.h:34:21:
# error: conflicting declaration ‘typedef __double_t double_t’
# /usr/include/math.h:156:21: note: previous declaration as ‘typedef long double double_t’
- echo "applying firefox-93.0_x86_math_private_20211110.patch"
- patch -p1 -i ../firefox-93.0_x86_math_private_20211110.patch
+ echo "applying firefox-99.0.1-fdlibm-double.patch"
+ patch -p1 -i "$srcdir/firefox-99.0.1-fdlibm-double.patch"
;;
x86_64)
;;
@@ -486,11 +487,7 @@ build() {
export RUSTFLAGS="-Cdebuginfo=0"
;;
i686)
- # -fno-plt with cross-LTO -> LLVM ERROR: Function Import: link error
- CFLAGS="${CFLAGS/-fno-plt/}"
- CXXFLAGS="${CXXFLAGS/-fno-plt/}"
-
- # disable LTO (clang has issues on IA32)
+ # try hard to tell ld and rust not to use too much memory (no lto, no debug info, etc.)
export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off"
export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
@@ -558,6 +555,7 @@ END
echo "Removing instrumented browser..."
./mach clobber
+ echo "Building optimized browser..."
cat >.mozconfig ../mozconfig - <<END
ac_add_options --enable-lto=cross
ac_add_options --enable-profile-use=cross
@@ -576,7 +574,6 @@ END
## main build ##
- echo "Building optimized browser..."
./mach build
# echo "Building symbol archive..." # anti-feature
@@ -655,8 +652,13 @@ END
;;
i686)
# libxul.so cannot find it's libraries
- install -dm 755 "${pkgdir}"/etc/ld.so.conf.d
+ install -dm 755 "${pkgdir}/etc/ld.so.conf.d"
echo "/usr/lib/${pkgname}" > "${pkgdir}"/etc/ld.so.conf.d/${pkgname}.conf
+
+ # disable stripping in mozconfig.<arch> (insists to use llvm-strip which runs
+ # out of memory on libxul.so. Now 2.5 GB can be strupped to 166 MB, so we do
+ # that with the normal 'strip' from binutils after 'mach install'
+ strip "$pkgdir/usr/lib/$pkgname/libxul.so"
;;
x86_64)
;;
@@ -673,4 +675,11 @@ END
if [[ -e $nssckbi ]]; then
ln -srfv "$pkgdir/usr/lib/libnssckbi.so" "$nssckbi"
fi
+
+ # export SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE="$startdir/.crash-stats-api.token" # anti-feature
+ # if [[ -f $SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE ]]; then # anti-feature
+ # make -C obj uploadsymbols # anti-feature
+ # else # anti-feature
+ # cp -fvt "$startdir" obj/dist/*crashreporter-symbols-full.tar.zst # anti-feature
+ # fi
}
diff --git a/libre/iceweasel/firefox-93.0_x86_math_private_20211110.patch b/libre/iceweasel/firefox-93.0_x86_math_private_20211110.patch
deleted file mode 100644
index bdc889061..000000000
--- a/libre/iceweasel/firefox-93.0_x86_math_private_20211110.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-diff -w -ruN firefox-93.0.org/modules/fdlibm/src/math_private.h firefox-93.0/modules/fdlibm/src/math_private.h
---- firefox-93.0.org/modules/fdlibm/src/math_private.h 2021-09-27 16:47:42.000000000 -0600
-+++ firefox-93.0/modules/fdlibm/src/math_private.h 2021-11-10 17:39:03.495621830 -0600
-@@ -30,9 +30,13 @@
- * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
- */
-
-+#ifdef __LP64__
- typedef double __double_t;
-+#else
-+typedef long double __double_t;
-+#endif
- typedef __double_t double_t;
--
-+typedef float __float_t;
- /*
- * The original fdlibm code used statements like:
- * n0 = ((*(int*)&one)>>29)^1; * index of high word *
-@@ -630,6 +634,53 @@
- return ((double)(x + 0x1.8p52) - 0x1.8p52);
- }
-
-+static inline float
-+rnintf(__float_t x)
-+{
-+ /*
-+ * As for rnint(), except we could just call that to handle the
-+ * extra precision case, usually without losing efficiency.
-+ */
-+ return ((float)(x + 0x1.8p23F) - 0x1.8p23F);
-+}
-+
-+#ifdef LDBL_MANT_DIG
-+/*
-+ * The complications for extra precision are smaller for rnintl() since it
-+ * can safely assume that the rounding precision has been increased from
-+ * its default to FP_PE on x86. We don't exploit that here to get small
-+ * optimizations from limiting the rangle to double. We just need it for
-+ * the magic number to work with long doubles. ld128 callers should use
-+ * rnint() instead of this if possible. ld80 callers should prefer
-+ * rnintl() since for amd64 this avoids swapping the register set, while
-+ * for i386 it makes no difference (assuming FP_PE), and for other arches
-+ * it makes little difference.
-+ */
-+
-+static inline long double
-+rnintl(long double x)
-+{
-+ /* The WRAPPED__CONCAT() macro below is required for non-FreeBSD targets
-+ which don't have a multi-level CONCAT macro implementation. On those
-+ targets the hexadecimal floating-point values being created don't expand
-+ properly resulting in code that cannot be compiled.
-+
-+ The extra level provided by this macro should not affect FreeBSD, should
-+ this code be used there.
-+
-+ See the following for more details:
-+
-+ https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC32
-+ https://sources.debian.org/src/glibc/2.32-3/misc/sys/cdefs.h/
-+ https://github.com/freebsd/freebsd-src/blob/main/sys/sys/cdefs.h
-+ */
-+ #define WRAPPED__CONCAT(x,y) __CONCAT(x,y)
-+
-+ return (x + WRAPPED__CONCAT(0x1.8p, LDBL_MANT_DIG) / 2 -
-+ WRAPPED__CONCAT(0x1.8p, LDBL_MANT_DIG) / 2);
-+}
-+#endif /* LDBL_MANT_DIG */
-+
- /*
- * irint() and i64rint() give the same result as casting to their integer
- * return type provided their arg is a floating point integer. They can
-@@ -646,6 +697,39 @@
- #define irint(x) ((int)(x))
- #endif
-
-+#define i64rint(x) ((int64_t)(x)) /* only needed for ld128 so not opt. */
-+
-+#if defined(__i386__) && defined(__GNUCLIKE_ASM)
-+static __inline int
-+irintf(float x)
-+{
-+ int n;
-+
-+ __asm("fistl %0" : "=m" (n) : "t" (x));
-+ return (n);
-+}
-+
-+static __inline int
-+irintd(double x)
-+{
-+ int n;
-+
-+ __asm("fistl %0" : "=m" (n) : "t" (x));
-+ return (n);
-+}
-+#endif
-+
-+#if (defined(__amd64__) || defined(__i386__)) && defined(__GNUCLIKE_ASM)
-+static __inline int
-+irintl(long double x)
-+{
-+ int n;
-+
-+ __asm("fistl %0" : "=m" (n) : "t" (x));
-+ return (n);
-+}
-+#endif
-+
- #ifdef DEBUG
- #if defined(__amd64__) || defined(__i386__)
- #define breakpoint() asm("int $3")
diff --git a/libre/iceweasel/firefox-99.0.1-fdlibm-double.patch b/libre/iceweasel/firefox-99.0.1-fdlibm-double.patch
new file mode 100644
index 000000000..ffd4b1d7e
--- /dev/null
+++ b/libre/iceweasel/firefox-99.0.1-fdlibm-double.patch
@@ -0,0 +1,15 @@
+diff -rauN firefox-99.0.1/modules/fdlibm/src/math_private.h firefox-99.0.1-fdlibm-double-patch/modules/fdlibm/src/math_private.h
+--- firefox-99.0.1/modules/fdlibm/src/math_private.h 2022-04-12 00:00:09.000000000 +0200
++++ firefox-99.0.1-fdlibm-double-patch/modules/fdlibm/src/math_private.h 2022-04-25 16:47:00.697715429 +0200
+@@ -30,7 +30,11 @@
+ * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+ */
+
++#if defined __FLT_EVAL_METHOD__ && (__FLT_EVAL_METHOD__ == 2)
++typedef long double __double_t;
++#else
+ typedef double __double_t;
++#endif
+ typedef __double_t double_t;
+
+ /*