aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorScott B2021-11-09 03:28:14 -0800
committerScott B2021-11-11 00:03:06 -0800
commitb1b2a37de8ab86c34d8125f83747423e8153137a (patch)
tree0612a4f8c931ab7b07bfbf12915c38c821eaff4e /PKGBUILD
parent4c206e6a2aedefd00ed6e653e37cb2d2cd54a1c0 (diff)
downloadaur-b1b2a37de8ab86c34d8125f83747423e8153137a.tar.gz
pkgbuild: optionally enable -O3 during build
This really isn't worth much performance wise, but people asked for it.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD12
1 files changed, 12 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 2ddaecf1899e..15c136773793 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -28,6 +28,12 @@ if [ -z ${no_makeflags_check+x} ]; then
makeflags_check=y
fi
+## '_O3' - Enable -O3 optimization - this isn't generally worth much, especially in the face of
+## -march=native (or -march=x86-64-v3) and clang ThinLTO; set _O3 to anything to enable
+if [ -n "${_O3+x}" ]; then
+ _O3=y
+fi
+
##
## Xanmod options:
##
@@ -252,6 +258,12 @@ prepare() {
--enable LTO_CLANG_THIN
fi
+ if [ "$_O3" = "y" ]; then
+ msg2 "Enabling -O3 optimizations ..."
+ scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE \
+ --enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
+ fi
+
# CONFIG_STACK_VALIDATION gives better stack traces. Also is enabled in all official kernel packages by Archlinux team
scripts/config --enable CONFIG_STACK_VALIDATION