|
2 | 2 |
|
3 | 3 | The statically compiled gdb / gdbserver binaries are avaliable to download under github releases! |
4 | 4 |
|
| 5 | +# Compiling gdb using docker |
| 6 | + |
| 7 | +This repository contains a dockerfile and build scripts to compile gdb and gdbserver statically for multiple architectures. |
| 8 | +Currently, the supported architectures are: |
| 9 | +- x86_64 |
| 10 | +- arm |
| 11 | +- aarch64 |
| 12 | +- powerpc (32bit) |
| 13 | +You can easily expand it to support more architectures by adding the appropriate cross compilers to the dockerfile, and other build scripts. |
| 14 | + |
| 15 | +NOTE: You don't need to interact with the dockerfile directly, as the Makefile will take care of everything for you. |
| 16 | + |
| 17 | +## Building for a specific architecture |
| 18 | + |
| 19 | +To build for a specific architecture, you can use the following command: |
| 20 | +```bash |
| 21 | +make build-<ARCH> |
| 22 | +``` |
| 23 | + |
| 24 | +For example, to build for arm: |
| 25 | +```bash |
| 26 | +make build-arm |
| 27 | +``` |
| 28 | + |
| 29 | +The resulting binaries will be placed under the `build/artifacts/` directory. |
| 30 | +Each architecture will have its own directory under `build/artifacts/`. For example, the arm architecture will have the following directory structure: |
| 31 | +``` |
| 32 | +build/ |
| 33 | + artifacts/ |
| 34 | + arm/ |
| 35 | + ... |
| 36 | +``` |
| 37 | + |
| 38 | +## Building for all architectures |
| 39 | + |
| 40 | +To build for all architectures, you can use the following command: |
| 41 | +```bash |
| 42 | +make build |
| 43 | +``` |
| 44 | + |
| 45 | +## Cleaning the build |
| 46 | + |
| 47 | +To clean the build, you can use the following command: |
| 48 | +```bash |
| 49 | +make clean |
| 50 | +``` |
| 51 | + |
5 | 52 | # Notes about this file - read before proceeding! |
6 | 53 |
|
7 | 54 | While i already provided the gdb/gdbserver-15 statically compiled binaries handed out to you, some people might want to compile it to a different architecture, or compile a newer version of gdb in the future :). This rest of the file contains my compilation documentation so that you could save yourself some time and do it yourself, if you wish. |
@@ -86,6 +133,8 @@ II) run `../configure CC=<CROSS_COMPILER_C> CXX=<CROSS_COMPILER_CPP> --enable-st |
86 | 133 | III) run `make -j$(nproc)` |
87 | 134 | IV) run `mkdir ./src/.libs/lib` |
88 | 135 | V) run `cp ./src/.libs/libmpfr.a ./src/.libs/lib` |
| 136 | +VI) run `mkdir ./src/.libs/include` |
| 137 | +VII) run `cp ../src/mpfr.h ./src/.libs/include/` |
89 | 138 |
|
90 | 139 | ## 4) Compiling gdb |
91 | 140 |
|
|
0 commit comments