All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: linux-kernel@vger.kernel.org,
	Masahiro Yamada <masahiroy@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [RFC PATCH 2/3] tools/nolibc: add a new target "headers_all_archs" to loop over all archs
Date: Tue, 24 Jun 2025 08:20:02 +0200	[thread overview]
Message-ID: <20250624062002.GD30919@1wt.eu> (raw)
In-Reply-To: <4c48147d-aebc-4a2c-a60f-eba2e90584ed@t-8ch.de>

Hi Thomas,

On Mon, Jun 23, 2025 at 11:56:29PM +0200, Thomas Weißschuh wrote:
> On 2025-06-20 12:37:04+0200, Willy Tarreau wrote:
> > This target allows to install the nolibc headers for all supported
> > architectures at once, just like it is in the development tree. This
> > is a first step to support full multi-architecture support.
> > 
> > Signed-off-by: Willy Tarreau <w@1wt.eu>
> > ---
> >  tools/include/nolibc/Makefile | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile
> > index 9197c79b267a4..8de6ac5cec425 100644
> > --- a/tools/include/nolibc/Makefile
> > +++ b/tools/include/nolibc/Makefile
> > @@ -23,6 +23,8 @@ else
> >  Q=@
> >  endif
> >  
> > +nolibc_supported_archs := aarch64 arm loongarch m68k mips powerpc riscv s390 sparc x86
> > +
> >  nolibc_arch := $(patsubst arm64,aarch64,$(ARCH))
> >  arch_file := arch-$(nolibc_arch).h
> >  all_files := \
> > @@ -83,6 +85,7 @@ help:
> >  	@echo "  all                 call \"headers\""
> >  	@echo "  clean               clean the sysroot"
> >  	@echo "  headers             prepare a sysroot in \$${OUTPUT}sysroot"
> > +	@echo "  headers_all_archs   prepare a multi-arch sysroot in \$${OUTPUT}sysroot"
> >  	@echo "  headers_standalone  like \"headers\", and also install kernel headers"
> >  	@echo "  help                this help"
> >  	@echo ""
> > @@ -110,6 +113,13 @@ headers_standalone: headers
> >  	$(Q)$(MAKE) -C $(srctree) headers
> >  	$(Q)$(MAKE) -C $(srctree) headers_install INSTALL_HDR_PATH=$(OUTPUT)sysroot
> >  
> > +# installs headers for all archs at once.
> > +headers_all_archs:
> > +	$(Q)mkdir -p "$(OUTPUT)sysroot"
> > +	$(Q)mkdir -p "$(OUTPUT)sysroot/include"
> > +	$(Q)cp --parents $(all_files) arch.h "$(OUTPUT)sysroot/include/"
> > +	$(Q)cp $(addsuffix .h,$(addprefix arch-,$(nolibc_supported_archs))) "$(OUTPUT)sysroot/include/"
> 
> IMO we could always just install all architecture headers.
> It's not much code after all.
> If it is a problem for a user they can either just delete the
> superfluous architectures or do 'mv arch-$foo.h arch.h; rm arch-*.h'.

I wanted to do that first, then thought that maybe some would like
to only install the nolibc headers because they already have the
UAPI headers from another source (local libc, distro packages,
toolchain etc). Even for us during nolibc development, not having
to iterate through all archs to reinstall everything is a huge time
saver.

However, I had another idea that floated in my mind, which is that
given that we're only saving a few small arch-* files by not
installing all archs all the time, maybe we should replace the
"headers" target to always install nolibc headers for all archs
like above, and keep the uapi headers install separate (only one
or all). This would remove the need for the target above whose
role is a bit ambiguous. What do you think ?

Thanks!
Willy

  reply	other threads:[~2025-06-24  6:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20 10:37 [RFC PATCH 0/3] tools/nolibc: install unified multi-arch headers Willy Tarreau
2025-06-20 10:37 ` [RFC PATCH 1/3] tools/nolibc: merge i386 and x86_64 into a single x86 arch Willy Tarreau
2025-06-21  8:29   ` Thomas Weißschuh
2025-06-21  8:44     ` Willy Tarreau
2025-06-20 10:37 ` [RFC PATCH 2/3] tools/nolibc: add a new target "headers_all_archs" to loop over all archs Willy Tarreau
2025-06-23 21:56   ` Thomas Weißschuh
2025-06-24  6:20     ` Willy Tarreau [this message]
2025-06-24  7:46       ` Thomas Weißschuh
2025-06-24 10:00         ` Willy Tarreau
2025-06-20 10:37 ` [RFC PATCH 3/3] tools/nolibc: add a new "install_all_archs" target Willy Tarreau
2025-06-26 20:18   ` Thomas Weißschuh
2025-06-26 21:15     ` Arnd Bergmann
2025-06-27  3:25       ` Willy Tarreau
2025-06-27  5:58         ` Arnd Bergmann
2025-06-27  6:07           ` Willy Tarreau
2025-06-27  5:11       ` Thomas Weißschuh
2025-06-27  5:46         ` Willy Tarreau
2025-06-27  5:49           ` Willy Tarreau
2025-06-27  7:27             ` Thomas Weißschuh
2025-06-27  7:29               ` Willy Tarreau

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=20250624062002.GD30919@1wt.eu \
    --to=w@1wt.eu \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=masahiroy@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.