public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Schier <nsc@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Masahiro Yamada" <masahiroy@kernel.org>
Subject: Re: [PATCH 2/2] kbuild: userprogs: also inherit byte order and ABI from kernel
Date: Sun, 7 Sep 2025 07:24:07 +0200	[thread overview]
Message-ID: <aL0W9xvpktaLE9m2@levanger> (raw)
In-Reply-To: <20250903223131.GA2264021@ax162>

On Wed, Sep 03, 2025 at 03:31:31PM -0700, Nathan Chancellor wrote:
> On Mon, Sep 01, 2025 at 11:51:03AM +0200, Thomas Weißschuh wrote:
> > Exactly. The normal cases can be handled generically. For example the kconfig
> > below works for architectures which only differ in byte order and 32bit/64bit,
> > which are most of them. MIPS should require more logic.
> > Also I'm ignoring x32, as it is never the kernel's native ABI.
> > 
> >  config CC_CAN_LINK
> >         bool
> > +       default $(cc_can_link_user,$(m64-flag) -mlittle-endian) if 64BIT && CPU_LITTLE_ENDIAN
> > +       default $(cc_can_link_user,$(m64-flag) -mbig-endian) if 64BIT && CPU_BIG_ENDIAN
> >         default $(cc_can_link_user,$(m64-flag)) if 64BIT
> > +       default $(cc_can_link_user,$(m32-flag) -mlittle-endian) if CPU_LITTLE_ENDIAN
> > +       default $(cc_can_link_user,$(m32-flag) -mbig-endian) if CPU_BIG_ENDIAN
> >         default $(cc_can_link_user,$(m32-flag))
> > 
> > 
> > > Feels like that could get complicated quickly but this would probably be
> > > the objectively most robust and "hands off" option.
> > 
> > Agreed.
> 
> Nicolas might feel differently but this does not seem terrible to me,
> especially with a macro to wrap the common logic, which is where I felt
> like things could get unwieldy. Feel free to send an RFC if it is not
> too much work.

yes, at a first glance this looks ok to me, too.

Thanks,
Nicolas

  reply	other threads:[~2025-09-07 15:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13  5:43 [PATCH 0/2] kbuild: userprogs: also inherit byte order and ABI from kernel Thomas Weißschuh
2025-08-13  5:43 ` [PATCH 1/2] kbuild: userprogs: avoid duplication of flags inherited " Thomas Weißschuh
2025-08-13  5:43 ` [PATCH 2/2] kbuild: userprogs: also inherit byte order and ABI " Thomas Weißschuh
2025-08-27  6:31   ` Thomas Weißschuh
2025-08-27 22:49     ` Nathan Chancellor
2025-09-01  9:51       ` Thomas Weißschuh
2025-09-03 22:31         ` Nathan Chancellor
2025-09-07  5:24           ` Nicolas Schier [this message]
2025-09-09  5:50             ` Thomas Weißschuh
2025-10-02 13:23           ` Thomas Weißschuh
2025-10-04 19:17             ` Nicolas Schier
2025-10-06 19:13             ` Nathan Chancellor
2025-08-14 18:46 ` [PATCH 0/2] " Nathan Chancellor
2025-08-15  5:57   ` Thomas Weißschuh
2025-08-15 21:16 ` Nathan Chancellor

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=aL0W9xvpktaLE9m2@levanger \
    --to=nsc@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    /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