Skip to content

Commit fc0a213

Browse files
committed
build: disable simulator when building with full_build_cross_arch_debugging
Since not all targets have a supported simulator, there were compilation errors. The configure file also appears to be half-broken, so we pass --disable-sim when this feature is enable to avoid compilation failiure.
1 parent 7d2999d commit fc0a213

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ To get started with `gdb-static`, simply download the build for your architectur
6464

6565
> [!NOTE]
6666
> We provide two types of builds:
67-
> 1. Full builds with Python support && cross-architecture debugging, ~70MB in size.
67+
> 1. Full builds with Python support && cross-architecture debugging, ~70MB in size. Note that we disable the simulator feature in order to enable cross-architecture debugging (since not all targets have a simulator).
6868
> 2. Slim builds, which are approximately ~10 MB in size.
6969
>
7070
> Full builds are modular - you can edit full_build_conf.sh to disable parts of the full builds.

src/compilation/build.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ function build_gdb() {
512512
# $6: liblzma prefix
513513
# $7: whether to build gdb with all extra configurations specified in src/compilation/full_build_conf.sh
514514
# $8: gdb cross-architecture binary format support formats (relevant for full builds only).
515+
# $9: the architecture we are compiling for.
515516
#
516517
# Echoes:
517518
# The gdb build directory
@@ -528,11 +529,12 @@ function build_gdb() {
528529
local liblzma_prefix="$6"
529530
local full_build="$7"
530531
local gdb_bfd_archs="$8"
532+
local target_arch="$9"
531533

532534
local extra_flags=()
533535
if [[ "$full_build" == "yes" ]]; then
534-
if [[ $full_build_supported_targets -eq 1 ]]; then
535-
extra_flags+=("--enable-targets=$gdb_bfd_archs" "--enable-64-bit-bfd")
536+
if [[ $full_build_cross_arch_debugging -eq 1 ]]; then
537+
extra_flags+=("--enable-targets=$gdb_bfd_archs" "--enable-64-bit-bfd" "--disable-sim")
536538
fi
537539

538540
if [[ $full_build_python_support -eq 1 ]]; then
@@ -660,7 +662,7 @@ function build_and_install_gdb() {
660662
local artifacts_dir="$8"
661663
local target_arch="$9"
662664

663-
gdb_build_dir="$(build_gdb "$gdb_dir" "$target_arch" "$libiconv_prefix" "$libgmp_prefix" "$libmpfr_prefix" "$liblzma_prefix" "$full_build" "$gdb_bfd_archs")"
665+
gdb_build_dir="$(build_gdb "$gdb_dir" "$target_arch" "$libiconv_prefix" "$libgmp_prefix" "$libmpfr_prefix" "$liblzma_prefix" "$full_build" "$gdb_bfd_archs" "$target_arch")"
664666
if [[ $? -ne 0 ]]; then
665667
return 1
666668
fi

src/compilation/full_build_conf.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# In order to disable a component, simply change the it to 0.
55
# This allows us to fully control the binary extensions.
66

7-
full_build_supported_targets=1
7+
full_build_cross_arch_debugging=1 # Only relevant for x86_64 & aarch64
88
full_build_python_support=1

0 commit comments

Comments
 (0)