Compiled on PI4B4G with 5.10.77-piCore-v8 Reference: https://github.com/archlinux/svntogit-community/blob/packages/miniupnpc/trunk/PKGBUILD Compile Flags: CC='gcc' CXX='g++' CPPFLAGS='-DNDEBUG' CFLAGS='-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -flto' CXXFLAGS='-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -flto' LDFLAGS='-Wl,-O1 -Wl,-v -fuse-ld=gold -L/usr/local/lib' export CC CXX CPPFLAGS CFLAGS CXXFLAGS LDFLAGS AR='gcc-ar' NM='gcc-nm' RANLIB='gcc-ranlib' LD='ld.gold' export AR NM RANLIB STRIP LD Dependencies: compiletc cmake python3.8-setuptools python3.8-dev Commands: # fix lto P=/usr/local/libexec/gcc/aarch64-unknown-linux-gnu/10.2.0/liblto_plugin.so.0.0.0 sudo mkdir -p /usr/local/lib/bfd-plugins sudo ln -sfv $P /usr/local/lib/bfd-plugins/liblto_plugin.so wget http://miniupnp.free.fr/files/download.php?file=miniupnpc-2.2.3.tar.gz -O miniupnpc-2.2.3.tar.gz tar -xf miniupnpc-2.2.3.tar.gz cd miniupnpc-2.2.3 # main program # don't use soft links # ln -s include/* . cp include/* . mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE='MinSizeRel' \ -DCMAKE_INSTALL_PREFIX='/usr/local' \ -DCMAKE_INSTALL_LIBDIR='lib' time make -j4 real 0m 8.69s user 0m 23.73s sys 0m 6.48s DESTDIR=/tmp/packing-miniupnpc make install # python modules cd .. && pwd # /tmp/miniupnpc-2.2.3 python3.8 setup.py build -v -j4 python3.8 setup.py install -v --root=/tmp/py --prefix=/usr/local Packing: cd /tmp/py strip --strip-unneeded ./usr/local/lib/python3.8/site-packages/miniupnpc.cpython-38-aarch64-linux-gnu.so cd /tmp/packing-miniupnpc llvm-strip --strip-debug ./usr/local/lib/libminiupnpc.a strip --strip-unneeded ./usr/local/lib/libminiupnpc.so.2.2.3 mkdir -p /tmp/lib/usr/local/lib/ mv ./usr/local/lib/*so* /tmp/lib/usr/local/lib/ # make sure the headers in dev are actual files (not soft links)