From ee343b9f01f21f354f1b042711e226da595530b2 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Thu, 21 Sep 2023 00:39:07 +0800 Subject: [PATCH] Disable ThinLTO on static builds --- src/build.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/build.sh b/src/build.sh index 3c8fbfa1e4..eb1ec45733 100755 --- a/src/build.sh +++ b/src/build.sh @@ -94,6 +94,15 @@ if [ "$target_cpu" = "mipsel" -o "$target_cpu" = "mips64el" ]; then chrome_pgo_phase=0' fi +# OpenWrt static builds are bad with Clang 18+ and ThinLTO. +# Segfaults in fstack-protector on ARM. +case "$EXTRA_FLAGS" in +*build_static=true*) + flags="$flags"' + use_thin_lto=false' + ;; +esac + rm -rf "./$out" mkdir -p out