I would like to compile and run 32-bit dynamically linked ARM binaries on aarch64. (I'm using termux on Android 9).
I found #1258, which nearly gets me all the way there. The only thing that is missing is that its recipe requires the required libraries to be copied over $PREFIX/lib, e.g.:
$ cp $PREFIX/arm-linux-androideabi/lib/* $PREFIX/lib/
$ clang -m32 test.c -L/system/lib -Wl,-rpath-link=/system/lib
I would prefer not to have to copy the libraries around, as presumably that in any case prevents me from running 64-bit binaries while I have the 32-bit libraries in place?
Whatever I do without this step, if I build a 32-bit binary, I get a segfault when I try to run it.
I was able to workaround this by building with -static, but it would be nice not to have to do this.
So far I can:
$ unset LD_PRELOAD
$ clang -m32 -static foo.c
$ ./a.out
hello, world!
But if I remove -static I just get a segfault. If I add the -L and -Wl flags from the recipe above, it doesn't work either. I have ndk-multilib installed. Sorry if I'm missing something obvious!
I would like to compile and run 32-bit dynamically linked ARM binaries on aarch64. (I'm using termux on Android 9).
I found #1258, which nearly gets me all the way there. The only thing that is missing is that its recipe requires the required libraries to be copied over
$PREFIX/lib, e.g.:I would prefer not to have to copy the libraries around, as presumably that in any case prevents me from running 64-bit binaries while I have the 32-bit libraries in place?
Whatever I do without this step, if I build a 32-bit binary, I get a segfault when I try to run it.
I was able to workaround this by building with
-static, but it would be nice not to have to do this.So far I can:
But if I remove
-staticI just get a segfault. If I add the-Land-Wlflags from the recipe above, it doesn't work either. I havendk-multilibinstalled. Sorry if I'm missing something obvious!