Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@gmail.com>
To: "José Luis Salvador Rufo" <salvador.joseluis@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Philippe Serbruyns <Philippe.Serbruyns@ugent.be>,
	"Yann E . MORIN" <yann.morin.1998@free.fr>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/zfs: Fix cross-platform-compilations
Date: Sun, 22 Aug 2021 23:43:47 +0200	[thread overview]
Message-ID: <cb4c98eb-2f52-1d8a-942e-550ad425e767@gmail.com> (raw)
In-Reply-To: <CAH+XeQawHERfudB2Hxd8VGpRyckSzQOCjbpGpVg=+bpskzJUsw@mail.gmail.com>

Le 22/08/2021 à 23:27, José Luis Salvador Rufo a écrit :
> Hello Romain Naour,
> 
> El dom, 22 ago 2021 a las 22:52, Romain Naour (<romain.naour@gmail.com
> <mailto:romain.naour@gmail.com>>) escribió:
> 
>     Hello José Luis,
> 
>     Le 22/08/2021 à 22:38, José Luis Salvador Rufo a écrit :
>     > Hello Romain,
>     >
>     > El dom, 22 ago 2021 a las 22:27, Romain Naour (<romain.naour@gmail.com
>     <mailto:romain.naour@gmail.com>
>     > <mailto:romain.naour@gmail.com <mailto:romain.naour@gmail.com>>>) escribió:
>     >
>     >     Hello José Luis,
>     >
>     >     Le 22/08/2021 à 22:05, José Luis Salvador Rufo a écrit :
>     >     > This patch fixes the `make` executed from the `kernel.m4` in
>     >     > cross-platform-compilations environments:
>     >     > https://github.com/openzfs/zfs/blob/zfs-2.0.5/config/kernel.m4#L588
>     <https://github.com/openzfs/zfs/blob/zfs-2.0.5/config/kernel.m4#L588>
>     >     <https://github.com/openzfs/zfs/blob/zfs-2.0.5/config/kernel.m4#L588
>     <https://github.com/openzfs/zfs/blob/zfs-2.0.5/config/kernel.m4#L588>>
>     >     >
>     >     > Signed-off-by: José Luis Salvador Rufo <salvador.joseluis@gmail.com
>     <mailto:salvador.joseluis@gmail.com>
>     >     <mailto:salvador.joseluis@gmail.com <mailto:salvador.joseluis@gmail.com>>>
>     >     > ---
>     >     > Hello all.
>     >     >
>     >     > @Romain Naour, this patch will fix the buildroot gitlab CI.
>     >
>     >     Indeed it fix the issue!
>     >
>     >     Tested-by: Romain Naour <romain.naour@gmail.com
>     <mailto:romain.naour@gmail.com> <mailto:romain.naour@gmail.com
>     <mailto:romain.naour@gmail.com>>>
>     >
>     >     >
>     >     > @Philippe Serbruyns, this patch will fix your issue with your rpi4.
>     >     >
>     >     >  package/zfs/zfs.mk <http://zfs.mk> <http://zfs.mk <http://zfs.mk>>
>     | 13 +++++++++++++
>     >     >  1 file changed, 13 insertions(+)
>     >     >
>     >     > diff --git a/package/zfs/zfs.mk <http://zfs.mk> <http://zfs.mk
>     <http://zfs.mk>> b/package/zfs/zfs.mk <http://zfs.mk>
>     >     <http://zfs.mk <http://zfs.mk>>
>     >     > index 3b1afb419a..24064cba82 100644
>     >     > --- a/package/zfs/zfs.mk <http://zfs.mk> <http://zfs.mk <http://zfs.mk>>
>     >     > +++ b/package/zfs/zfs.mk <http://zfs.mk> <http://zfs.mk <http://zfs.mk>>
>     >     > @@ -13,6 +13,19 @@ ZFS_CPE_ID_PRODUCT = openzfs
>     >     > 
>     >     >  ZFS_AUTORECONF = YES
>     >     > 
>     >     > +# cross compile environment for linux kernel module
>     >     > +ZFS_MAKE_ENV = \
>     >     > +     HOSTCC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS)" \
>     >     > +     ARCH=$(KERNEL_ARCH) \
>     >     > +     CROSS_COMPILE="$(TARGET_CROSS)" \
>     >     > +     DEPMOD=$(HOST_DIR)/sbin/depmod
>     >
>     >     You can replace all 4 lines with $(LINUX_MAKE_FLAGS) here instead.
>     >
>     > Sorry, you can not. LINUX_MAKE_FLAGS includes INSTALL_MOD_PATH, and must be
>     > empty for kernel modules. If we use LINUX_MAKE_FLAGS, the module output
>     will be
>     > TARGET_DIR/INSTALL_MOD_PATH, as you can see in pkg-generic.mk
>     <http://pkg-generic.mk>
>     > <http://pkg-generic.mk <http://pkg-generic.mk>> at line 77. I already lost
>     ~1-2h because of this :-(.
> 
>     This check allow to detect issues on a build system.
>     Other packages building an out of tree kernel module is able to use
>     LINUX_MAKE_FLAGS (except linux-fusion).
> 
>     >  
>     > The alternative to using $(LINUX_MAKE_FLAGS) is empty the INSTALL_MOD_PATH as
>     > follows:
>     > ZFS_MAKE_ENV = \
>     >      $(LINUX_MAKE_FLAGS) \
>     >      INSTALL_MOD_PATH=
>     >
>     > What do you prefer?
> 
>     If possible, a zfs patch.
> 
> Here is the "problem":
> 
> https://github.com/openzfs/zfs/blob/zfs-2.0.5/module/Makefile.in#L79
> <https://github.com/openzfs/zfs/blob/zfs-2.0.5/module/Makefile.in#L79>
>> INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH)

This is the problem. I guess you have to remove DESTDIR when used with
INSTALL_MOD_PATH.

> 
> and
> 
> https://git.buildroot.net/buildroot/tree/package/pkg-generic.mk?h=2021.08-rc2#n77 <https://git.buildroot.net/buildroot/tree/package/pkg-generic.mk?h=2021.08-rc2#n77>
>> $(if $(filter end,$(1)),$(call step_check_build_dir_one,$(3),$(TARGET_DIR)/$(O))))
> 
> Buildroot already does that, so when `make modules_install` is executed, the
> output modules directory will be TARGET_DIR/TARGET_DIR/INSTALL_MOD_PATH.
> 
> I have no idea who is the one that must change its behavior. :-(
> Any suggestions on how to proceed?
> 
> Maybe I can unexport DESTDIR before `make modules_install`...

Yes, DESTDIR is sometime miss used (see buildroot gitlog for example).

It's a bug if DESTDIR and INSTALL_MOD_PATH are used together:

https://www.gnu.org/prep/standards/html_node/DESTDIR.html

https://www.kernel.org/doc/Documentation/kbuild/modules.txt (INSTALL_MOD_PATH)

Best regards,
Romain


> 
> Attached alternative patch with LINUX_MAKE_FLAGS and empty INSTALL_MOD_PATH.
> 
> 
>     Otherwise I would suggest to add a comment about the reason why LINUX_MAKE_FLAGS
>     can't be used.
> 
>     Best regards,
>     Romain
> 
> 
>     >
>     >
>     >     > +# `./configure` will execute a `make modules` test case
>     >     > +ZFS_CONF_ENV = \
>     >     > +     HOSTCC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS)" \
>     >     > +     ARCH=$(KERNEL_ARCH) \
>     >     > +     CROSS_COMPILE="$(TARGET_CROSS)" \
>     >     > +     DEPMOD=$(HOST_DIR)/sbin/depmod
>     >
>     >     Same here.
>     >
>     >
>     >
>     >     > +
>     >     >  ZFS_DEPENDENCIES = libaio openssl udev util-linux zlib
>     >     > 
>     >     >  # sysvinit installs only a commented-out modules-load.d/ config file
>     >     >
>     >
> 
> 
> Greetings! 

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

  reply	other threads:[~2021-08-22 21:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 20:05 [Buildroot] [PATCH] package/zfs: Fix cross-platform-compilations José Luis Salvador Rufo
2021-08-22 20:27 ` Romain Naour
2021-08-22 20:38   ` José Luis Salvador Rufo
2021-08-22 20:52     ` Romain Naour
2021-08-22 21:27       ` José Luis Salvador Rufo
2021-08-22 21:43         ` Romain Naour [this message]
2021-08-22 22:54           ` José Luis Salvador Rufo
2021-08-24 21:53 ` Thomas Petazzoni
2021-09-21  7:58   ` José Luis Salvador Rufo
2021-10-25 12:31     ` [Buildroot] [PATCH] package/zfs: bump version to 2.0.6 José Luis Salvador Rufo
2021-11-14 15:23       ` Thomas Petazzoni

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=cb4c98eb-2f52-1d8a-942e-550ad425e767@gmail.com \
    --to=romain.naour@gmail.com \
    --cc=Philippe.Serbruyns@ugent.be \
    --cc=buildroot@buildroot.org \
    --cc=salvador.joseluis@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /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