I am using the same cross-toolchain on two different build hosts to cross-compile and link to a C library, respectively.
Host A is a Ubuntu 16.04 container with arm-xilinx-linux-gnueabi tools used to cross-compile and generate a static library, mylib.a.
Host B is a CentOS container with arm-xilinx-linux-gnueabi tools used to cross-compile other stuff and then link to the static lib (mylib.a copied in from Host A) generated on Host A.
When linking on Host B, this error message is raised:
error adding symbols: Archive has no index; run ranlib to add one
collect2: error: ld returned 1 exit status
I’ve confirmed that mylib.a does contain the index header (see What does the Linux ‘ar’ generated index file look like in a .a file?)
I tried extracting the .o’s from the .a, copying them into Host B, and arm-xilinx-linux-gnueabi-ar on Host B. But no difference.
Is the issue incompatabilty between the build hosts?
Or could it maybe be that I am not specifying a target to arm-xilinx-linux-gnueabi-ar (among supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex)?
Thanks