Minimum kernel and glibc versions to build on GNU/Linux?
Gary Benson
gbenson@redhat.com
Thu Sep 27 08:43:00 GMT 2018
Simon Marchi wrote:
> On 2018-09-26 10:53, Gary Benson wrote:
> > Are there specific minimum kernel and glibc versions required to
> > build GDB or gdbserver on GNU/Linux? I'm working on a refactor
> > that's complicated by workarounds for ancient versions of both
> > (circa 2002) and I'm wondering if I can just drop the workarounds.
>
> I'd say that if something was introduced in 2002, we can safely
> assume it will be available. But it would be easier to tell if you
> specified which particular feature you would like to rely on.
Hi Simon,
I noticed there's two gdb_proc_service.h files, so I'm trying to
merge them. I have them pretty close, but I'm still working on
this difference:
#ifndef HAVE_PRGREGSET_T
-typedef gdb_gregset_t prgregset_t;
+typedef elf_gregset_t prgregset_t;
#endif
#ifndef HAVE_PRFPREGSET_T
-typedef gdb_fpregset_t prfpregset_t;
+typedef elf_fpregset_t prfpregset_t;
#endif
Now, my machine has:
/usr/include/linux/elfcore.h: typedef elf_gregset_t gregset_t;
/usr/include/linux/elfcore.h: typedef elf_fpregset_t fpregset_t;
and:
gdb/gregset.h: #define GDB_GREGSET_T gregset_t
gdb/gregset.h:#define GDB_FPREGSET_T fpregset_t
gdb/gregset.h: typedef GDB_GREGSET_T gdb_gregset_t;
gdb/gregset.h:typedef GDB_FPREGSET_T gdb_fpregset_t;
so they are actually the same types on my machine. I'm not sure how
long this equivalence has been true, or if it's true on all platforms,
but if it is I'll make them both use the same type. Except, the
workarounds complicate things. GDB has this:
/* Unfortunately glibc 2.1.3 was released with a broken prfpregset_t
type. We let configure check for this lossage, and make
appropriate typedefs here. */
#ifdef PRFPREGSET_T_BROKEN
typedef gdb_fpregset_t gdb_prfpregset_t;
#else
typedef prfpregset_t gdb_prfpregset_t;
#endif
and gdbserver has this:
/* Not all platforms bring in <linux/elf.h> via <sys/procfs.h>. If
<sys/procfs.h> wasn't enough to find elf_fpregset_t, try the kernel
headers also (but don't if we don't need to). */
#ifndef HAVE_ELF_FPREGSET_T
# ifdef HAVE_LINUX_ELF_H
# include <linux/elf.h>
# endif
#endif
I think nobody needs the GDB workaround. glibc 2.1.3 was released
2000-02-24 and superseded 2000-11-09 so this is real old, and the
workaround isn't in gdbserver, so presumably gdbserver would be
failing to build if anyone still required that workaround, unless
they're building GDB without gdbserver (is this possible?)
I'm not sure if the gdbserver-only workaround is required, maybe it is
on some non x86 platforms, but if it's valid to make gdbserver use
gregset_t and fpregset_t everywhere then the gdbserver workaround
shouldn't be needed.
Anyway, I'm still researching this. Note that the gdb_proc_service.h
files are only used on GNU/Linux, the Solaris implementation is
entirely separate, so I don't need to consider that.
Cheers,
Gary
More information about the Gdb
mailing list