Compare commits
9 Commits
python-sup
...
reduce-sta
Author | SHA1 | Date | |
---|---|---|---|
aa49ade8d4 | |||
1dfe3fa6ca | |||
c44e67540a | |||
a0ceeff014 | |||
0a60aedf76 | |||
ff0d3ad28f | |||
c86f506e90 | |||
46e8eb22a8 | |||
fa04d3a7a2 |
24
.github/workflows/pr-pipeline.yaml
vendored
Normal file
24
.github/workflows/pr-pipeline.yaml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
name: gdb-static-pr-pipeline
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: ["x86_64", "arm", "aarch64", "powerpc", "mips", "mipsel"]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install -y wget
|
||||
|
||||
- name: Build
|
||||
run: make build-${{ matrix.architecture }} -j$((`nproc`+1))
|
@ -1,19 +1,19 @@
|
||||
name: gdb-static-pipeline
|
||||
name: gdb-static-release-pipeline
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
# Use a non-parallel single job pipeline because artifacts weigh too much. Instead,
|
||||
# simply build the files in the same job they are released.
|
||||
jobs:
|
||||
build:
|
||||
build_and_publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install -y wget
|
||||
@ -24,14 +24,7 @@ jobs:
|
||||
- name: Pack
|
||||
run: make pack
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: gdb-static
|
||||
path: build/artifacts/gdb-static*.tar.gz
|
||||
|
||||
- name: Publish release
|
||||
if: github.event_name == 'push'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: build/artifacts/gdb-static*.tar.gz
|
8
.gitmodules
vendored
Normal file
8
.gitmodules
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
[submodule "cpython-static"]
|
||||
path = src/submodule_packages/cpython-static
|
||||
url = git@github.com:guyush1/cpython-static.git
|
||||
branch = python3.12-static
|
||||
[submodule "binutils-gdb-static"]
|
||||
path = src/submodule_packages/binutils-gdb
|
||||
url = git@github.com:guyush1/binutils-gdb.git
|
||||
branch = gdb-static
|
23
Makefile
23
Makefile
@ -1,6 +1,8 @@
|
||||
ARCHS := x86_64 arm aarch64 powerpc mips mipsel
|
||||
TARGETS := $(addprefix build-, $(ARCHS))
|
||||
PACK_TARGETS := $(addprefix pack-, $(ARCHS))
|
||||
SUBMODULE_PACKAGES := $(wildcard src/submodule_packages/*)
|
||||
BUILD_PACKAGES_DIR := "build/packages"
|
||||
|
||||
.PHONY: clean help download_packages build build-docker-image $(TARGETS) $(PACK_TARGETS)
|
||||
|
||||
@ -23,22 +25,28 @@ build/build-docker-image.stamp: Dockerfile
|
||||
|
||||
build-docker-image: build/build-docker-image.stamp
|
||||
|
||||
build/download-packages.stamp: build/build-docker-image.stamp src/download_packages.sh
|
||||
mkdir -p build/packages
|
||||
build/download-packages.stamp: build/build-docker-image.stamp src/compilation/download_packages.sh
|
||||
mkdir -p $(BUILD_PACKAGES_DIR)
|
||||
docker run --user $(shell id -u):$(shell id -g) \
|
||||
--rm --volume .:/app/gdb gdb-static env TERM=xterm-256color \
|
||||
/app/gdb/src/download_packages.sh /app/gdb/build/packages
|
||||
/app/gdb/src/compilation/download_packages.sh /app/gdb/$(BUILD_PACKAGES_DIR)/
|
||||
touch build/download-packages.stamp
|
||||
|
||||
build/symlink-git-packages.stamp: $(SUBMODULE_PACKAGES)
|
||||
mkdir -p $(BUILD_PACKAGES_DIR)
|
||||
ln -sf $(addprefix /app/gdb/, $(SUBMODULE_PACKAGES)) $(BUILD_PACKAGES_DIR)/
|
||||
|
||||
symlink-git-packages: build/symlink-git-packages.stamp
|
||||
|
||||
download-packages: build/download-packages.stamp
|
||||
|
||||
build: $(TARGETS)
|
||||
|
||||
$(TARGETS): build-%: download-packages build-docker-image
|
||||
$(TARGETS): build-%: symlink-git-packages download-packages build-docker-image
|
||||
mkdir -p build
|
||||
docker run --user $(shell id -u):$(shell id -g) \
|
||||
--rm --volume .:/app/gdb gdb-static env TERM=xterm-256color \
|
||||
/app/gdb/src/build.sh $* /app/gdb/build/ /app/gdb/src
|
||||
/app/gdb/src/compilation/build.sh $* /app/gdb/build/ /app/gdb/src
|
||||
|
||||
pack: $(PACK_TARGETS)
|
||||
|
||||
@ -47,7 +55,10 @@ $(PACK_TARGETS): pack-%: build-%
|
||||
tar -czf "build/artifacts/gdb-static-$*.tar.gz" -C "build/artifacts/$*" .; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
clean-git-packages:
|
||||
git submodule foreach '[[ ! "$$sm_path" == src/submodule_packages/* ]] || git clean -xffd'
|
||||
|
||||
clean: clean-git-packages
|
||||
rm -rf build
|
||||
# Kill and remove all containers of image gdb-static
|
||||
docker ps -a | grep -P "^[a-f0-9]+\s+gdb-static\s+" | awk '{print $$1}' | xargs docker rm -f 2>/dev/null || true
|
||||
|
@ -4,6 +4,9 @@
|
||||
script_dir=$(dirname "$0")
|
||||
source "$script_dir/utils.sh"
|
||||
|
||||
# Don't want random unknown things to fail in the build procecss!
|
||||
set -e
|
||||
|
||||
function set_compliation_variables() {
|
||||
# Set compilation variables such as which compiler to use.
|
||||
#
|
||||
@ -40,7 +43,7 @@ function set_compliation_variables() {
|
||||
CROSS=mipsel-linux-gnu-
|
||||
export HOST=mipsel-linux-gnu
|
||||
elif [[ "$target_arch" == "x86_64" ]]; then
|
||||
CROSS=""
|
||||
CROSS=x86_64-linux-gnu-
|
||||
export HOST=x86_64-linux-gnu
|
||||
fi
|
||||
|
||||
@ -49,6 +52,9 @@ function set_compliation_variables() {
|
||||
|
||||
export CFLAGS="-O2"
|
||||
export CXXFLAGS="-O2"
|
||||
|
||||
# Strip the binary to reduce it's size.
|
||||
export LDFLAGS="-s"
|
||||
}
|
||||
|
||||
function set_ncurses_link_variables() {
|
@ -2,7 +2,7 @@
|
||||
|
||||
# Include utils library
|
||||
script_dir=$(dirname "$0")
|
||||
. "$script_dir/utils.sh"
|
||||
source "$script_dir/utils.sh"
|
||||
|
||||
# List of package URLs to download
|
||||
SOURCE_URLS=(
|
||||
@ -201,14 +201,6 @@ function download_gdb_packages() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ! -d gdb-static ]]; then
|
||||
git clone https://github.com/guyush1/binutils-gdb.git --single-branch --branch gdb-static
|
||||
fi
|
||||
|
||||
if [[ ! -d python3.12-static ]]; then
|
||||
git clone https://github.com/guyush1/cpython-static.git --single-branch --branch python3.12-static
|
||||
fi
|
||||
|
||||
fancy_title "Finished downloading GDB packages"
|
||||
popd
|
||||
}
|
1
src/submodule_packages/binutils-gdb
Submodule
1
src/submodule_packages/binutils-gdb
Submodule
Submodule src/submodule_packages/binutils-gdb added at f7d0fb2e22
1
src/submodule_packages/cpython-static
Submodule
1
src/submodule_packages/cpython-static
Submodule
Submodule src/submodule_packages/cpython-static added at 7ffd428d5b
Reference in New Issue
Block a user