Re: [PATCH v4 0/6] GDB: aarch64-linux: Some header fixes

Simon Marchi
2026-03-03T16:15:50Z

On 2026-03-03 00:06, Thiago Jung Bauermann wrote:
> v4 adds two new patches, reorganizing MTE and SME definitions.
>
> With this series, I think the AArch64 definitions are correctly organized
> between the headers in gdb/arch/ and gdb/nat/.
>
> if the series is approved I will propose a version of the last patch for
> the GDB 17 branch which doesn't depend on the previous patches, so that the
> build failure on aarch64-linux-musl can be fixed with minimal changes.
>
> I didn't include Luis' Approved-by to patches, since they have some changes
> in them.
>
> I also build-tested this version on aarch64-freebsd14.3 in addition to
> aarch64-linux-gnu and aarch64-linux-musl.
>
> Previous versions of the patches:
>
> v1: https://inbox.sourceware.org/gdb-patches/20260211045853.1436881-1-thiago.bauermann@linaro.org/
> v2: https://inbox.sourceware.org/gdb-patches/20260214045504.361392-1-thiago.bauermann@linaro.org/
> v3: https://inbox.sourceware.org/gdb-patches/20260217060106.1906312-1-thiago.bauermann@linaro.org/

I skimmed the code and read the commit messages, it looks good to me,
but I will leave Luis give the approval. Thanks for the cleanup, I
think things are organized in a systematic and predictable way now.

Here are some things that copilot had to say, I checked and they seemed
true:

- gdb/nat/aarch64-pauth-linux.h: HWCAP_PACA is defined unconditionally,
unlike every other HWCAP fallback in the series (HWCAP2_MTE,
HWCAP2_FPMR, HWCAP2_SME, HWCAP_GCS) which all use #ifndef guards. On
any modern aarch64 Linux system HWCAP_PACA is already defined by
<asm/hwcap.h>, so including this header after any header that pulls
it in will cause a redefinition error. Wrap it in #ifndef HWCAP_PACA
/ #endif.

(Simon: not sure it will necessarily be a error, I think it's possible to
redefine macros if they have exactly the same value, but still it
would be good to add the #ifndef.)

- FPMR: the commit message appears to be a copy-paste of the pauth one
that wasn't updated — it references AARCH64_HWCAP2_FPRM, HWCAP2_FPRM,
and gdb/arch/aarch64-pauth-linux.h / gdb/nat/aarch64-pauth-linux.h,
when all four should refer to the FPMR variants.

(Simon: notice the FPRM -> FPMR typos in there)

- GCS: the commit message says "create
gdb/nat/aarch64-gcs-linux-ptrace.h" but the file actually created is
gdb/nat/aarch64-gcs-linux.h.

Simon