build.sh: force use of -fPIC on static libraries to fix build error
authorFelix Fietkau <nbd@nbd.name>
Sun, 28 Aug 2022 17:56:31 +0000 (19:56 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sun, 28 Aug 2022 17:56:31 +0000 (19:56 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
build.sh

index 9085334d5140c0705859abb108eb9e98ec50daf0..7e35993e5145cb443f6bc1b6d4fbc6a336c464d1 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -25,10 +25,10 @@ rm -rf install
 mkdir -p install
 ln -s lib install/lib64
 clone libubox git://git.openwrt.org/project/libubox.git
-build libubox -DBUILD_LUA=off
+build libubox -DBUILD_LUA=off -DCMAKE_POSITION_INDEPENDENT_CODE=on
 if [ "$UNAME" = "Linux" ]; then
        clone libnl-tiny git://git.openwrt.org/project/libnl-tiny.git
-       build libnl-tiny -DBUILD_LUA=off
+       build libnl-tiny -DBUILD_LUA=off -DCMAKE_POSITION_INDEPENDENT_CODE=on
        clone libbpf https://github.com/libbpf/libbpf
        make -j9 -C libbpf/src PREFIX=$PWD/install all install
 fi