summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/debug/gdb.in9
-rw-r--r--scripts/build/debug/gdb.sh9
2 files changed, 18 insertions, 0 deletions
diff --git a/config/debug/gdb.in b/config/debug/gdb.in
index a94e813..fc294d3 100644
--- a/config/debug/gdb.in
+++ b/config/debug/gdb.in
@@ -16,6 +16,15 @@ config GDB_CROSS
help
Build and install a cross-gdb for the target, and to run on host.
+config GDB_CROSS_STATIC_GDB
+ bool
+ prompt "Build a static cross gdb"
+ default n
+ depends on GDB_CROSS
+ help
+ A static cross gdb can be usefull if you debug on a machine that is
+ not the one that is used to compile.
+
config GDB_CROSS_STATIC_GDBSERVER
bool
prompt "Build a static gdbserver"
diff --git a/scripts/build/debug/gdb.sh b/scripts/build/debug/gdb.sh
index 14873a3..7140a0f 100644
--- a/scripts/build/debug/gdb.sh
+++ b/scripts/build/debug/gdb.sh
@@ -42,6 +42,15 @@ do_debug_gdb_build() {
mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
cd "${CT_BUILD_DIR}/build-gdb-cross"
+ CC_for_gdb=
+ LD_for_gdb=
+ if [ "${CT_GDB_CROSS_STATIC_GDBSERVER}" = "y" ]; then
+ CC_for_gdb="gcc -static"
+ LD_for_gdb="ld -static"
+ fi
+
+ CC="${CC_for_gdb}" \
+ LD="${LD_forgdb}" \
"${gdb_src_dir}/configure" \
--build=${CT_BUILD} \
--host=${CT_HOST} \