Skip to content

Commit 9abad38

Browse files
committed
documentation: improve the readme file
1 parent a9a044f commit 9abad38

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Repository of static gdb and gdbserver
22

3-
The statically compiled gdb / gdbserver binaries are avaliable to download under github releases!
3+
## **The statically compiled gdb / gdbserver binaries are avaliable to download under github releases!**
44

5-
# Compiling gdb using docker
5+
link: [gdb-static github releases](https://github.com/guyush1/gdb-static/releases)
6+
7+
## Compiling gdb using docker
68

79
This repository contains a dockerfile and build scripts to compile gdb and gdbserver statically for multiple architectures.
810
Currently, the supported architectures are:
@@ -14,7 +16,7 @@ You can easily expand it to support more architectures by adding the appropriate
1416

1517
NOTE: You don't need to interact with the dockerfile directly, as the Makefile will take care of everything for you.
1618

17-
## Building for a specific architecture
19+
### Building for a specific architecture
1820

1921
To build for a specific architecture, you can use the following command:
2022
```bash
@@ -35,25 +37,25 @@ build/
3537
...
3638
```
3739

38-
## Building for all architectures
40+
### Building for all architectures
3941

4042
To build for all architectures, you can use the following command:
4143
```bash
4244
make build
4345
```
4446

45-
## Cleaning the build
47+
### Cleaning the build
4648

4749
To clean the build, you can use the following command:
4850
```bash
4951
make clean
5052
```
5153

52-
# Notes about this file - read before proceeding!
54+
## Notes about this file - read before proceeding!
5355

5456
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.
5557

56-
## <VARAIBLES> in the script
58+
### <VARAIBLES> in the script
5759

5860
When specifying the compilation dir throughout the compilation process (specified as <COMPILATION_DIR_PATH> in this file), DO NOT use relative pathing, or bash characters such as `~`. They will not get parsed correctly! Instead, use absolute paths only.
5961

@@ -66,9 +68,9 @@ Examples to the <VARIABLES> throughout the script:
6668
Environment info:
6769
- glibc version: 2.39-0ubuntu8.3 (NOTE: When i compiled gdb-15 using an older glibc, such as the one i had in my ubuntu-20.04 machine, i received a segfault in gdb...).
6870

69-
# Compiling gdb statically to the host platform
71+
## Compiling gdb statically to the host platform
7072

71-
## 1) Compiling iconv
73+
### 1) Compiling iconv
7274

7375
While compiling iconv is not a must, the libc-provided iconv (a utility to convert between encodings) may fail on different architectures,
7476
at least in my experiance. Thus, I recommended using a custom libiconv and compiling it into gdb.
@@ -85,7 +87,7 @@ V) run `cp -r ./include ./lib/.libs/`
8587
VI) run `mkdir ./lib/.libs/lib/`
8688
VII) run `cp ./lib/.libs/libiconv.a ./lib/.libs/lib/`
8789

88-
## 2) Compiling gdb
90+
### 2) Compiling gdb
8991

9092
Clone gdb from sourceware - https://sourceware.org/git/binutils-gdb.git.
9193
I checked out to the 15.1 tag.
@@ -99,16 +101,16 @@ IV) run `make all-gdb -j$(nproc)` - for gdbserver, run `make all-gdbserver -j$(n
99101
gdb will sit under gdb/gdb.
100102
gdbserver will sit under gdbserver/gdbserver.
101103

102-
# Cross compiling gdb statically to other architectures.
104+
## Cross compiling gdb statically to other architectures.
103105

104106
Cross compiling gdb statically is a bit more complicated then regular static compilation. In order to cross compile gdb statically, we will need to compile libgmp and libmpfr as well as iconv.
105107

106-
## 1) Compiling iconv
108+
### 1) Compiling iconv
107109

108110
Work according to the same process as described under the compilation to the host platform, aside from the configure script:
109111
IV) run `../configure --enable-static CC=<CROSS_COMPILER_C> CXX=<CROSS_COMPILER_CPP> --host=<HOST_NAME>`
110112

111-
## 2) Compiling libgmp
113+
### 2) Compiling libgmp
112114

113115
Download and extract the latest edition from https://gmplib.org/.
114116
I used the 6.3.0 edition.
@@ -122,7 +124,7 @@ V) run `cp gmp.h ./.libs/include/`
122124
VI) run `mkdir ./.libs/lib`
123125
VII) run `cp ./.libs/libgmp.a ./.libs/lib`
124126

125-
## 3) Compiling libmpfr
127+
### 3) Compiling libmpfr
126128

127129
Download and extract the latest edition from https://www.mpfr.org/.
128130
I used the 4.2.1 edition.
@@ -136,7 +138,7 @@ V) run `cp ./src/.libs/libmpfr.a ./src/.libs/lib`
136138
VI) run `mkdir ./src/.libs/include`
137139
VII) run `cp ../src/mpfr.h ./src/.libs/include/`
138140

139-
## 4) Compiling gdb
141+
### 4) Compiling gdb
140142

141143
Work according to the same process as described under the compilation to the host platform, aside from the configure script:
142144
III) run `../configure --enable-static --with-static-standard-libraries --disable-tui --disable-inprocess-agent --with-libiconv-prefix=<COMPILATION_DIR_PATH>/lib/.libs/ --with-libiconv-type=static --with-gmp=<COMPILATION_DIR_PATH>/.libs/ --with-mpfr=<COMPILATION_DIR_PATH>/src/.libs/ CC=<CROSS_COMPILER_C> CXX=<CROSS_COMPILER_CPP> --host=<HOST_NAME>`

0 commit comments

Comments
 (0)