Saturday, September 07, 2019

Remove incorrect gdb option

This patch removes a useless line from the gdb Makefile. Contrary to
appearances, it does not remove support for GDB multiarch, since that
support does not exist.

To see that gdb does not currently support multiarch, run it on an
amd64 system and type "set architecture". You will see:

(gdb) set architecture
Requires an argument. Valid arguments are i386, i386:x86-64, i8086,
i386:x86-64:intel, i386:intel, auto.

Multiarch isn't enabled because the correct flag is the plural
"--enable-targets=all". But adding the missing "s" still doesn't fix
it. I believe but cannot prove that gdb multiarch only works if you
compile binutils with the same flag; I can't find this dependency
documented anywhere explicitly and it's hard to test because OpenBSD
uses heavily-customized binutils.

The history of the erroneous flag can be seen in the version history
for gdb's Makefile, around revision 1.6:

http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/devel/gdb/Makefile#rev1.6

Briefly explained, gdb was removed from ports in 2004 and re-added in
2011 with the erroneous --enable-target=all flag present; that flag
hasn't been modified since.

Of note is that multiarch support makes gdb substantially larger; the
Debian team looked at this in 2011 and got nervous about it:

https://lists.debian.org/debian-embedded/2011/01/msg00011.html

Regards,
Anthony Coulter

Index: devel/gdb/Makefile
===================================================================
RCS file: /usr/cvsrepo/ports/devel/gdb/Makefile,v
retrieving revision 1.61
diff -u -p -u -p -r1.61 Makefile
--- devel/gdb/Makefile 16 Jul 2019 21:29:41 -0000 1.61
+++ devel/gdb/Makefile 7 Sep 2019 14:09:59 -0000
@@ -29,7 +29,6 @@ CONFIGURE_ARGS= --program-prefix=e \
--disable-nls \
--without-guile \
--without-lzma \
- --enable-target=all \
--with-python=${MODPY_BIN}

USE_GMAKE= Yes

No comments:

Post a Comment