I'm trying to cross compile a version of GDB server from source for the MIPS32
architecture. I'm using an x86_64 machine.
I'm using the Buildroot uClibc
compiler for MIPS
(mips-buildroot-linux-uclibc-gcc
).
From the GDB server directory I run the ./configure
command:
./configure --host=mips-buildroot-linux-uclibc AR=${CROSS}ar LD=${CROSS}ld CC=${CROSS}gcc CXX=${CROSS}g++ RANLIB=${CROSS}ranlib LIBS=-L/root/Desktop/buildroot/buildroot-2018.02.2/output/host/lib
With $CROSS
having the value mips-buildroot-linux-uclibc-
./configure
runs but I noticed in the output it mentions checking whether we are cross compiling... no
. It doesn't seem like ./configure
is picking up that I'm trying to cross compile.
I then run make LDFLAGS=-static
which produces the error:
ld: cannot find -lthread_db
collect2: error: ld returned 1 exit status
Makefile:379: recipe for target 'gdbserver' failed
make: *** [gdbserver] Error 1
I read that you can remove the lthread_db
dependencies in the GDB server makefile
however I need to debug threaded applications.
How can I cross compile GDB server for the MIPS32
architecture using the Buildroot cross compilation tool set?
--host
option of theconfigure
script is not your host PC?checking whether we are cross compiling...
problem.