Re: Problems building gdbserver in binutils 2.46

Jan Beulich via Gdb <[email protected]> Mon, 9 Feb 2026 08:45:44 +0100
Newsgroups gmane.comp.gdb.devel,gmane.comp.gnu.binutils
Message-ID <[email protected]>
On 08.02.2026 16:34, Tom Kacvinsky wrote:
> 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

Doesn't this point at a (long-standing) regression in how branching is done?
Up to 2.24 gdb*/ weren't part of the branches, hence such an issue couldn't
arise.

I assume you would observe the same when building on the master branch; there
the issue wants dealing with on the gdb side then; Cc-ing the correct list.

Jan

> 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
>