Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

# Build folders
build/

# Ignore Python artifacts.
**/__pycache__/
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ RUN apt update && apt install -y \
make \
patch \
pkg-config \
po4a \
python3-pip \
software-properties-common \
texinfo \
Expand All @@ -41,8 +42,8 @@ RUN apt update && apt install -y ${PYTHON_VERSION}
# available python3-aiohttp's version in Ubuntu.
RUN ${PYTHON_VERSION} -m pip install --break-system-packages aiohttp

COPY src/docker_utils/download_musl_toolchains.py .
RUN ${PYTHON_VERSION} -u download_musl_toolchains.py
COPY src/compilation/file_downloader.py src/compilation/setup_musl_toolchains.py ./
RUN ${PYTHON_VERSION} -u setup_musl_toolchains.py

WORKDIR /app/gdb

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ help:
@echo ""
@echo " make clean"

build/build-docker-image.stamp: Dockerfile src/docker_utils/download_musl_toolchains.py
build/build-docker-image.stamp: Dockerfile src/compilation/setup_musl_toolchains.py
mkdir -p build
docker buildx build --tag gdb-static .
touch build/build-docker-image.stamp

build-docker-image: build/build-docker-image.stamp

build/download-packages.stamp: build/build-docker-image.stamp src/compilation/download_packages.sh
build/download-packages.stamp: build/build-docker-image.stamp src/compilation/download_packages.py
mkdir -p $(BUILD_PACKAGES_DIR)
docker run $(TTY_ARG) --user $(shell id -u):$(shell id -g) \
--rm --volume .:/app/gdb gdb-static env TERM=xterm-256color \
/app/gdb/src/compilation/download_packages.sh /app/gdb/$(BUILD_PACKAGES_DIR)/
/app/gdb/src/compilation/download_packages.py /app/gdb/$(BUILD_PACKAGES_DIR)/
touch build/download-packages.stamp

build/symlink-git-packages.stamp: $(SUBMODULE_PACKAGES)
Expand All @@ -70,7 +70,7 @@ _build-%: symlink-git-packages download-packages build-docker-image
mkdir -p build
docker run $(TTY_ARG) --user $(shell id -u):$(shell id -g) \
--rm --volume .:/app/gdb gdb-static env TERM=xterm-256color \
/app/gdb/src/compilation/build.sh $* /app/gdb/build/ /app/gdb/src $(BUILD_TYPE) $(GDB_BFD_ARCHS)
/app/gdb/src/compilation/build.py $* /app/gdb/build/ /app/gdb/src $(BUILD_TYPE) $(GDB_BFD_ARCHS)

pack: $(ALL_PACK_TARGETS)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<img src="https://img.shields.io/github/contributors-anon/guyush1/gdb-static?color=yellow&style=flat-square" alt="contributors" style="height: 20px;">
</a>
<img src="https://img.shields.io/badge/GDB-v17.1-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-3.14.2-blue?logo=python&logoColor=white&style=flat-square" alt="python" style="height: 20px;">
</h4>

## TL;DR
Expand Down Expand Up @@ -140,7 +140,7 @@ Adding a custom architecture
Adding a new architecture to the build system is straightforward. Follow these steps:

- **Add a cross compiler**: <br />
Add a musl-based compiler to the `ARCHS` dictionary in `src/docker_utils/download_musl_toolchains.py`. You can find musl-based compilers [here](https://more.musl.cc/). <br />
Add a musl-based compiler to the `ARCHS` dictionary in `src/docker_utils/setup_musl_toolchains.py`. You can find musl-based compilers [here](https://more.musl.cc/). <br />
If a musl-based compiler is not available for your architecture, you can instead install a compiler via `apt` in the Dockerfile. However, using a musl-based toolchain is highly recommended.
- **Update the Makefile**: <br />
Add the new architecture to the `ARCHS` variable in the Makefile.
Expand Down
Loading
Loading