[Bug build/27536] aarch64-linux-hw-point.c fails to compile after updating to glibc-2.33

cvs-commit at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Sat Mar 6 17:58:39 GMT 2021


https://sourceware.org/bugzilla/show_bug.cgi?id=27536

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-10-branch branch has been updated by Kevin Buettner
<kevinb@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4cacb6939378ef824b37140886e7ea31c33f14c3

commit 4cacb6939378ef824b37140886e7ea31c33f14c3
Author: Kevin Buettner <kevinb@redhat.com>
Date:   Wed Feb 24 11:48:04 2021 -0700

    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 <sys/ptrace.h>.  In the
    past, PTRACE_SYSEMU was defined only in <asm/ptrace.h>.  This is
    what it looks like...

    In <asm/ptrace.h>:

     #define PTRACE_SYSEMU            31

    In <sys/ptrace.h>:

    enum __ptrace_request
    {
      ...
      PTRACE_SYSEMU = 31,
     #define PT_SYSEMU PTRACE_SYSEMU

      ...
    }

    When <asm/ptrace.h> and <sys/ptrace.h> 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 <asm/ptrace.h> is included after
    <sys/ptrace.h>.  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:

            PR build/27536
            * nat/aarch64-linux-hw-point.c: Include <asm/ptrace.h> after
            <sys/ptrace.h>.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list