JonathonReinhart / staticx

Create static executable from dynamic executable
https://staticx.readthedocs.io/
Other
321 stars 34 forks source link

[Enhancement] Ability to run staticx on binaries from unsupported platforms #280

Open cryptrr opened 2 months ago

cryptrr commented 2 months ago

Hi there, Can you help me out of this predicament here.

I want to use staticx to link termux binaries which are made with Android NDK. The issue is, staticx is not possible to get installed inside termux because of LDC and lld issues on the Android platform.

gcc -o scons_build/debug/bootloader/bootloader -Wl,--fatal-warnings -static scons_build/debug/bootloader/error.o scons_build/debug/bootloader/elfutil.o scons_build/debug/bootloader/extract.o scons_build/debug/bootloader/main.o scons_build/debug/bootloader/mmap.o scons_build/debug/bootloader/util.o -Lscons_build/debug/lib -ltar -lxz
ld.lld: error: unable to find library -lc

Is there any way we can make it possible to run staticx from a supported platform and collect the necessary binaries and dependencies remotely from an unsupported platform?

Or is there an easier approach for this?

Thank you.

JonathonReinhart commented 2 months ago

To be honest, running staticx to build the binary is the easy half of the battle. Executing the resulting binary and ensuring it only uses the bundled libraries is the difficult part. I barely have the bandwidth to keep staticx working on glibc - adding support for Android NDK is not going to happen without a community contribution.