Skip to content

Commit

Permalink
gdb: Explicitly point to target's libgmp for native build
Browse files Browse the repository at this point in the history
Starting from GDB 11.x, gmp is needed as a dependency to build full gdb.
And by default build system of native GDB will try to link with libgmp
of the build host. And to make sure that doesn't happen we need to
specify location of the target's sysroot so that library search starts
from there. Which we do in that change.

Fixes [1] & [1].

[1] crosstool-ng#2084
[2] crosstool-ng#1656

Signed-off-by: Alexey Brodkin <[email protected]>
  • Loading branch information
abrodkin authored and cpackham committed Jan 29, 2024
1 parent 2c93ba7 commit 4420873
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/build/debug/300-gdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ do_debug_gdb_build()

native_extra_config+=("--program-prefix=")

# Starting from GDB 11.x, gmp is needed as a dependency to build full
# gdb. And if target GMP gets built, explicitly point to installed library,
# as otherwise host library might be attempted to be used for target binary
# linkage.
if [ "${CT_GMP_TARGET}" = "y" ]; then
native_extra_config+=("--with-libgmp-prefix=${CT_SYSROOT_DIR}")
fi

# gdbserver gets enabled by default with gdb
# since gdbserver was promoted to top-level
if [ "${CT_GDB_GDBSERVER_TOPLEVEL}" = "y" ]; then
Expand Down

0 comments on commit 4420873

Please sign in to comment.