Building Python module miniupnpc fails with "file in wrong format" error
-
I need to have my python have access to UPnP, and have been working with
miniupnpc
to make that happen. Installing viapip
has a vague error message; so I expanded the storage of my Onion Omega2, installedmake
andgcc
, and attempted to build the package myself. When runningpython setup.py build_ext
, I get the following output (slightly formatted for easy reading):[NOTE: I've tried this before, so some of the build process is already done. I don't know how to force a full rebuild.]
running build_ext make: 'libminiupnpc.a' is up to date. building 'miniupnpc' extension creating build/temp.linux-mips-2.7 mipsel-openwrt-linux-musl-gcc -fno-strict-aliasing -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mno-mips16 -mno-interlink-mips16 -iremap /root/source/build_dir/target-mipsel_24kc_musl-1.1.16/Python-2.7.14:Python-2.7.14 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DNDEBUG -fno-inline -DNDEBUG -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mno-mips16 -mno-interlink-mips16 -iremap /root/source/build_dir/target-mipsel_24kc_musl-1.1.16/Python-2.7.14:Python-2.7.14 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fPIC -I/usr/include/python2.7 -c miniupnpcmodule.c -o build/temp.linux-mips-2.7/miniupnpcmodule.o creating build/lib.linux-mips-2.7 mipsel-openwrt-linux-musl-gcc -shared -L/root/source/staging_dir/target-mipsel_24kc_musl-1.1.16/usr/lib -L/root/source/staging_dir/target-mipsel_24kc_musl-1.1.16/lib -L/root/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/usr/lib -L/root/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/lib -znow -zrelro -L/root/source/build_dir/target-mipsel_24kc_musl-1.1.16/Python-2.7.14 build/temp.linux-mips-2.7/miniupnpcmodule.o libminiupnpc.a -L/usr/lib -lpython2.7 -o build/lib.linux-mips-2.7/miniupnpc.so /usr/bin/ld: libminiupnpc.a(miniupnpc.o): Relocations in generic ELF (EM: 62) /usr/bin/ld: libminiupnpc.a(miniupnpc.o): Relocations in generic ELF (EM: 62) /usr/bin/ld: libminiupnpc.a(miniupnpc.o): Relocations in generic ELF (EM: 62) libminiupnpc.a: error adding symbols: File in wrong format collect2: error: ld returned 1 exit status error: command 'mipsel-openwrt-linux-musl-gcc' failed with exit status 1
I'm trying to find out how to solve this problem in
ld
, but nothing is coming up in my searches. Has this been a problem for anyone else compiling Python packages locally on the Onion? What is the right format for the system? Is there a way to force the build to use the format OnionOS wants?