From 3756ca70c5193ae020482aec578f141fde5e2ec7 Mon Sep 17 00:00:00 2001 From: gnattu Date: Sat, 21 Dec 2024 00:39:41 +0800 Subject: [PATCH] builder: use fPIC for Linux libopus --- builder/scripts.d/50-libopus.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/builder/scripts.d/50-libopus.sh b/builder/scripts.d/50-libopus.sh index 054570b4f9..45e559d43c 100755 --- a/builder/scripts.d/50-libopus.sh +++ b/builder/scripts.d/50-libopus.sh @@ -40,7 +40,13 @@ ffbuild_dockerbuild() { # reset CLFAGS because libopus may give up optimization if current CFLAGS contains value CFLAGS_BACKUP="$CFLAGS" - export CFLAGS="-O3" # For some reason libopus will not add optimization flag, we have to set it ourselves + + # For some reason libopus will not add optimization flag, we have to set it ourselves + if [[ $TARGET == mac* ]]; then + export CFLAGS="-O3" + else + export CFLAGS="-O3 -fPIC -DPIC" + fi ./configure "${myconf[@]}" make -j$(nproc)