Linker error when cross compiling for aarch-64 (linker command failed with exit code 1)

143 Views Asked by At

I'm trying to compile and build a few libraries for different host platforms with both gcc and clang so I can use the executable files in my research. So far I've been successful with gcc for all hosts, and with clang for aarch-64, i686, and x86-64(my own system). However, when trying to set 'arm' as host, I get the following error after running make:

/usr/bin/ld: ../gnu/libgnu.a: error adding symbols: archive has no index; run ranlib to add one
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Makefile:1327: cflow] Error 1

**This error is not specific to cflow and happens with all libraries

This is the command I'm using for compiling

./configure CC='clang' --host=arm-linux-gnueabi CFLAGS='-g -O0 -gdwarf-4'

**Am using -gdwarf-4 because I use the binaries with ghidra, and the newer gdwarf-5 causes errors

** This also only happens exclusive with

CC='clang' --host=arm-linux-gnueabi

I've tried using ranlib but it has not solved the problem

0

There are 0 best solutions below