[Buildroot] [PATCHv2] package/zfs: Fix cross-platform-compilations

Arnout Vandecappelle arnout at mind.be
Sat Aug 28 11:27:48 UTC 2021



On 27/08/2021 23:27, Romain Naour wrote:
> Hello Yann,
> 
> Le 27/08/2021 à 22:48, Yann E. MORIN a écrit :
>> Romain, José, All,
>>
>> On 2021-08-27 11:17 +0200, Romain Naour spake thusly:
>>> From: José Luis Salvador Rufo <salvador.joseluis at gmail.com>
>>>
>>> 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
>>>
>>> Fixes:
>>> https://gitlab.com/kubu93/buildroot/-/jobs/1522848483
>>>
>>> Signed-off-by: José Luis Salvador Rufo <salvador.joseluis at gmail.com>
>>> Signed-off-by: Romain Naour <romain.naour at gmail.com>
>>> ---
>>> v2: add a patch to remove DESTDIR used with INSTALL_MOD_PATH
>>>     Use LINUX_MAKE_FLAGS for ZFS_MAKE_ENV and ZFS_CONF_ENV
>>>     http://lists.busybox.net/pipermail/buildroot/2021-August/621350.html
>> I've only had a cursory look at the previous discussion, sorry...
>>
>> However, I believe this is incorrect to pass $(LINUX_MAKE_FLAGS) in the
>> environment for configure and make.
>>
>> Indeed, $(LINUX_MAKE_FLAGS) should really only be used when actually
>> building kernel modules, not userland stuff, because it contains
>> variables that are not valid otherwise.
>>
>> For example, it overrides HOSTCC with a value that is not correct
>> outside of bulding the kernel. It also conditionally contains the
>> unscoped variable LOADADDR, which name is too generic.
>>
>> Also, I don't understand why we need these at configure time, because we
>> are using the kernel-module infra to build the kernel module... And
>> basically, the two are mostly mutually exclusive...
> The configure script is trying to build a kernel module to check if its able to
> build zfs modules. Without LINUX_MAKE_FLAGS, it try to build the module for the
> host machine that fail to build with old compiler/distribution.
> 
> I haven't looked deeply to the buildsystem...

 I took a quick look. I think you can set KERNEL_MAKE in the environment
(ZFS_CONF_ENV) and use the linux flags there:

ZFS_CONF_ENV += KERNEL_MAKE="$(LINUX_MAKE_FLAGS)"

 When doing that, the linux flags shouldn't be passed to make at all any more
either.

 Untested, obviously :-)

 Regards,
 Arnout



More information about the buildroot mailing list