gdb: actually disable gdbserver if BR2_PACKAGE_GDB_SERVER is unset

Message ID 20180515133442.16607-1-anssi.hannula@bitwise.fi
State Accepted
Headers show
Series
  • gdb: actually disable gdbserver if BR2_PACKAGE_GDB_SERVER is unset
Related show

Commit Message

Anssi Hannula May 15, 2018, 1:34 p.m.
The gdb configure script is given --enable-gdbserver when
BR2_PACKAGE_GDB_SERVER is set, but it is not given --disable-gdbserver
when BR2_PACKAGE_GDB_SERVER is unset.

gdb gdb/configure.ac defaults to enabling gdbserver in "native"
(host=target) cases, which is always the case when buildroot builds a
gdb which runs on the target hardware. The gdbserver will overwrite
BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY gdbserver, if any.

Fix that by passing --disable-gdbserver when BR2_PACKAGE_GDB_SERVER is
unset.

Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
---
 package/gdb/gdb.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Petazzoni May 19, 2018, 12:17 p.m. | #1
Hello,

On Tue, 15 May 2018 16:34:42 +0300, Anssi Hannula wrote:
> The gdb configure script is given --enable-gdbserver when
> BR2_PACKAGE_GDB_SERVER is set, but it is not given --disable-gdbserver
> when BR2_PACKAGE_GDB_SERVER is unset.
> 
> gdb gdb/configure.ac defaults to enabling gdbserver in "native"
> (host=target) cases, which is always the case when buildroot builds a
> gdb which runs on the target hardware. The gdbserver will overwrite
> BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY gdbserver, if any.
> 
> Fix that by passing --disable-gdbserver when BR2_PACKAGE_GDB_SERVER is
> unset.
> 
> Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
> ---
>  package/gdb/gdb.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Good catch. Applied to master. Thanks!

Thomas
Peter Korsgaard June 11, 2018, 9:11 p.m. | #2
>>>>> "Anssi" == Anssi Hannula <anssi.hannula@bitwise.fi> writes:

 > The gdb configure script is given --enable-gdbserver when
 > BR2_PACKAGE_GDB_SERVER is set, but it is not given --disable-gdbserver
 > when BR2_PACKAGE_GDB_SERVER is unset.

 > gdb gdb/configure.ac defaults to enabling gdbserver in "native"
 > (host=target) cases, which is always the case when buildroot builds a
 > gdb which runs on the target hardware. The gdbserver will overwrite
 > BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY gdbserver, if any.

 > Fix that by passing --disable-gdbserver when BR2_PACKAGE_GDB_SERVER is
 > unset.

 > Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>

Committed to 2018.02.x, thanks.

Patch

diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index b69193af51..b2e07602f3 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -109,7 +109,7 @@  GDB_CONF_OPTS = \
 	--without-x \
 	--disable-sim \
 	$(GDB_DISABLE_BINUTILS_CONF_OPTS) \
-	$(if $(BR2_PACKAGE_GDB_SERVER),--enable-gdbserver) \
+	$(if $(BR2_PACKAGE_GDB_SERVER),--enable-gdbserver,--disable-gdbserver) \
 	--with-curses \
 	--without-included-gettext \
 	--disable-werror \