This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] PR gdb/21070: Build fix for MIPS with musl libc
- From: "Maciej W. Rozycki" <macro at imgtec dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: Alexey Neyman <stilor at att dot net>, <gdb-patches at sourceware dot org>, Andre McCurdy <armccurdy at gmail dot com>
- Date: Mon, 23 Jan 2017 18:45:20 +0000
- Subject: Re: [PATCH] PR gdb/21070: Build fix for MIPS with musl libc
- Authentication-results: sourceware.org; auth=none
- References: <a0d26238-320e-aa4d-8f85-1fdb2ebd8863@att.net> <588621B4.50209@ericsson.com>
On Mon, 23 Jan 2017, Simon Marchi wrote:
> > This issue has been reported in crosstool-ng; the patch is from
> > OpenEmbedded. Quoting the description from the patch:
> >
> > [[[[
> > The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
> > but not by musl. Regardless of the libc, the kernel headers provide
> > <asm/sgidefs.h> which provides the same definitions, so use that
> > instead.
> > ]]]]
It's a bug in musl then, the header is a part of the MIPS/Linux user API.
OTOH <asm/sgidefs.h> is an internal kernel header and shouldn't really be
used by user software.
> I wonder what is the history about why the glibc version undoes everything the
> kernel version defines. Today they seem very similar.
See: <https://www.sourceware.org/ml/libc-alpha/2004-11/msg00034.html> and
the thread that follows for a lengthy discussion.
> However, tthere are
> some defines in the glibc on that are not in the kernel one. In particular,
> _ABIO32 is not defined by the kernel but is used by GDB:
>
> mips-linux-nat.c
> 456: if (_MIPS_SIM == _ABIO32)
>
> Does it cause a problem?
Both _MIPS_SIM and _ABIO32 (if relevant) are defined by GCC, though the
API is awkward.
Maciej