Compare commits
16 Commits
add-submod
...
develop
Author | SHA1 | Date | |
---|---|---|---|
|
56eef2a483 | ||
|
fb1c8c064b | ||
|
0aef35466f | ||
|
a67de84e98 | ||
|
6332ea0b03 | ||
|
cd70d531cf | ||
|
f23c33bdd3 | ||
|
6a31199eff | ||
|
646f3e2b3c | ||
|
75bc26180a | ||
|
068ae4eb24 | ||
|
9b43b0cf47 | ||
|
1d6af45cac | ||
|
a7efcb729e | ||
|
8baaffdcbf | ||
|
eef9ea9215 |
2
Makefile
2
Makefile
@ -13,6 +13,8 @@ BUILD_PACKAGES_DIR := "build/packages"
|
|||||||
|
|
||||||
.PHONY: clean help download_packages build build-docker-image $(ALL_TARGETS) $(ALL_PACK_TARGETS)
|
.PHONY: clean help download_packages build build-docker-image $(ALL_TARGETS) $(ALL_PACK_TARGETS)
|
||||||
|
|
||||||
|
.NOTPARALLEL: build pack
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Usage:"
|
@echo "Usage:"
|
||||||
@echo " make build"
|
@echo " make build"
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
<img src="https://img.shields.io/github/contributors-anon/guyush1/gdb-static?color=yellow&style=flat-square" alt="contributors" style="height: 20px;">
|
<img src="https://img.shields.io/github/contributors-anon/guyush1/gdb-static?color=yellow&style=flat-square" alt="contributors" style="height: 20px;">
|
||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
<img src="https://img.shields.io/badge/GDB-v15.2-orange?logo=gnu&logoColor=white&style=flat-square" alt="gdb" style="height: 20px;">
|
<img src="https://img.shields.io/badge/GDB-v16.2-orange?logo=gnu&logoColor=white&style=flat-square" alt="gdb" style="height: 20px;">
|
||||||
<img src="https://img.shields.io/badge/Python-built--in-blue?logo=python&logoColor=white&style=flat-square" alt="python" style="height: 20px;">
|
<img src="https://img.shields.io/badge/Python-built--in-blue?logo=python&logoColor=white&style=flat-square" alt="python" style="height: 20px;">
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
|
@ -1,49 +1,58 @@
|
|||||||
# Notes about this file - read before proceeding!
|
# Notes about this file - read before proceeding!
|
||||||
|
|
||||||
While i have already provided the gdb/gdbserver-15 statically compiled binaries for you, some people might want to compile it to a different architecture (without our build scripts), or compile a newer version of gdb in the future :). The rest of the file contains a documentation of the compilation process, in order to help you out.
|
While we have already provided the gdb/gdbserver statically compiled binaries for you, some people might want to compile it without our build scripts, or compile a newer version of gdb in the future :).
|
||||||
|
The rest of the file contains a documentation of the compilation process, in order to help you out.
|
||||||
|
|
||||||
## <VARAIBLES> in the script
|
NOTE: The compilation guide describes the compilation process in order to create a minimal-working version of gdb. Our build-scripts also provides further capabilites to gdb, such as python and xml support, which are not documented in this file.
|
||||||
|
|
||||||
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.
|
## <VARAIBLES> In this file
|
||||||
|
|
||||||
|
Environment variables are denoted by <...> throughout this file.
|
||||||
|
|
||||||
|
Please note that when specifying a compilation dir throughout the compilation process (via the <COMPILATION_DIR_PATH> environment variable), DO NOT use relative pathing, or special bash characters such as `~`. Relative pathing / special bash characters will not get parsed correctly!
|
||||||
|
|
||||||
|
Instead, always use absolute paths.
|
||||||
|
|
||||||
Examples to the <VARIABLES> throughout the script:
|
Examples to the <VARIABLES> throughout the script:
|
||||||
<CROSS_COMPILER_C> - arm-linux-gnueabi-gcc
|
- <CROSS_COMPILER_C> - arm-linux-gnueabi-gcc
|
||||||
<CROSS_COMPILER_CPP> - arm-linux-gnueabi-g++
|
- <CROSS_COMPILER_CPP> - arm-linux-gnueabi-g++
|
||||||
<HOST_NAME> - arm-linux-gnueabi
|
- <HOST_NAME> - arm-linux-gnueabi
|
||||||
<COMPILATION_DIR_PATH> - /home/username/projects/libgmp-x.y.z/build-arm/
|
- <COMPILATION_DIR_PATH> - /home/username/projects/libgmp-x.y.z/build-arm/
|
||||||
|
|
||||||
Environment info:
|
Environment info:
|
||||||
- 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...).
|
- glibc version: 2.39-0ubuntu8.3 (NOTE: When i compiled gdb using an older glibc, such as the one i had in my ubuntu-20.04 machine, i received a segfault in gdb, so the libc version is important!).
|
||||||
|
|
||||||
# Compiling gdb statically to the host platform
|
# Compiling gdb statically to the host platform
|
||||||
|
|
||||||
## 1) Compiling iconv
|
## 1) Compiling iconv
|
||||||
|
|
||||||
While compiling iconv is not a must, the libc-provided iconv (a utility to convert between encodings) may fail on different architectures,
|
While compiling iconv is not a must, the libc-provided iconv (a utility to convert between encodings) may fail on different architectures,
|
||||||
at least in my experiance. Thus, I recommended using a custom libiconv and compiling it into gdb.
|
at least in my experience.
|
||||||
|
Thus, I recommended using a custom libiconv and compiling it into gdb.
|
||||||
|
|
||||||
Download the source from https://github.com/roboticslibrary/libiconv.git
|
Download the source from https://github.com/roboticslibrary/libiconv.git
|
||||||
|
|
||||||
Make sure to check out to a stable tag (in my case - v1.17).
|
Make sure to check out to a stable tag (in my case - v1.17).
|
||||||
|
|
||||||
Work according to the following steps:
|
Work according to the following steps:
|
||||||
I) run `./gitsub.sh pull`
|
1. run `./gitsub.sh pull`
|
||||||
II) run `./autogen.sh` to create the configure script from configure.sh.
|
2. run `./autogen.sh` to create the configure script from configure.sh.
|
||||||
III) create a build dir (e.g build), and then cd into it.
|
3. create a build dir (e.g build), and then cd into it.
|
||||||
IV) run `../configure --enable-static`
|
4. run `../configure --enable-static`
|
||||||
V) run `cp -r ./include ./lib/.libs/`
|
5. run `cp -r ./include ./lib/.libs/`
|
||||||
VI) run `mkdir ./lib/.libs/lib/`
|
6. run `mkdir ./lib/.libs/lib/`
|
||||||
VII) run `cp ./lib/.libs/libiconv.a ./lib/.libs/lib/`
|
7. run `cp ./lib/.libs/libiconv.a ./lib/.libs/lib/`
|
||||||
|
|
||||||
## 2) Compiling gdb
|
## 2) Compiling gdb
|
||||||
|
|
||||||
Clone gdb from sourceware - https://sourceware.org/git/binutils-gdb.git.
|
Clone gdb from from my forked respository - https://github.com/guyush1/binutils-gdb/tree/gdb-static.
|
||||||
I checked out to the 15.2 tag.
|
|
||||||
|
Make sure to check out to the **gdb-static** branch - this branch contains all of the changes i had to do to the build system in order for it to compile gdb statically.
|
||||||
|
|
||||||
Work according to the following steps:
|
Work according to the following steps:
|
||||||
I) Apply my patches (gdb_static.patch). If you are not on the exact tag i used (15.2) - you might need to apply them manually, and change some stuff.
|
1. create a build dir.
|
||||||
II) create a build dir.
|
2. 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`
|
||||||
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`
|
3. run `make all-gdb -j$(nproc)` - for gdbserver, run `make all-gdbserver -j$(nproc)`.
|
||||||
IV) run `make all-gdb -j$(nproc)` - for gdbserver, run `make all-gdbserver -j$(nproc)`.
|
|
||||||
|
|
||||||
gdb will sit under gdb/gdb.
|
gdb will sit under gdb/gdb.
|
||||||
gdbserver will sit under gdbserver/gdbserver.
|
gdbserver will sit under gdbserver/gdbserver.
|
||||||
@ -63,13 +72,13 @@ Download and extract the latest edition from https://gmplib.org/.
|
|||||||
I used the 6.3.0 edition.
|
I used the 6.3.0 edition.
|
||||||
|
|
||||||
Work according to the following steps:
|
Work according to the following steps:
|
||||||
I) Create a build dir and cd into it.
|
1. Create a build dir and cd into it.
|
||||||
II) run `../configure CC=<CROSS_COMPILER_C> CXX=<CROSS_COMPILER_CPP> --enable-static --host=<HOST_NAME>`
|
2. run `../configure CC=<CROSS_COMPILER_C> CXX=<CROSS_COMPILER_CPP> --enable-static --host=<HOST_NAME>`
|
||||||
III) run `make -j$(nproc)`
|
3. run `make -j$(nproc)`
|
||||||
IV) run `mkdir ./.libs/include/`
|
4. run `mkdir ./.libs/include/`
|
||||||
V) run `cp gmp.h ./.libs/include/`
|
5. run `cp gmp.h ./.libs/include/`
|
||||||
VI) run `mkdir ./.libs/lib`
|
6. run `mkdir ./.libs/lib`
|
||||||
VII) run `cp ./.libs/libgmp.a ./.libs/lib`
|
7. run `cp ./.libs/libgmp.a ./.libs/lib`
|
||||||
|
|
||||||
## 3) Compiling libmpfr
|
## 3) Compiling libmpfr
|
||||||
|
|
||||||
@ -77,15 +86,16 @@ Download and extract the latest edition from https://www.mpfr.org/.
|
|||||||
I used the 4.2.1 edition.
|
I used the 4.2.1 edition.
|
||||||
|
|
||||||
Work according to the following steps:
|
Work according to the following steps:
|
||||||
I) Create a build dir and cd into it.
|
1. Create a build dir and cd into it.
|
||||||
II) run `../configure CC=<CROSS_COMPILER_C> CXX=<CROSS_COMPILER_CPP> --enable-static --with-gmp-build=<COMPILATION_DIR_PATH> --host=<HOST_NAME>`
|
2. run `../configure CC=<CROSS_COMPILER_C> CXX=<CROSS_COMPILER_CPP> --enable-static --with-gmp-build=<COMPILATION_DIR_PATH> --host=<HOST_NAME>`
|
||||||
III) run `make -j$(nproc)`
|
3. run `make -j$(nproc)`
|
||||||
IV) run `mkdir ./src/.libs/lib`
|
4. run `mkdir ./src/.libs/lib`
|
||||||
V) run `cp ./src/.libs/libmpfr.a ./src/.libs/lib`
|
5. run `cp ./src/.libs/libmpfr.a ./src/.libs/lib`
|
||||||
VI) run `mkdir ./src/.libs/include`
|
6. run `mkdir ./src/.libs/include`
|
||||||
VII) run `cp ../src/mpfr.h ./src/.libs/include/`
|
7. run `cp ../src/mpfr.h ./src/.libs/include/`
|
||||||
|
|
||||||
## 4) Compiling gdb
|
## 4) Compiling gdb
|
||||||
|
|
||||||
Work according to the same process as described under the compilation to the host platform, aside from the configure script:
|
Work according to the same process as described under the compilation to the host platform, aside from the configure script:
|
||||||
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>`
|
|
||||||
|
2. 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>`
|
||||||
|
@ -442,6 +442,9 @@ function build_gdb() {
|
|||||||
../configure -C --enable-static --with-static-standard-libraries --disable-inprocess-agent \
|
../configure -C --enable-static --with-static-standard-libraries --disable-inprocess-agent \
|
||||||
--enable-tui "$python_flag" \
|
--enable-tui "$python_flag" \
|
||||||
--with-expat --with-libexpat-type="static" \
|
--with-expat --with-libexpat-type="static" \
|
||||||
|
--with-gdb-datadir="/usr/share/gdb" --with-separate-debug-dir="/usr/lib/debug" \
|
||||||
|
--with-system-gdbinit="/etc/gdb/gdbinit" --with-system-gdbinit-dir="/etc/gdb/gdbinit.d" \
|
||||||
|
--with-jit-reader-dir="/usr/lib/gdb" \
|
||||||
"--with-libiconv-prefix=$libiconv_prefix" --with-libiconv-type=static \
|
"--with-libiconv-prefix=$libiconv_prefix" --with-libiconv-type=static \
|
||||||
"--with-gmp=$libgmp_prefix" \
|
"--with-gmp=$libgmp_prefix" \
|
||||||
"--with-mpfr=$libmpfr_prefix" \
|
"--with-mpfr=$libmpfr_prefix" \
|
||||||
|
@ -64,11 +64,6 @@ function download_package() {
|
|||||||
local url="$1"
|
local url="$1"
|
||||||
local output="$2"
|
local output="$2"
|
||||||
|
|
||||||
if [[ -f "$output" ]]; then
|
|
||||||
>&2 echo "Skipping download: $output already exists"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
wget "$url" -O "$output"
|
wget "$url" -O "$output"
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
>&2 echo "Error: failed to download $url"
|
>&2 echo "Error: failed to download $url"
|
||||||
@ -98,11 +93,6 @@ function extract_package() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d "$output_dir" ]]; then
|
|
||||||
>&2 echo "Skipping extraction: $output_dir already exists"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
pushd "$temp_dir" > /dev/null
|
pushd "$temp_dir" > /dev/null
|
||||||
|
|
||||||
unpack_tarball "$tarball_realpath"
|
unpack_tarball "$tarball_realpath"
|
||||||
@ -113,6 +103,10 @@ function extract_package() {
|
|||||||
|
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
|
# Make sure output dir is empty, so we could move content into it.
|
||||||
|
# The directory might not exist, so we need to pass || true so that set -e won't fail us.
|
||||||
|
rm -rf "$output_dir" || true
|
||||||
|
|
||||||
mv "$temp_dir/$package_dir" "$output_dir"
|
mv "$temp_dir/$package_dir" "$output_dir"
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
return 1
|
return 1
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
abc
|
|
||||||
_aix_support
|
_aix_support
|
||||||
antigravity
|
antigravity
|
||||||
argparse
|
argparse
|
||||||
@ -8,7 +7,6 @@ bdb
|
|||||||
bisect
|
bisect
|
||||||
calendar
|
calendar
|
||||||
cmd
|
cmd
|
||||||
codecs
|
|
||||||
codeop
|
codeop
|
||||||
code
|
code
|
||||||
<collections.**.*>
|
<collections.**.*>
|
||||||
@ -54,7 +52,6 @@ hmac
|
|||||||
imaplib
|
imaplib
|
||||||
<importlib.**.*>
|
<importlib.**.*>
|
||||||
inspect
|
inspect
|
||||||
io
|
|
||||||
ipaddress
|
ipaddress
|
||||||
<json.**.*>
|
<json.**.*>
|
||||||
keyword
|
keyword
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 34012c42d0a2edaad66265c76e63104d8b4cd0b6
|
Subproject commit 25f97ccb7ff1a9d7bd0e25535d749acf6e1a87be
|
@ -1 +1 @@
|
|||||||
Subproject commit 74ab74654b867a6e1c3b2af3ccf6b7b74b0e9a9b
|
Subproject commit f38630702ca74b512256880f5e80130a8733a0b5
|
Loading…
x
Reference in New Issue
Block a user