link: gdb-static github releases
This repository contains a dockerfile and build scripts to compile gdb and gdbserver statically for multiple architectures. Currently, the supported architectures are:
- x86_64
- arm
- aarch64
- powerpc (32bit) You can easily expand it to support more architectures by adding the appropriate cross compilers to the dockerfile, and other build scripts.
NOTE: You don't need to interact with the dockerfile directly, as the Makefile will take care of everything for you.
To build for a specific architecture, you can use the following command:
make build-<ARCH>
For example, to build for arm:
make build-arm
The resulting binaries will be placed under the build/artifacts/
directory.
Each architecture will have its own directory under build/artifacts/
. For example, the arm architecture will have the following directory structure:
build/
artifacts/
arm/
...
To build for all architectures, you can use the following command:
make build
To clean the build, you can use the following command:
make clean