I’m currently trying to create a Linux distro that will run on a 32-Bit ARM Raspberry Pi that is set in Big Endian mode (the ARM Cortex-A7 CPU inside the Raspberry Pi can run in both Little Endian and Big Endian mode).
I am the author of the network analysis program Dynamo, and so in order to get a cross-compilation build system up and running, I’m trying to build my Dynamo program as a statically linked binary file for 32-Bit ARM Big Endian. (I should be able to use qemu to run it on my x64 desktop PC before I try run it natively on the raspberry pi).
I have set up a “chroot jail” in which I have a 32-Bit “armeb” compiler (the ‘eb’ on the end means Big Endian), and one by one I am building all the dependencies of my program. I’m currently stuck on building Glib.
I wasn’t able to get my “armeb” cross-compiler to build glibc (yes I mean glibc), and so I had to link it with uClibc instead. I built uClibc as a static library only (i.e. I only have “.a” files, I don’t have “.so” files).
Now I am trying to use meson and ninja to build Glib, but here’s what I’m getting when it tries to build libresourceplugin.so:
in function `__uClibc_fini':
__uClibc_main.c:(.text+0x1d4): undefined reference to `__fini_array_start'
undefined reference to `__fini_array_end'
undefined reference to `__fini_array_start'
I’ve seen these errors before – I’ve gotten them when a program tries to link dynamically with uClibc (which isn’t possible because I only built uClibc as a static library). The solution with other packages was to simply do “./configure --disable-shared” to make sure that it links statically with uClibc (I originally though that this would just make it produce a static library that could possibly link dynamically with its dependencies, but it actually links entirely statically).
So what I need to do now is tell meson and ninja to build Glib to only link statically with uClibc, in order to produce Glib as static library (i.e. I need “.a” files). I’ve tried a few things such as “meson -Ddefault_library=static” but still I’m getting the same errors
Any pointers please?