[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNATc8-mxNLRjLLwd6bKs9mbpo2FxhChWbJHwiGpOr_hzBg@mail.gmail.com>
Date: Sun, 8 Sep 2024 10:17:48 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: "Daniel Gomez (Samsung)" <d+samsung@...ces.com>
Cc: da.gomez@...sung.com, Nathan Chancellor <nathan@...nel.org>,
Nicolas Schier <nicolas@...sle.eu>, Lucas De Marchi <lucas.demarchi@...el.com>,
Thomas Hellström <thomas.hellstrom@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
William Hubbs <w.d.hubbs@...il.com>, Chris Brannon <chris@...-brannons.com>,
Kirk Reiser <kirk@...sers.ca>, Samuel Thibault <samuel.thibault@...-lyon.org>,
Paul Moore <paul@...l-moore.com>, Stephen Smalley <stephen.smalley.work@...il.com>,
Ondrej Mosnacek <omosnace@...hat.com>, Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Marc Zyngier <maz@...nel.org>, Oliver Upton <oliver.upton@...ux.dev>,
James Morse <james.morse@....com>, Suzuki K Poulose <suzuki.poulose@....com>,
Zenghui Yu <yuzenghui@...wei.com>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>, Nick Desaulniers <ndesaulniers@...gle.com>,
Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
Simona Vetter <simona.vetter@...ll.ch>, linux-kernel@...r.kernel.org,
linux-kbuild@...r.kernel.org, intel-xe@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, speakup@...ux-speakup.org,
selinux@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
kvmarm@...ts.linux.dev, linux-serial@...r.kernel.org, llvm@...ts.linux.dev,
Finn Behrens <me@...enk.dev>, gost.dev@...sung.com
Subject: Re: [PATCH v2 4/8] arm64: nvhe: add bee-headers support
On Sat, Sep 7, 2024 at 6:28 PM Daniel Gomez (Samsung)
<d+samsung@...ces.com> wrote:
>
> On Fri, Sep 6, 2024 at 4:03 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
> >
> > On Fri, Sep 6, 2024 at 8:01 PM Daniel Gomez via B4 Relay
> > <devnull+da.gomez.samsung.com@...nel.org> wrote:
> > >
> > > From: Daniel Gomez <da.gomez@...sung.com>
> > >
> > > endian.h header is not provided by default in macOS. Use pkg-config with
> > > the new development package 'bee-headers' [1] to find the path where the
> > > headers are installed.
> > >
> > > [1] Bee Headers Project links:
> > > https://github.com/bee-headers/headers
> > > https://github.com/bee-headers/homebrew-bee-headers
> > >
> > > It requires to install bee-headers Homebrew Tap:
> > >
> > > brew tap bee-headers/bee-headers
> > > brew install bee-headers/bee-headers/bee-headers
> > >
> > > Signed-off-by: Daniel Gomez <da.gomez@...sung.com>
> > > ---
> > > arch/arm64/kernel/pi/Makefile | 1 +
> > > arch/arm64/kernel/vdso32/Makefile | 1 +
> > > arch/arm64/kvm/hyp/nvhe/Makefile | 3 ++-
> > > 3 files changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm64/kernel/pi/Makefile b/arch/arm64/kernel/pi/Makefile
> > > index 4d11a8c29181..259c9a45fba0 100644
> > > --- a/arch/arm64/kernel/pi/Makefile
> > > +++ b/arch/arm64/kernel/pi/Makefile
> > > @@ -20,6 +20,7 @@ KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_SCS), $(KBUILD_CFLAGS))
> > > KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS))
> > >
> > > hostprogs := relacheck
> > > +HOSTCFLAGS_relacheck.o = $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null)
> > >
> > > quiet_cmd_piobjcopy = $(quiet_cmd_objcopy)
> > > cmd_piobjcopy = $(cmd_objcopy) && $(obj)/relacheck $(@) $(<)
> > > diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
> > > index 25a2cb6317f3..6cb8a04bd829 100644
> > > --- a/arch/arm64/kernel/vdso32/Makefile
> > > +++ b/arch/arm64/kernel/vdso32/Makefile
> > > @@ -107,6 +107,7 @@ VDSO_LDFLAGS += --orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL)
> > > # $(hostprogs) with $(obj)
> > > munge := ../../../arm/vdso/vdsomunge
> > > hostprogs := $(munge)
> > > +HOSTCFLAGS_$(munge).o = $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null)
> > >
> > > c-obj-vdso := note.o
> > > c-obj-vdso-gettimeofday := vgettimeofday.o
> > > diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile
> > > index b43426a493df..d20a440b6964 100644
> > > --- a/arch/arm64/kvm/hyp/nvhe/Makefile
> > > +++ b/arch/arm64/kvm/hyp/nvhe/Makefile
> > > @@ -15,7 +15,8 @@ ccflags-y += -fno-stack-protector \
> > > $(DISABLE_STACKLEAK_PLUGIN)
> > >
> > > hostprogs := gen-hyprel
> > > -HOST_EXTRACFLAGS += -I$(objtree)/include
> > > +HOST_EXTRACFLAGS += -I$(objtree)/include \
> > > + $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null)
> > >
> > > lib-objs := clear_page.o copy_page.o memcpy.o memset.o
> > > lib-objs := $(addprefix ../../../lib/, $(lib-objs))
> > >
> > > --
> > > 2.46.0
> > >
> > >
> >
> > NACK.
> >
> > Developers working on Linux distributions have no interest
> > in your homebrew setup.
> >
> > For 99% of users, pkg-config does not do anything good.
> > It is a waste of process forks.
>
> I didn't think of this, and I agree with you.
>
> >
> >
> >
> > You need to do it outside.
> >
> >
> > $ HOSTCFLAGS=$(pkg-config --cflags bee-headers) make
> >
> > or
> >
> > $ export HOSTCFLAGS=$(pkg-config --cflags bee-headers)
> > $ make
>
> Would a Makefile variable be suitable for this use case to make it
> easier in the command-line?
HOSTCFLAGS is an environment variable.
See Documentation/kbuild/kbuild.rst
HOSTCFLAGS
----------
Additional flags to be passed to $(HOSTCC) when building host programs.
If you do not want to type it every time,
add the following to ~/.profile or ~/.bashrc, etc.
export HOSTCFLAGS="$(pkg-config --cflags bee-headers) -D_UUID_T
-D__GETHOSTUUID_H"
Or, if you want to limit this HOSTCFLAGS definition
only to a specific kernel tree, you can add GNUmakefile
to wrap Makefile.
This is how people often add local setups without
typing a long command.
GNUmakefile:
export HOSTCFLAGS = $(shell pkg-config --cflags bee-headers)
-D_UUID_T -D__GETHOSTUUID_H
include Makefile
Then, you do not need to bother the upstream kernel.
> We can detect we are in a non-linux based environment and enable a
> Makefile <VAR> (e.g., NOLINUX=1) and handle the NOLINUX build case
> (with pkg-config/bee-headers) inside the Makefiles for these non-linux
> cases.
NACK.
>
> >
> >
> >
> >
> >
> > --
> > Best Regards
> > Masahiro Yamada
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists