Thanks.

Approved-By: Luis Machado <luis.machado.foss@gmail.com>

On Wed, Mar 4, 2026, 01:14 Thiago Jung Bauermann <thiago.bauermann@linaro.org> wrote:
Thiago Jung Bauermann <thiago.bauermann@linaro.org> writes:

> GDB conditionally defines HWCAP2_FPMR in gdb/arch/aarch64.h, but that's
> not the best place for it since it's a Linux-specific definition.
>
> Add new Linux- and feature-specific headers to contain it, one for
> target-dependent code and the other for native code.
>
> The target-dependant code should use AARCH64_HWCAP2_FPRM in
> gdb/arch/aarch64-pauth-linux.h while native code should use HWCAP2_FPRM,
> which will hopefully be defined by the system headers but with a backup
> definition in gdb/nat/aarch64-pauth-linux.h if it isn't.
>
> Suggested-by: Luis <luis.machado.foss@gmail.com>
> Suggested-by: Simon Marchi <simark@simark.ca>

Fixed locally these typos and pastos pointed out by Simon in the commit
message:

- s/HWCAP2_FPRM/HWCAP2_FPMR/g
- aarch64-pauth-linux.h → aarch64-fpmr-linux.h

> diff --git a/gdb/nat/aarch64-fpmr-linux.h b/gdb/nat/aarch64-fpmr-linux.h
> new file mode 100644
> index 000000000000..bb0243a89396
> --- /dev/null
> +++ b/gdb/nat/aarch64-fpmr-linux.h
> @@ -0,0 +1,28 @@
> +/* Common Linux native definitions for AArch64 FPMR.
> +
> +   Copyright (C) 2025-2026 Free Software Foundation, Inc.
> +
> +   This file is part of GDB.
> +
> +   This program is free software; you can redistribute it and/or modify
> +   it under the terms of the GNU General Public License as published by
> +   the Free Software Foundation; either version 3 of the License, or
> +   (at your option) any later version.
> +
> +   This program is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +   GNU General Public License for more details.
> +
> +   You should have received a copy of the GNU General Public License
> +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> +
> +#ifndef GDB_NAT_AARCH64_FPMR_LINUX_H
> +#define GDB_NAT_AARCH64_FPMR_LINUX_H
> +
> +/* Feature check for Floating Point Mode Register.  */
> +#ifndef HWCAP2_FPMR
> +#define HWCAP2_FPMR (1ULL << 48)
> +#endif /* HWCAP2_FPMR */
> +
> +#endif /* GDB_NAT_AARCH64_FPMR_LINUX_H */

As with the previous patch, I locally amended this one to also include
<asm/hwcap.h>:

diff --git a/gdb/nat/aarch64-fpmr-linux.h b/gdb/nat/aarch64-fpmr-linux.h
index bb0243a89396..9ed651d95059 100644
--- a/gdb/nat/aarch64-fpmr-linux.h
+++ b/gdb/nat/aarch64-fpmr-linux.h
@@ -20,6 +20,8 @@
 #ifndef GDB_NAT_AARCH64_FPMR_LINUX_H
 #define GDB_NAT_AARCH64_FPMR_LINUX_H

+#include <asm/hwcap.h>
+
 /* Feature check for Floating Point Mode Register.  */
 #ifndef HWCAP2_FPMR
 #define HWCAP2_FPMR (1ULL << 48)

--
Thiago