Problems building gdbserver in binutils 2.46

Tom Kacvinsky tkacvins@gmail.com
Sun Feb 8 15:34:08 GMT 2026


Hi,

Using CentOS 70 - which has glibc 2.17 and kernel 3.10.0 - and using the
tool chains

  GCC 12.1.0
  binutils 2.39
libtool 2.47

and then building binutil 2.46 from source without specifying
--disable-gdbserver, I got this build error

CXX    nat/x86-linux.o

In file included from
../../binutils-gdb/gdbserver/../gdb/nat/x86-linux.c:22:

../../binutils-gdb/gdbserver/../gdb/nat/x86-linux.c: In function ‘bool
i386_ptrace_get_tls_data(int, gdb::array_view<user_desc>)’:

../../binutils-gdb/gdbserver/../gdb/nat/x86-linux.c:207:19: error:
‘PTRACE_GET_THREAD_AREA’ was not declared in this scope

  207 |       if (ptrace (PTRACE_GET_THREAD_AREA, pid, addr, data) < 0)

      |                   ^~~~~~~~~~~~~~~~~~~~~~

../../binutils-gdb/gdbserver/../gdb/nat/gdb_ptrace.h:142:37: note: in
definition of macro ‘ptrace’

  142 |          ptrace ((PTRACE_TYPE_ARG1) request, pid, addr, data)

      |                                     ^~~~~~~

../../binutils-gdb/gdbserver/../gdb/nat/x86-linux.c: In function ‘bool
i386_ptrace_set_tls_data(int, gdb::array_view<user_desc>)’:

../../binutils-gdb/gdbserver/../gdb/nat/x86-linux.c:226:19: error:
‘PTRACE_SET_THREAD_AREA’ was not declared in this scope

  226 |       if (ptrace (PTRACE_SET_THREAD_AREA, pid, addr, data) < 0)

      |                   ^~~~~~~~~~~~~~~~~~~~~~

../../binutils-gdb/gdbserver/../gdb/nat/gdb_ptrace.h:142:37: note: in
definition of macro ‘ptrace’

  142 |          ptrace ((PTRACE_TYPE_ARG1) request, pid, addr, data)


I know this is an EOL Linux distribution, but for the moment that is
what I need to build our product.  From what research I have done,
PTRACE_GET_THREAD_AREA and PTRACE_TYPE_ARG1 are only available in newer
versions of glibc.

Any ideas how to fix this so one doesn't have to specify
--disable-gdbserver? I am worried that future builds of gdb from the
binutils-gdb repo will no longer build on CentOS 7.

Thanks,

Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20260208/4a9c9af1/attachment.htm>


More information about the Binutils mailing list