I just compiled a cross gdb by compiling the source on MSYS2/MINGW64. But when I run gdb it throws an error and complains that it can not start because it needs libexpat-1.dll
.
This is what I did to compile the gdb:
- Got the source code
git clone git://sourceware.org/git/binutils-gdb.git
- In a different directory:
export TARGET=x86_64-amd-linux-gnu
export PREFIX=/tmp/myToolChain
binutils/gdb/path/configure --with-python=/mingw64/bin/python --target=${TARGET} --prefix=${PREFIX} --disable-shared --enable-static
and
make && make install
It compiles without any problems. But I don't know why it needs the libraries while I've compiled it statically and disabled the shared libraries.
I also tried to use libexpat
during compilation but then it complains about another library libiconv-2.dll
.
What have I messed up?
Edit: I didn't have C:\msys64\mingw64\bin
in my path. After adding it I'm not getting the previous error any more.
But I still have this question that why although I'm linking the libraries statically the final binary still needs some libraries?