public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Leo Yan <leo.yan@arm.com>
Cc: Will Deacon <will@kernel.org>, Shuah Khan <shuah@kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Thiago Jung Bauermann <thiago.bauermann@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] kselftest/arm64: Fix build failure with GCC-15
Date: Fri, 24 Apr 2026 16:51:24 +0100	[thread overview]
Message-ID: <aeuRfEeOUWEHzPix@arm.com> (raw)
In-Reply-To: <20260422-selftests_arm64_gcc15-v2-1-c0134de8838a@arm.com>

On Wed, Apr 22, 2026 at 06:42:54PM +0100, Leo Yan wrote:
> Building on Debian sid with GCC 15 fails:
> 
>     CC       libc-gcs
>   libc-gcs.c: In function 'ptrace_read_write':
>   libc-gcs.c:142:25: error: storage size of 'child_gcs' isn't known
>     142 |         struct user_gcs child_gcs;
>         |                         ^~~~~~~~~
>   libc-gcs.c:142:25: warning: unused variable 'child_gcs' [-Wunused-variable]
> 
> For GCC-15, NT_ARM_GCS is defined in the libc header, causing gcs-util.h
> to skip its fallback definition of struct user_gcs. This leads to the
> compiler error.
> 
> Fix this by including <asm/ptrace.h> to provide the proper definition.

This is not caused by GCC-15 as it doesn't provide these headers. AFAICT
on Debian we have NT_ARM_GCS coming from glibc and user_gcs from the
kernel asm/ptrace.h uapi header (linux-libc-dev). We also have
NT_ARM_GCS in linux/elf.h as part of the kernel headers.

While the kernel exposed the macro and structure in the same commit, I
don't think it is required distros to align the glibc macro with the
linux headers. Glibc does not even use the kernel's linux/elf.h for the
macros, it just adds the definitions when they turn up in a released
kernel.

So you can have a glibc that defines NT_ARM_GCS but a linux-libc-dev
package that is not up to date to include struct user_gcs.

I think a better fix is to always define struct user_gcs and only
conditionally define NT_ARM_GCS (IOW, move the #endif higher).

-- 
Catalin


  parent reply	other threads:[~2026-04-24 15:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 17:42 [PATCH v2] kselftest/arm64: Fix build failure with GCC-15 Leo Yan
2026-04-22 17:50 ` Mark Brown
2026-04-24 15:51 ` Catalin Marinas [this message]
2026-04-24 16:07   ` Mark Brown
2026-04-24 16:44     ` Catalin Marinas
2026-04-24 17:09       ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aeuRfEeOUWEHzPix@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=broonie@kernel.org \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=thiago.bauermann@linaro.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox