* [Buildroot] [PATCH v2] package/luajit: fix luvi
@ 2021-11-10 10:31 Francois Perrad
2021-11-11 20:56 ` Yann E. MORIN
0 siblings, 1 reply; 3+ messages in thread
From: Francois Perrad @ 2021-11-10 10:31 UTC (permalink / raw)
To: buildroot
luvi uses the cross bytecode generation of host-luajit
the bytecode format has 2 flavors, depending of GC64 option.
since the commit https://github.com/LuaJIT/LuaJIT/commit/bd00094c3b50e193fb32aad79b7ea8ea6b78ed25
GC64 mode is enable by default on all 64bits platform.
with this patch, luajit and host-luajit are built with the same option,
so the bytecode generated by host-luajit is valid on luajit.
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
package/luajit/luajit.mk | 2 ++
1 file changed, 2 insertions(+)
diff --git a/package/luajit/luajit.mk b/package/luajit/luajit.mk
index fbbd8ebc7..e93361ba3 100644
--- a/package/luajit/luajit.mk
+++ b/package/luajit/luajit.mk
@@ -26,8 +26,10 @@ endif
# libraries are installed.
ifeq ($(BR2_ARCH_IS_64),y)
LUAJIT_HOST_CC = $(HOSTCC)
+LUAJIT_XCFLAGS += -DLUAJIT_ENABLE_GC64
else
LUAJIT_HOST_CC = $(HOSTCC) -m32
+LUAJIT_XCFLAGS += -DLUAJIT_DISABLE_GC64
endif
# We unfortunately can't use TARGET_CONFIGURE_OPTS, because the luajit
--
2.32.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH v2] package/luajit: fix luvi
2021-11-10 10:31 [Buildroot] [PATCH v2] package/luajit: fix luvi Francois Perrad
@ 2021-11-11 20:56 ` Yann E. MORIN
2021-11-11 21:06 ` Yann E. MORIN
0 siblings, 1 reply; 3+ messages in thread
From: Yann E. MORIN @ 2021-11-11 20:56 UTC (permalink / raw)
To: Francois Perrad; +Cc: buildroot
On 2021-11-10 11:31 +0100, Francois Perrad spake thusly:
> luvi uses the cross bytecode generation of host-luajit
> the bytecode format has 2 flavors, depending of GC64 option.
>
> since the commit https://github.com/LuaJIT/LuaJIT/commit/bd00094c3b50e193fb32aad79b7ea8ea6b78ed25
> GC64 mode is enable by default on all 64bits platform.
>
> with this patch, luajit and host-luajit are built with the same option,
> so the bytecode generated by host-luajit is valid on luajit.
>
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
> package/luajit/luajit.mk | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/package/luajit/luajit.mk b/package/luajit/luajit.mk
> index fbbd8ebc7..e93361ba3 100644
> --- a/package/luajit/luajit.mk
> +++ b/package/luajit/luajit.mk
> @@ -26,8 +26,10 @@ endif
> # libraries are installed.
> ifeq ($(BR2_ARCH_IS_64),y)
> LUAJIT_HOST_CC = $(HOSTCC)
> +LUAJIT_XCFLAGS += -DLUAJIT_ENABLE_GC64
As I explained in a previous review, this is not sufficient, because we
currently still are allowed to create a configuration where the build
machine is a 32-bit system. but the target is 64-bit. This is not
supported by the luajit buildsystem, and is explictly documented.
This is partially covered but only for x86_64 where the condition in
BR2_PACKAGE_LUAJIT_ARCH_SUPPORTS conditions it to HOSTARCH=x86_64.
But for Aarch64, this is not accounted for.
However, the BR2_PACKAGE_LUAJIT_ARCH_SUPPORTS symbol is very unpleasant
to read. We usually write it in a way that is much easier to read and to
maintain; e.g. with the proper 64-bit condition added:
config BR2_PACKAGE_LUAJIT_ARCH_SUPPORTS
bool
default y if BR2_arm || BR2_armeb || BR2_aarch64
default y if BR2_i386 || BR2_x86_64
default y if BR2_powerpc
default y if (BR2_mips || BR2_mipsel) && !BR2_MIPS_SOFT_FLOAT \
&& !BR2_MIPS_CPU_MIPS32R6 && !BR2_MIPS_CPU_MIPS64R6
# -m32 flag is used for 32bit builds and host-luajit has
# limited architecture support
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
# Building for 64-bit target requires a 64-bit host
depends on !BR2_ARCH_IS_64 || BR_HOST_ARCH="x86_64"
Can you please fix that?
Regards,
Yann E. MORIN.
> else
> LUAJIT_HOST_CC = $(HOSTCC) -m32
> +LUAJIT_XCFLAGS += -DLUAJIT_DISABLE_GC64
> endif
>
> # We unfortunately can't use TARGET_CONFIGURE_OPTS, because the luajit
> --
> 2.32.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH v2] package/luajit: fix luvi
2021-11-11 20:56 ` Yann E. MORIN
@ 2021-11-11 21:06 ` Yann E. MORIN
0 siblings, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2021-11-11 21:06 UTC (permalink / raw)
To: Francois Perrad; +Cc: buildroot
François, All,
I hit "send" too fast; here's the rest of my review:
The title code should not really be about luvi, but really about laujit.
This patch is not fixing luvi; it is really fixing the build of luajit.
luvi just happens to be the one package that exposed the issue, so it is
not faire to ascribe the fault to it.
Probably something like:
package/luajit: ensure host and target are built with the same bytecode format
On 2021-11-11 21:56 +0100, Yann E. MORIN spake thusly:
> On 2021-11-10 11:31 +0100, Francois Perrad spake thusly:
> > luvi uses the cross bytecode generation of host-luajit
> > the bytecode format has 2 flavors, depending of GC64 option.
> >
> > since the commit https://github.com/LuaJIT/LuaJIT/commit/bd00094c3b50e193fb32aad79b7ea8ea6b78ed25
> > GC64 mode is enable by default on all 64bits platform.
> >
> > with this patch, luajit and host-luajit are built with the same option,
> > so the bytecode generated by host-luajit is valid on luajit.
> >
> > Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> > ---
> > package/luajit/luajit.mk | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/package/luajit/luajit.mk b/package/luajit/luajit.mk
> > index fbbd8ebc7..e93361ba3 100644
> > --- a/package/luajit/luajit.mk
> > +++ b/package/luajit/luajit.mk
> > @@ -26,8 +26,10 @@ endif
> > # libraries are installed.
> > ifeq ($(BR2_ARCH_IS_64),y)
> > LUAJIT_HOST_CC = $(HOSTCC)
> > +LUAJIT_XCFLAGS += -DLUAJIT_ENABLE_GC64
There is not such macro in the LuaJit code.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-11 21:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-10 10:31 [Buildroot] [PATCH v2] package/luajit: fix luvi Francois Perrad
2021-11-11 20:56 ` Yann E. MORIN
2021-11-11 21:06 ` Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox