Reproducible native builds of GNU GDB for Linux, macOS, and Windows. The result is a relocatable archive suitable for embedding in another application.
The source version and SHA-256 are pinned in versions.env. Builds deliberately
disable Python, Guile, source-highlight, and code signing to keep the runtime
small and deterministic. Signing and notarization belong in the downstream
product pipeline.
Each build produces artifacts/gdb_<platform>_<version>.zip. Archives have the
same layout on every host:
GDB/
COPYING
bin/gdb[.exe]
lib/ # non-system runtime libraries, when needed
share/gdb/
build-manifest.json
Supported platform names are linux, linux-arm, macosx, and win64.
The macOS archive contains a universal ARM64/x86_64 executable and universal
GMP/MPFR libraries. Building it requires an Apple Silicon worker with Rosetta.
The ARM64 slice is remote-only: upstream GDB lacks a Darwin ARM64 native backend.
The x86_64 slice retains Darwin native support. Both support all remote targets.
The version-scoped
patch in patches/ adds the missing declaration include required to compile
GDB 17.2's Darwin native source.
Linux and macOS:
./scripts/build-posix.sh linux # or linux-arm / macosxThe POSIX build expects a C/C++ toolchain, GNU make, Python 3, xz, and the GDB
development dependencies (GMP, MPFR, expat, readline, xz, and zstd). Packaging
uses patchelf on Linux and the Xcode command-line tools on macOS.
Windows builds run in MSYS2's MINGW64 environment. Dependency installation uses
https://repo.msys2.org directly, without geo-redirectors or third-party mirrors.
The build uses a workspace-local pacman configuration and preserves package
signature verification; it does not change a shared MSYS2 installation's settings.
./scripts/build-windows.ps1The PowerShell entry point locates an existing MSYS2 installation or bootstraps
a pinned, SHA-256-verified portable MSYS2 environment in the workspace. It then
installs the required MinGW packages with pacman and invokes the shared build
logic. It does not require or perform code signing.
macOS packaging adjusts library paths and signs the executable and dylibs before
creating the archives. GDB_CODESIGN_IDENTITY selects the signing identity
(default: Developer ID); the worker must already have access to that identity.
The manifest records SHA-256 hashes of the signed binaries. Consumers must copy
these files unchanged, without modifying load commands or signing them again.
XML and other auxiliary files remain unsigned resources.
The executable supports both the archive's bin/ + lib/ layout and an app's
Contents/MacOS/plugins/gdb + Contents/Frameworks/ layout. For the latter, place
share/gdb/ under Contents/Resources/gdb/ and launch with --data-directory
pointing to that directory.
Jenkinsfile defines a parameterized matrix build. Configure a Pipeline from
SCM pointing at this repository and leave the script path as Jenkinsfile.
The job only checks out this public repository, builds on the selected native
workers, verifies the resulting executable with --version and a short MI2
smoke test, and archives the platform zip.
GDB itself is licensed under GPLv3; each archive includes GDB's COPYING file.
The build orchestration in this repository is MIT licensed.