Compare commits
15 Commits
improve-do
...
reduce-sta
Author | SHA1 | Date | |
---|---|---|---|
aa49ade8d4 | |||
1dfe3fa6ca | |||
c44e67540a | |||
a0ceeff014 | |||
0a60aedf76 | |||
ff0d3ad28f | |||
c86f506e90 | |||
46e8eb22a8 | |||
fa04d3a7a2 | |||
dc882d9598 | |||
d55a31bb5e | |||
a962fbb441 | |||
d5e1dbb011 | |||
8dc07deb66 | |||
3738fc8629 |
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:
|
on:
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- '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:
|
jobs:
|
||||||
build:
|
build_and_publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt-get install -y wget
|
run: sudo apt-get install -y wget
|
||||||
@ -24,14 +24,7 @@ jobs:
|
|||||||
- name: Pack
|
- name: Pack
|
||||||
run: make 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
|
- name: Publish release
|
||||||
if: github.event_name == 'push'
|
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: build/artifacts/gdb-static*.tar.gz
|
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
|
12
Dockerfile
12
Dockerfile
@ -2,17 +2,29 @@ FROM ubuntu:24.04
|
|||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN apt update && apt install -y \
|
RUN apt update && apt install -y \
|
||||||
|
bison \
|
||||||
|
file \
|
||||||
|
flex \
|
||||||
g++ \
|
g++ \
|
||||||
g++-aarch64-linux-gnu \
|
g++-aarch64-linux-gnu \
|
||||||
g++-arm-linux-gnueabi \
|
g++-arm-linux-gnueabi \
|
||||||
|
g++-mips-linux-gnu \
|
||||||
|
g++-mipsel-linux-gnu \
|
||||||
g++-powerpc-linux-gnu \
|
g++-powerpc-linux-gnu \
|
||||||
gcc \
|
gcc \
|
||||||
gcc-aarch64-linux-gnu \
|
gcc-aarch64-linux-gnu \
|
||||||
gcc-arm-linux-gnueabi \
|
gcc-arm-linux-gnueabi \
|
||||||
|
gcc-mips-linux-gnu \
|
||||||
|
gcc-mipsel-linux-gnu \
|
||||||
gcc-powerpc-linux-gnu \
|
gcc-powerpc-linux-gnu \
|
||||||
|
git \
|
||||||
|
libncurses-dev \
|
||||||
m4 \
|
m4 \
|
||||||
make \
|
make \
|
||||||
patch \
|
patch \
|
||||||
|
pkg-config \
|
||||||
|
python3.12 \
|
||||||
|
libpython3-dev \
|
||||||
texinfo \
|
texinfo \
|
||||||
wget \
|
wget \
|
||||||
xz-utils
|
xz-utils
|
||||||
|
35
Makefile
35
Makefile
@ -1,8 +1,10 @@
|
|||||||
ARCHS := x86_64 arm aarch64 powerpc
|
ARCHS := x86_64 arm aarch64 powerpc mips mipsel
|
||||||
TARGETS := $(addprefix build-, $(ARCHS))
|
TARGETS := $(addprefix build-, $(ARCHS))
|
||||||
PACK_TARGETS := $(addprefix pack-, $(ARCHS))
|
PACK_TARGETS := $(addprefix pack-, $(ARCHS))
|
||||||
|
SUBMODULE_PACKAGES := $(wildcard src/submodule_packages/*)
|
||||||
|
BUILD_PACKAGES_DIR := "build/packages"
|
||||||
|
|
||||||
.PHONY: clean help download_packages build patch-gdb build-docker-image $(TARGETS) $(PACK_TARGETS)
|
.PHONY: clean help download_packages build build-docker-image $(TARGETS) $(PACK_TARGETS)
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Usage:"
|
@echo "Usage:"
|
||||||
@ -23,30 +25,28 @@ build/build-docker-image.stamp: Dockerfile
|
|||||||
|
|
||||||
build-docker-image: build/build-docker-image.stamp
|
build-docker-image: build/build-docker-image.stamp
|
||||||
|
|
||||||
build/download-packages.stamp: build/build-docker-image.stamp src/download_packages.sh
|
build/download-packages.stamp: build/build-docker-image.stamp src/compilation/download_packages.sh
|
||||||
mkdir -p build/packages
|
mkdir -p $(BUILD_PACKAGES_DIR)
|
||||||
docker run --user $(shell id -u):$(shell id -g) \
|
docker run --user $(shell id -u):$(shell id -g) \
|
||||||
--rm --volume .:/app/gdb gdb-static env TERM=xterm-256color \
|
--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
|
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
|
download-packages: build/download-packages.stamp
|
||||||
|
|
||||||
build/patch-gdb.stamp: build/build-docker-image.stamp src/gdb_static.patch build/download-packages.stamp
|
|
||||||
docker run --user $(shell id -u):$(shell id -g) \
|
|
||||||
--rm --volume .:/app/gdb gdb-static env TERM=xterm-256color \
|
|
||||||
/app/gdb/src/patch_gdb.sh /app/gdb/build/packages/gdb /app/gdb/src/gdb_static.patch
|
|
||||||
touch build/patch-gdb.stamp
|
|
||||||
|
|
||||||
patch-gdb: build/patch-gdb.stamp
|
|
||||||
|
|
||||||
build: $(TARGETS)
|
build: $(TARGETS)
|
||||||
|
|
||||||
$(TARGETS): build-%: download-packages patch-gdb build-docker-image
|
$(TARGETS): build-%: symlink-git-packages download-packages build-docker-image
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
docker run --user $(shell id -u):$(shell id -g) \
|
docker run --user $(shell id -u):$(shell id -g) \
|
||||||
--rm --volume .:/app/gdb gdb-static env TERM=xterm-256color \
|
--rm --volume .:/app/gdb gdb-static env TERM=xterm-256color \
|
||||||
/app/gdb/src/build.sh $* /app/gdb/build/ /app/gdb/src/gdb_static.patch
|
/app/gdb/src/compilation/build.sh $* /app/gdb/build/ /app/gdb/src
|
||||||
|
|
||||||
pack: $(PACK_TARGETS)
|
pack: $(PACK_TARGETS)
|
||||||
|
|
||||||
@ -55,7 +55,10 @@ $(PACK_TARGETS): pack-%: build-%
|
|||||||
tar -czf "build/artifacts/gdb-static-$*.tar.gz" -C "build/artifacts/$*" .; \
|
tar -czf "build/artifacts/gdb-static-$*.tar.gz" -C "build/artifacts/$*" .; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clean:
|
clean-git-packages:
|
||||||
|
git submodule foreach '[[ ! "$$sm_path" == src/submodule_packages/* ]] || git clean -xffd'
|
||||||
|
|
||||||
|
clean: clean-git-packages
|
||||||
rm -rf build
|
rm -rf build
|
||||||
# Kill and remove all containers of image gdb-static
|
# 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
|
docker ps -a | grep -P "^[a-f0-9]+\s+gdb-static\s+" | awk '{print $$1}' | xargs docker rm -f 2>/dev/null || true
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
# Include utils library
|
# Include utils library
|
||||||
script_dir=$(dirname "$0")
|
script_dir=$(dirname "$0")
|
||||||
. "$script_dir/utils.sh"
|
source "$script_dir/utils.sh"
|
||||||
|
|
||||||
|
# Don't want random unknown things to fail in the build procecss!
|
||||||
|
set -e
|
||||||
|
|
||||||
function set_compliation_variables() {
|
function set_compliation_variables() {
|
||||||
# Set compilation variables such as which compiler to use.
|
# Set compilation variables such as which compiler to use.
|
||||||
@ -13,7 +16,7 @@ function set_compliation_variables() {
|
|||||||
# Returns:
|
# Returns:
|
||||||
# 0: success
|
# 0: success
|
||||||
# 1: failure
|
# 1: failure
|
||||||
supported_archs=("arm" "aarch64" "powerpc" "x86_64")
|
supported_archs=("arm" "aarch64" "powerpc" "x86_64" "mips" "mipsel")
|
||||||
|
|
||||||
local target_arch="$1"
|
local target_arch="$1"
|
||||||
|
|
||||||
@ -33,8 +36,14 @@ function set_compliation_variables() {
|
|||||||
elif [[ "$target_arch" == "powerpc" ]]; then
|
elif [[ "$target_arch" == "powerpc" ]]; then
|
||||||
CROSS=powerpc-linux-gnu-
|
CROSS=powerpc-linux-gnu-
|
||||||
export HOST=powerpc-linux-gnu
|
export HOST=powerpc-linux-gnu
|
||||||
|
elif [[ "$target_arch" == "mips" ]]; then
|
||||||
|
CROSS=mips-linux-gnu-
|
||||||
|
export HOST=mips-linux-gnu
|
||||||
|
elif [[ "$target_arch" == "mipsel" ]]; then
|
||||||
|
CROSS=mipsel-linux-gnu-
|
||||||
|
export HOST=mipsel-linux-gnu
|
||||||
elif [[ "$target_arch" == "x86_64" ]]; then
|
elif [[ "$target_arch" == "x86_64" ]]; then
|
||||||
CROSS=""
|
CROSS=x86_64-linux-gnu-
|
||||||
export HOST=x86_64-linux-gnu
|
export HOST=x86_64-linux-gnu
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -43,6 +52,20 @@ function set_compliation_variables() {
|
|||||||
|
|
||||||
export CFLAGS="-O2"
|
export CFLAGS="-O2"
|
||||||
export CXXFLAGS="-O2"
|
export CXXFLAGS="-O2"
|
||||||
|
|
||||||
|
# Strip the binary to reduce it's size.
|
||||||
|
export LDFLAGS="-s"
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_ncurses_link_variables() {
|
||||||
|
# Set up ncurses library link variables
|
||||||
|
#
|
||||||
|
# Parameters:
|
||||||
|
# $1: ncursesw build dir
|
||||||
|
local ncursesw_build_dir="$1"
|
||||||
|
|
||||||
|
# Allow tui mode by adding our custom built static ncursesw library to the linker search path.
|
||||||
|
export LDFLAGS="-L$ncursesw_build_dir/lib $LDFLAGS"
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_iconv() {
|
function build_iconv() {
|
||||||
@ -146,6 +169,109 @@ function build_libgmp() {
|
|||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function build_ncurses() {
|
||||||
|
# Build libncursesw.
|
||||||
|
#
|
||||||
|
# Parameters:
|
||||||
|
# $1: libncursesw package directory
|
||||||
|
# $2: target architecture
|
||||||
|
#
|
||||||
|
# Echoes:
|
||||||
|
# The libncursesw build directory
|
||||||
|
#
|
||||||
|
# Returns:
|
||||||
|
# 0: success
|
||||||
|
# 1: failure
|
||||||
|
local ncurses_dir="$1"
|
||||||
|
local target_arch="$2"
|
||||||
|
local ncurses_build_dir="$(realpath "$ncurses_dir/build-$target_arch")"
|
||||||
|
|
||||||
|
echo "$ncurses_build_dir"
|
||||||
|
mkdir -p "$ncurses_build_dir"
|
||||||
|
|
||||||
|
if [[ -f "$ncurses_build_dir/lib/libncursesw.a" ]]; then
|
||||||
|
>&2 echo "Skipping build: libncursesw already built for $target_arch"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd "$ncurses_build_dir" > /dev/null
|
||||||
|
|
||||||
|
>&2 fancy_title "Building libncursesw for $target_arch"
|
||||||
|
|
||||||
|
../configure --enable-static "CC=$CC" "CXX=$CXX" "--host=$HOST" \
|
||||||
|
"CFLAGS=$CFLAGS" "CXXFLAGS=$CXXFLAGS" "--enable-widec" 1>&2
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
make -j$(nproc) 1>&2
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
>&2 fancy_title "Finished building libncursesw for $target_arch"
|
||||||
|
|
||||||
|
popd > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_python() {
|
||||||
|
# Build python.
|
||||||
|
#
|
||||||
|
# Parameters:
|
||||||
|
# $1: python package directory
|
||||||
|
# $2: target architecture
|
||||||
|
#
|
||||||
|
# Echoes:
|
||||||
|
# The python build directory
|
||||||
|
#
|
||||||
|
# Returns:
|
||||||
|
# 0: success
|
||||||
|
# 1: failure
|
||||||
|
local python_dir="$1"
|
||||||
|
local target_arch="$2"
|
||||||
|
local python_lib_dir="$(realpath "$python_dir/build-$target_arch")"
|
||||||
|
|
||||||
|
echo "$python_lib_dir"
|
||||||
|
mkdir -p "$python_lib_dir"
|
||||||
|
|
||||||
|
# Having a python-config file is an indication that we successfully built python.
|
||||||
|
if [[ -f "$python_lib_dir/python-config" ]]; then
|
||||||
|
>&2 echo "Skipping build: libpython already built for $target_arch"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd "$python_lib_dir" > /dev/null
|
||||||
|
>&2 fancy_title "Building python for $target_arch"
|
||||||
|
|
||||||
|
export LINKFORSHARED=" "
|
||||||
|
export MODULE_BUILDTYPE="static"
|
||||||
|
export CONFIG_SITE="$python_dir/config.site-static"
|
||||||
|
>&2 CFLAGS="-static" LDFLAGS="-static" ../configure \
|
||||||
|
--prefix=$(realpath .) \
|
||||||
|
--disable-test-modules \
|
||||||
|
--with-ensurepip=no \
|
||||||
|
--without-decimal-contextvar \
|
||||||
|
--build=x86_64-pc-linux-gnu \
|
||||||
|
--host=$HOST \
|
||||||
|
--with-build-python=/usr/bin/python3.12 \
|
||||||
|
--disable-ipv6 \
|
||||||
|
--disable-shared
|
||||||
|
|
||||||
|
>&2 make -j $(nproc)
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install python (in build dir using the prefix set above), in order to have a bash (for cross-compilation) python3-config that works.
|
||||||
|
>&2 make install
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
>&2 fancy_title "Finished building python for $target_arch"
|
||||||
|
popd > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
function build_libmpfr() {
|
function build_libmpfr() {
|
||||||
# Build libmpfr.
|
# Build libmpfr.
|
||||||
#
|
#
|
||||||
@ -236,7 +362,8 @@ function build_gdb() {
|
|||||||
|
|
||||||
>&2 fancy_title "Building gdb for $target_arch"
|
>&2 fancy_title "Building gdb for $target_arch"
|
||||||
|
|
||||||
../configure --enable-static --with-static-standard-libraries --disable-tui --disable-inprocess-agent \
|
../configure -C --enable-static --with-static-standard-libraries --disable-inprocess-agent \
|
||||||
|
--enable-tui --with-python=/app/gdb/build/packages/cpython-static/build-$target_arch/bin/python3-config \
|
||||||
"--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" \
|
||||||
@ -333,9 +460,11 @@ function build_gdb_with_dependencies() {
|
|||||||
# Parameters:
|
# Parameters:
|
||||||
# $1: target architecture
|
# $1: target architecture
|
||||||
# $2: build directory
|
# $2: build directory
|
||||||
|
# $3: src directory
|
||||||
|
|
||||||
local target_arch="$1"
|
local target_arch="$1"
|
||||||
local build_dir="$2"
|
local build_dir="$2"
|
||||||
|
local source_dir="$3"
|
||||||
local packages_dir="$build_dir/packages"
|
local packages_dir="$build_dir/packages"
|
||||||
local artifacts_dir="$build_dir/artifacts"
|
local artifacts_dir="$build_dir/artifacts"
|
||||||
|
|
||||||
@ -361,12 +490,23 @@ function build_gdb_with_dependencies() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
build_and_install_gdb "$packages_dir/gdb" \
|
ncursesw_build_dir="$(build_ncurses "$packages_dir/ncurses" "$target_arch")"
|
||||||
"$iconv_build_dir/lib/.libs/" \
|
if [[ $? -ne 0 ]]; then
|
||||||
"$gmp_build_dir/.libs/" \
|
return 1
|
||||||
"$mpfr_build_dir/src/.libs/" \
|
fi
|
||||||
"$artifacts_dir" \
|
set_ncurses_link_variables "$ncursesw_build_dir"
|
||||||
"$target_arch"
|
|
||||||
|
python_build_dir="$(build_python "$packages_dir/cpython-static" "$target_arch")"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
build_and_install_gdb "$packages_dir/binutils-gdb" \
|
||||||
|
"$iconv_build_dir/lib/.libs/" \
|
||||||
|
"$gmp_build_dir/.libs/" \
|
||||||
|
"$mpfr_build_dir/src/.libs/" \
|
||||||
|
"$artifacts_dir" \
|
||||||
|
"$target_arch"
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -374,11 +514,11 @@ function build_gdb_with_dependencies() {
|
|||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
if [[ $# -ne 3 ]]; then
|
if [[ $# -ne 3 ]]; then
|
||||||
>&2 echo "Usage: $0 <target_arch> <build_dir>"
|
>&2 echo "Usage: $0 <target_arch> <build_dir> <src_dir>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
build_gdb_with_dependencies "$1" "$2"
|
build_gdb_with_dependencies "$1" "$2" "$3"
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
>&2 echo "Error: failed to build gdb with dependencies"
|
>&2 echo "Error: failed to build gdb with dependencies"
|
||||||
exit 1
|
exit 1
|
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
# Include utils library
|
# Include utils library
|
||||||
script_dir=$(dirname "$0")
|
script_dir=$(dirname "$0")
|
||||||
. "$script_dir/utils.sh"
|
source "$script_dir/utils.sh"
|
||||||
|
|
||||||
# List of package URLs to download
|
# List of package URLs to download
|
||||||
PACKAGE_URLS=(
|
SOURCE_URLS=(
|
||||||
"https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz"
|
"https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz"
|
||||||
"https://ftp.gnu.org/pub/gnu/gmp/gmp-6.3.0.tar.xz"
|
"https://ftp.gnu.org/pub/gnu/gmp/gmp-6.3.0.tar.xz"
|
||||||
"https://ftp.gnu.org/pub/gnu/mpfr/mpfr-4.2.1.tar.xz"
|
"https://ftp.gnu.org/pub/gnu/mpfr/mpfr-4.2.1.tar.xz"
|
||||||
"https://ftp.gnu.org/gnu/gdb/gdb-15.2.tar.xz"
|
"https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.5.tar.gz"
|
||||||
)
|
)
|
||||||
|
|
||||||
function unpack_tarball() {
|
function unpack_tarball() {
|
||||||
@ -187,7 +187,7 @@ function download_gdb_packages() {
|
|||||||
|
|
||||||
fancy_title "Starting download of GDB packages"
|
fancy_title "Starting download of GDB packages"
|
||||||
|
|
||||||
for url in "${PACKAGE_URLS[@]}"; do
|
for url in "${SOURCE_URLS[@]}"; do
|
||||||
package_dir=$(package_url_to_dir "$url")
|
package_dir=$(package_url_to_dir "$url")
|
||||||
download_and_extract_package "$url" "$package_dir" &
|
download_and_extract_package "$url" "$package_dir" &
|
||||||
download_pids+=($!)
|
download_pids+=($!)
|
||||||
@ -202,7 +202,6 @@ function download_gdb_packages() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
fancy_title "Finished downloading GDB packages"
|
fancy_title "Finished downloading GDB packages"
|
||||||
|
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
@ -1,70 +0,0 @@
|
|||||||
diff --git a/Makefile.in b/Makefile.in
|
|
||||||
index f12c251f9c8..eed512b2d18 100644
|
|
||||||
--- a/Makefile.in
|
|
||||||
+++ b/Makefile.in
|
|
||||||
@@ -31593,7 +31593,7 @@ configure-readline:
|
|
||||||
$$s/$$module_srcdir/configure \
|
|
||||||
--srcdir=$${topdir}/$$module_srcdir \
|
|
||||||
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
|
|
||||||
- --target=${target_alias} \
|
|
||||||
+ --target=${target_alias} --enable-static \
|
|
||||||
|| exit 1
|
|
||||||
@endif readline
|
|
||||||
|
|
||||||
@@ -40793,7 +40793,7 @@ configure-libcc1:
|
|
||||||
$$s/$$module_srcdir/configure \
|
|
||||||
--srcdir=$${topdir}/$$module_srcdir \
|
|
||||||
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
|
|
||||||
- --target=${target_alias} --enable-shared \
|
|
||||||
+ --target=${target_alias} --enable-static --disable-shared \
|
|
||||||
|| exit 1
|
|
||||||
@endif libcc1
|
|
||||||
|
|
||||||
diff --git a/configure b/configure
|
|
||||||
index 6466b97f3ec..2ab23dcb81e 100755
|
|
||||||
--- a/configure
|
|
||||||
+++ b/configure
|
|
||||||
@@ -9398,7 +9398,7 @@ case " $configdirs " in
|
|
||||||
*" lto-plugin "* | *" libcc1 "* | *" gdbserver "*)
|
|
||||||
# When these are to be built as shared libraries, the same applies to
|
|
||||||
# libiberty.
|
|
||||||
- extra_host_libiberty_configure_flags=--enable-shared
|
|
||||||
+ extra_host_libiberty_configure_flags="--enable-static --disable-shared"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
|
|
||||||
index 84bc54b303e..c81269ced78 100644
|
|
||||||
--- a/gdb/Makefile.in
|
|
||||||
+++ b/gdb/Makefile.in
|
|
||||||
@@ -148,7 +148,7 @@ LIBTOOL = @LIBTOOL@
|
|
||||||
# Set this up with gcc if you have gnu ld and the loader will print out
|
|
||||||
# line numbers for undefined references.
|
|
||||||
#CC_LD = g++ -static
|
|
||||||
-CC_LD = $(LIBTOOL) $(SILENT_FLAG) --mode=link $(CXX) $(CXX_DIALECT)
|
|
||||||
+CC_LD = $(LIBTOOL) $(SILENT_FLAG) --mode=link $(CXX) -all-static $(CXX_DIALECT)
|
|
||||||
|
|
||||||
# Where is our "include" directory? Typically $(srcdir)/../include.
|
|
||||||
# This is essentially the header file directory for the library
|
|
||||||
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
|
|
||||||
index 6148ccf9121..2a9c9720d1a 100644
|
|
||||||
--- a/gdbserver/Makefile.in
|
|
||||||
+++ b/gdbserver/Makefile.in
|
|
||||||
@@ -83,7 +83,7 @@ COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(INCLUDE_SERVER_H) \
|
|
||||||
# Set this up with gcc if you have gnu ld and the loader will print out
|
|
||||||
# line numbers for undefinded refs.
|
|
||||||
#CC_LD = g++ -static
|
|
||||||
-CC_LD = $(CXX) $(CXX_DIALECT)
|
|
||||||
+CC_LD = $(CXX) -static $(CXX_DIALECT)
|
|
||||||
|
|
||||||
# Where is the "include" directory? Traditionally ../include or ./include
|
|
||||||
INCLUDE_DIR = ${srcdir}/../include
|
|
||||||
@@ -405,7 +405,7 @@ IPA_LIB = libinproctrace.so
|
|
||||||
|
|
||||||
$(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
|
|
||||||
$(SILENCE) rm -f $(IPA_LIB)
|
|
||||||
- $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
|
|
||||||
+ $(ECHO_CXXLD) $(CC_LD) -static -fPIC -Wl,--soname=$(IPA_LIB) \
|
|
||||||
-Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
|
|
||||||
$(CXXFLAGS) \
|
|
||||||
-o $(IPA_LIB) ${IPA_OBJS} $(LIBIBERTY_FOR_SHLIB) -ldl -pthread
|
|
@ -1,57 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Include utils library
|
|
||||||
script_dir=$(dirname "$0")
|
|
||||||
. "$script_dir/utils.sh"
|
|
||||||
|
|
||||||
function apply_patch() {
|
|
||||||
# Apply a patch to a directory.
|
|
||||||
#
|
|
||||||
# Parameters:
|
|
||||||
# $1: directory
|
|
||||||
# $2: path of patch
|
|
||||||
#
|
|
||||||
# Returns:
|
|
||||||
# 0: success
|
|
||||||
# 1: failure
|
|
||||||
|
|
||||||
local dir="$1"
|
|
||||||
local patch="$(realpath "$2")"
|
|
||||||
|
|
||||||
pushd "$dir" > /dev/null
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if the patch was already applied
|
|
||||||
if ! patch -p1 --dry-run < "$patch" &>/dev/null; then
|
|
||||||
>&2 echo "Error: patch already applied"
|
|
||||||
popd > /dev/null
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
patch -p1 < "$patch"
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
popd > /dev/null
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
popd > /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
function main() {
|
|
||||||
if [[ $# -ne 2 ]]; then
|
|
||||||
>&2 echo "Usage: $0 <gdb_dir> <gdb_patch>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
fancy_title "Applying GDB patch"
|
|
||||||
apply_patch "$1" "$2"
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
>&2 echo "Error: failed to apply GDB patch"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fancy_title "Finished applying GDB patch"
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
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