From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Kevin Buettner Date: Wed, 24 Feb 2021 13:19:08 -0700 Subject: gdb-rhbz1932645-aarch64-ptrace-header-order.patch ;; [aarch64] Backport fix for aarch64-linux-hw-point.c build problem ;; (RH BZ 1932645). Fix aarch64-linux-hw-point.c build problem Due to a recent glibc header file change, the file nat/aarch64-linux-hw-point.c no longer builds on Fedora rawhide. An enum for PTRACE_SYSEMU is now provided by . In the past, PTRACE_SYSEMU was defined only in . This is what it looks like... In : #define PTRACE_SYSEMU 31 In : enum __ptrace_request { ... PTRACE_SYSEMU = 31, #define PT_SYSEMU PTRACE_SYSEMU ... } When and are both included in a source file, we run into the following build problem when the former is included before the latter: In file included from nat/aarch64-linux-hw-point.c:26: /usr/include/sys/ptrace.h:86:3: error: expected identifier before numeric constant 86 | PTRACE_SYSEMU = 31, | ^~~~~~~~~~~~~ (There are more errors after this one too.) The file builds without error when is included after . I found that this is already done in nat/aarch64-sve-linux-ptrace.h (which is included by nat/aarch64-linux-ptrace.c). I've tested this change on Fedora rawhide and Fedora 33, both running on an aarch64 machine. gdb/ChangeLog: * nat/aarch64-linux-hw-point.c: Include after . diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c --- a/gdb/nat/aarch64-linux-hw-point.c +++ b/gdb/nat/aarch64-linux-hw-point.c @@ -23,8 +23,8 @@ #include "aarch64-linux-hw-point.h" #include -#include #include +#include #include /* Number of hardware breakpoints/watchpoints the target supports.