aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2020-12-19 18:41:30 +0100
committerJakub Jirutka <jakub@jirutka.cz>2020-12-19 19:01:00 +0100
commit53dd8b58d838892bd9fe4849d7e239e0406e14eb (patch)
treec63e3e2d6f75bc6102283c88ef2bd914ac0ddda6
parentf2dbc05b56390b2009a4e0c8699e95d5b085c091 (diff)
main/nodejs: build with -O2 instead of -Os
See explanation comment in the APKBUILD.
-rw-r--r--main/nodejs/APKBUILD13
1 files changed, 10 insertions, 3 deletions
diff --git a/main/nodejs/APKBUILD b/main/nodejs/APKBUILD
index bc815d06d21..32073365af8 100644
--- a/main/nodejs/APKBUILD
+++ b/main/nodejs/APKBUILD
@@ -58,7 +58,7 @@ pkgname=nodejs
# Note: Update only to even-numbered versions (e.g. 6.y.z, 8.y.z)!
# Odd-numbered versions are supported only for 9 months by upstream.
pkgver=14.15.3
-pkgrel=0
+pkgrel=1
pkgdesc="JavaScript runtime built on V8 engine - LTS version"
url="https://nodejs.org/"
arch="all !mips64 !mips64el"
@@ -91,8 +91,15 @@ prepare() {
build() {
# Add defines recommended in libuv readme.
- export CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
- export CXXFLAGS="$CXXFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+ local common_flags="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+
+ # Compiling with O2 instead of Os increases binary size by ~10%
+ # (53.1 MiB -> 58.6 MiB), but also increases performance by ~20%
+ # according to v8/web-tooling-benchmark. Node.js is quite huge anyway;
+ # there are better options for size constrained environments.
+ export CFLAGS="${CFLAGS/-Os/-O2} $common_flags"
+ export CXXFLAGS="${CXXFLAGS/-Os/-O2} $common_flags"
+ export CPPFLAGS="${CPPFLAGS/-Os/-O2} $common_flags"
case "$CARCH" in
mips*) _carchflags="--with-mips-arch-variant=r1 --with-mips-float-abi=soft";;