* [Buildroot] luajit package fails to build on x86_64 for x86
@ 2014-03-06 10:43 Fabio Porcedda
2014-03-06 20:51 ` François Perrad
2014-03-06 21:31 ` Yann E. MORIN
0 siblings, 2 replies; 18+ messages in thread
From: Fabio Porcedda @ 2014-03-06 10:43 UTC (permalink / raw)
To: buildroot
Hi all,
luajit fails to build on a Ubuntu 13.10 x86_64 with the following defconfig:
BR2_x86_generic=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_PACKAGE_LUAJIT=y
with the following build error:
CC luajit.o
HOSTLINK host/minilua
/usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for
-lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
make[3]: *** [host/minilua] Error 1
make[2]: *** [amalg] Error 2
make[1]: *** [amalg] Error 2
make: *** [/e/buildroot/br-tmp/output/build/luajit-2.0.2/.stamp_built] Error 2
It builds fine for x86_64:
BR2_x86_64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_PACKAGE_LUAJIT=y
Best regards
--
Fabio Porcedda
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-06 10:43 [Buildroot] luajit package fails to build on x86_64 for x86 Fabio Porcedda
@ 2014-03-06 20:51 ` François Perrad
2014-03-07 10:19 ` Fabio Porcedda
2014-03-06 21:31 ` Yann E. MORIN
1 sibling, 1 reply; 18+ messages in thread
From: François Perrad @ 2014-03-06 20:51 UTC (permalink / raw)
To: buildroot
2014-03-06 11:43 GMT+01:00 Fabio Porcedda <fabio.porcedda@gmail.com>:
> Hi all,
> luajit fails to build on a Ubuntu 13.10 x86_64 with the following defconfig:
>
> BR2_x86_generic=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_PACKAGE_LUAJIT=y
>
>
> with the following build error:
>
> CC luajit.o
> HOSTLINK host/minilua
> /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc
> /usr/bin/ld: cannot find -lgcc
> /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for
> -lgcc_s
> /usr/bin/ld: cannot find -lgcc_s
> collect2: error: ld returned 1 exit status
> make[3]: *** [host/minilua] Error 1
> make[2]: *** [amalg] Error 2
> make[1]: *** [amalg] Error 2
> make: *** [/e/buildroot/br-tmp/output/build/luajit-2.0.2/.stamp_built] Error 2
>
>
> It builds fine for x86_64:
> BR2_x86_64=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_PACKAGE_LUAJIT=y
>
> Best regards
When Ubuntu 13.10 was released, I encoured many issues with it (but I
don't remember details and I didn't make investigations), so I stay
with 12.04 LTS. And now, I wait for 14.04 LTS.
Do you see this issue with BR-2014.02 or with the master head (the 3
lastest commits are mine) ?
Fran?ois
> --
> Fabio Porcedda
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-06 10:43 [Buildroot] luajit package fails to build on x86_64 for x86 Fabio Porcedda
2014-03-06 20:51 ` François Perrad
@ 2014-03-06 21:31 ` Yann E. MORIN
2014-03-07 9:59 ` Fabio Porcedda
1 sibling, 1 reply; 18+ messages in thread
From: Yann E. MORIN @ 2014-03-06 21:31 UTC (permalink / raw)
To: buildroot
Fabio, All,
On 2014-03-06 11:43 +0100, Fabio Porcedda spake thusly:
> Hi all,
> luajit fails to build on a Ubuntu 13.10 x86_64 with the following defconfig:
>
> BR2_x86_generic=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_PACKAGE_LUAJIT=y
>
>
> with the following build error:
>
> CC luajit.o
> HOSTLINK host/minilua
> /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc
> /usr/bin/ld: cannot find -lgcc
> /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for
> -lgcc_s
> /usr/bin/ld: cannot find -lgcc_s
> collect2: error: ld returned 1 exit status
> make[3]: *** [host/minilua] Error 1
> make[2]: *** [amalg] Error 2
> make[1]: *** [amalg] Error 2
> make: *** [/e/buildroot/br-tmp/output/build/luajit-2.0.2/.stamp_built] Error 2
Yes, that's somewhat expected.
From luajit.mk:
# The luajit build procedure requires the host compiler to have the
# same bitness as the target compiler. Therefore, on a x86 build
# machine, we can't build luajit for x86_64, which is checked in
# Config.in. When the target is a 32 bits target, we pass -m32 to
# ensure that even on 64 bits build machines, a compiler of the same
# bitness is used. Of course, this assumes that the 32 bits multilib
# libraries are installed.
I tries here, and I have a bigger problem (line continuations manually
added for readability):
HOSTCC host/minilua.o
/usr/bin/gcc -m32 -O2 -fomit-frame-pointer -Wall -I. \
-DLUAJIT_TARGET=LUAJIT_ARCH_x86 -DLJ_ARCH_HASFPU=1 \
-DLJ_ABI_SOFT FP=0 -O2 \
-I/home/ymorin/dev/buildroot/O/host/usr/include -c \
-o host/minilua.o host/minilua.c
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such
file or directory
#include <bits/predefs.h>
^
compilation terminated.
make[4]: *** [host/minilua.o] Error 1
make[3]: *** [amalg] Error 2
make[2]: *** [amalg] Error 2
make[1]: *** [/home/ymorin/dev/buildroot/O/build/luajit-2.0.2/.stamp_built] Error 2
make: *** [_all] Error 2
Command exited with non-zero status 2
And this can not work on a pure 64-bit system (aka, without the 32-bit
legacy stuff).
Note: my kernel does have 32-bit legacy support, but my system does not
have the development (-dev stuff with headers and .so symlinks) userland
installed, only the runtime. So I can actually _run_ 32-bit stuff, just
not _generate_ any...
Not sure how we can get away with this...
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-06 21:31 ` Yann E. MORIN
@ 2014-03-07 9:59 ` Fabio Porcedda
2014-03-07 17:21 ` Yann E. MORIN
0 siblings, 1 reply; 18+ messages in thread
From: Fabio Porcedda @ 2014-03-07 9:59 UTC (permalink / raw)
To: buildroot
On Thu, Mar 6, 2014 at 10:31 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> Fabio, All,
>
> On 2014-03-06 11:43 +0100, Fabio Porcedda spake thusly:
>> Hi all,
>> luajit fails to build on a Ubuntu 13.10 x86_64 with the following defconfig:
>>
>> BR2_x86_generic=y
>> BR2_TOOLCHAIN_EXTERNAL=y
>> BR2_PACKAGE_LUAJIT=y
>>
>>
>> with the following build error:
>>
>> CC luajit.o
>> HOSTLINK host/minilua
>> /usr/bin/ld: skipping incompatible
>> /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc
>> /usr/bin/ld: cannot find -lgcc
>> /usr/bin/ld: skipping incompatible
>> /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for
>> -lgcc_s
>> /usr/bin/ld: cannot find -lgcc_s
>> collect2: error: ld returned 1 exit status
>> make[3]: *** [host/minilua] Error 1
>> make[2]: *** [amalg] Error 2
>> make[1]: *** [amalg] Error 2
>> make: *** [/e/buildroot/br-tmp/output/build/luajit-2.0.2/.stamp_built] Error 2
>
> Yes, that's somewhat expected.
>
> From luajit.mk:
>
> # The luajit build procedure requires the host compiler to have the
> # same bitness as the target compiler. Therefore, on a x86 build
> # machine, we can't build luajit for x86_64, which is checked in
> # Config.in. When the target is a 32 bits target, we pass -m32 to
> # ensure that even on 64 bits build machines, a compiler of the same
> # bitness is used. Of course, this assumes that the 32 bits multilib
> # libraries are installed.
>
> I tries here, and I have a bigger problem (line continuations manually
> added for readability):
>
> HOSTCC host/minilua.o
> /usr/bin/gcc -m32 -O2 -fomit-frame-pointer -Wall -I. \
> -DLUAJIT_TARGET=LUAJIT_ARCH_x86 -DLJ_ARCH_HASFPU=1 \
> -DLJ_ABI_SOFT FP=0 -O2 \
> -I/home/ymorin/dev/buildroot/O/host/usr/include -c \
> -o host/minilua.o host/minilua.c
> In file included from <command-line>:0:0:
> /usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such
> file or directory
> #include <bits/predefs.h>
> ^
> compilation terminated.
> make[4]: *** [host/minilua.o] Error 1
> make[3]: *** [amalg] Error 2
> make[2]: *** [amalg] Error 2
> make[1]: *** [/home/ymorin/dev/buildroot/O/build/luajit-2.0.2/.stamp_built] Error 2
> make: *** [_all] Error 2
> Command exited with non-zero status 2
>
> And this can not work on a pure 64-bit system (aka, without the 32-bit
> legacy stuff).
>
> Note: my kernel does have 32-bit legacy support, but my system does not
> have the development (-dev stuff with headers and .so symlinks) userland
> installed, only the runtime. So I can actually _run_ 32-bit stuff, just
> not _generate_ any...
>
> Not sure how we can get away with this...
I think we have two choices:
- add a check to test if 32bit compiler is installed and if not print
a clear message about the toolchain requirement
- add (BR2_i386 && BR2_HOSTARCH='i386') to the config.in to exlude
such combination.
Regards
--
Fabio Porcedda
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-06 20:51 ` François Perrad
@ 2014-03-07 10:19 ` Fabio Porcedda
0 siblings, 0 replies; 18+ messages in thread
From: Fabio Porcedda @ 2014-03-07 10:19 UTC (permalink / raw)
To: buildroot
On Thu, Mar 6, 2014 at 9:51 PM, Fran?ois Perrad
<francois.perrad@gadz.org> wrote:
> 2014-03-06 11:43 GMT+01:00 Fabio Porcedda <fabio.porcedda@gmail.com>:
>> Hi all,
>> luajit fails to build on a Ubuntu 13.10 x86_64 with the following defconfig:
>>
>> BR2_x86_generic=y
>> BR2_TOOLCHAIN_EXTERNAL=y
>> BR2_PACKAGE_LUAJIT=y
>>
>>
>> with the following build error:
>>
>> CC luajit.o
>> HOSTLINK host/minilua
>> /usr/bin/ld: skipping incompatible
>> /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc
>> /usr/bin/ld: cannot find -lgcc
>> /usr/bin/ld: skipping incompatible
>> /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for
>> -lgcc_s
>> /usr/bin/ld: cannot find -lgcc_s
>> collect2: error: ld returned 1 exit status
>> make[3]: *** [host/minilua] Error 1
>> make[2]: *** [amalg] Error 2
>> make[1]: *** [amalg] Error 2
>> make: *** [/e/buildroot/br-tmp/output/build/luajit-2.0.2/.stamp_built] Error 2
>>
>>
>> It builds fine for x86_64:
>> BR2_x86_64=y
>> BR2_TOOLCHAIN_EXTERNAL=y
>> BR2_PACKAGE_LUAJIT=y
>>
>> Best regards
>
> When Ubuntu 13.10 was released, I encoured many issues with it (but I
> don't remember details and I didn't make investigations), so I stay
> with 12.04 LTS. And now, I wait for 14.04 LTS.
>
> Do you see this issue with BR-2014.02 or with the master head (the 3
> lastest commits are mine) ?
I saw the error with master and all 2013.XX and 2014.02 releases.
As explained by Yann the error is not related to Ubuntu.
Regards
--
Fabio Porcedda
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 9:59 ` Fabio Porcedda
@ 2014-03-07 17:21 ` Yann E. MORIN
2014-03-07 17:32 ` Fabio Porcedda
0 siblings, 1 reply; 18+ messages in thread
From: Yann E. MORIN @ 2014-03-07 17:21 UTC (permalink / raw)
To: buildroot
Fabio, All,
On 2014-03-07 10:59 +0100, Fabio Porcedda spake thusly:
> On Thu, Mar 6, 2014 at 10:31 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > On 2014-03-06 11:43 +0100, Fabio Porcedda spake thusly:
> >> Hi all,
> >> luajit fails to build on a Ubuntu 13.10 x86_64 with the following defconfig:
> >>
> >> BR2_x86_generic=y
> >> BR2_TOOLCHAIN_EXTERNAL=y
> >> BR2_PACKAGE_LUAJIT=y
[--SNIP--]
> > And this can not work on a pure 64-bit system (aka, without the 32-bit
> > legacy stuff).
[--SNIP--]
> > Not sure how we can get away with this...
>
> I think we have two choices:
> - add a check to test if 32bit compiler is installed and if not print
> a clear message about the toolchain requirement
I think this would be the first package to add such a check.
How would you propose we implement this:
- in a pre-configure hook (but that will catch the failure late in the
build) ?
- in a make ifeq-block (so we can catch it early in the build) ?
The second solution is more appealing to me, but might be a bit more
complex to implement.
> - add (BR2_i386 && BR2_HOSTARCH='i386') to the config.in to exlude
> such combination.
But that would prevent the combination on systems that are setup with
support for building 32-bit programs, which is a pity...
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 17:21 ` Yann E. MORIN
@ 2014-03-07 17:32 ` Fabio Porcedda
2014-03-07 17:49 ` Yann E. MORIN
0 siblings, 1 reply; 18+ messages in thread
From: Fabio Porcedda @ 2014-03-07 17:32 UTC (permalink / raw)
To: buildroot
On Fri, Mar 7, 2014 at 6:21 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> Fabio, All,
>
> On 2014-03-07 10:59 +0100, Fabio Porcedda spake thusly:
>> On Thu, Mar 6, 2014 at 10:31 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>> > On 2014-03-06 11:43 +0100, Fabio Porcedda spake thusly:
>> >> Hi all,
>> >> luajit fails to build on a Ubuntu 13.10 x86_64 with the following defconfig:
>> >>
>> >> BR2_x86_generic=y
>> >> BR2_TOOLCHAIN_EXTERNAL=y
>> >> BR2_PACKAGE_LUAJIT=y
> [--SNIP--]
>> > And this can not work on a pure 64-bit system (aka, without the 32-bit
>> > legacy stuff).
> [--SNIP--]
>> > Not sure how we can get away with this...
>>
>> I think we have two choices:
>> - add a check to test if 32bit compiler is installed and if not print
>> a clear message about the toolchain requirement
>
> I think this would be the first package to add such a check.
>
> How would you propose we implement this:
> - in a pre-configure hook (but that will catch the failure late in the
> build) ?
> - in a make ifeq-block (so we can catch it early in the build) ?
> The second solution is more appealing to me, but might be a bit more
> complex to implement.
I think a check to be added like this:
luakit.mk:
luajit-dependencies:
shell script to check and if it fails it prints an appropriate
message and stop the building
dependencies: luajit-dependencies
So the check it's done early at same time as other dependenies check.
Right now i don't know how to check about the presence of the 32bit
support on the 64 bit host toolchain.
>
>> - add (BR2_i386 && BR2_HOSTARCH='i386') to the config.in to exlude
>> such combination.
>
> But that would prevent the combination on systems that are setup with
> support for building 32-bit programs, which is a pity...
You are right, i think it's just the easiest solution.
Regards
--
Fabio Porcedda
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 17:32 ` Fabio Porcedda
@ 2014-03-07 17:49 ` Yann E. MORIN
2014-03-07 19:40 ` Thomas Petazzoni
0 siblings, 1 reply; 18+ messages in thread
From: Yann E. MORIN @ 2014-03-07 17:49 UTC (permalink / raw)
To: buildroot
Fabio, All,
On 2014-03-07 18:32 +0100, Fabio Porcedda spake thusly:
> On Fri, Mar 7, 2014 at 6:21 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > Fabio, All,
> >
> > On 2014-03-07 10:59 +0100, Fabio Porcedda spake thusly:
> >> On Thu, Mar 6, 2014 at 10:31 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> >> > On 2014-03-06 11:43 +0100, Fabio Porcedda spake thusly:
> >> >> Hi all,
> >> >> luajit fails to build on a Ubuntu 13.10 x86_64 with the following defconfig:
> >> >>
> >> >> BR2_x86_generic=y
> >> >> BR2_TOOLCHAIN_EXTERNAL=y
> >> >> BR2_PACKAGE_LUAJIT=y
> > [--SNIP--]
> >> > And this can not work on a pure 64-bit system (aka, without the 32-bit
> >> > legacy stuff).
> > [--SNIP--]
> >> > Not sure how we can get away with this...
> >>
> >> I think we have two choices:
> >> - add a check to test if 32bit compiler is installed and if not print
> >> a clear message about the toolchain requirement
> >
> > I think this would be the first package to add such a check.
> >
> > How would you propose we implement this:
> > - in a pre-configure hook (but that will catch the failure late in the
> > build) ?
> > - in a make ifeq-block (so we can catch it early in the build) ?
>
> > The second solution is more appealing to me, but might be a bit more
> > complex to implement.
>
> I think a check to be added like this:
>
> luakit.mk:
>
> luajit-dependencies:
> shell script to check and if it fails it prints an appropriate
> message and stop the building
>
> dependencies: luajit-dependencies
>
> So the check it's done early at same time as other dependenies check.
Doing the check in dependencies is not much better than doing it as a
pre-configure hook: it can be delayed quite late in the build process.
> Right now i don't know how to check about the presence of the 32bit
> support on the 64 bit host toolchain.
What about something like this:
ifeq ($(BR2_PACKAGE_LUAJIT),y)
ifeq ($(TARGET_32BIT)$(HOST_64BIT),yy)
ifneq ($(shell echo 'int main() { return 0; }' |gcc -m32 -o foo -x c - >/dev/null 2>&1 && echo y; rm -f foo),y)
$(error Can't build luajit for 32-bit target on this machine (mising 32-bit development packages))
endif
endif
endif
Not really trivial, but should work with some tweaking...
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 17:49 ` Yann E. MORIN
@ 2014-03-07 19:40 ` Thomas Petazzoni
2014-03-07 20:37 ` Fabio Porcedda
2014-03-07 21:38 ` Yann E. MORIN
0 siblings, 2 replies; 18+ messages in thread
From: Thomas Petazzoni @ 2014-03-07 19:40 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Fri, 7 Mar 2014 18:49:03 +0100, Yann E. MORIN wrote:
> Doing the check in dependencies is not much better than doing it as a
> pre-configure hook: it can be delayed quite late in the build process.
>
> > Right now i don't know how to check about the presence of the 32bit
> > support on the 64 bit host toolchain.
>
> What about something like this:
>
> ifeq ($(BR2_PACKAGE_LUAJIT),y)
> ifeq ($(TARGET_32BIT)$(HOST_64BIT),yy)
> ifneq ($(shell echo 'int main() { return 0; }' |gcc -m32 -o foo -x c - >/dev/null 2>&1 && echo y; rm -f foo),y)
> $(error Can't build luajit for 32-bit target on this machine (mising 32-bit development packages))
> endif
> endif
> endif
>
> Not really trivial, but should work with some tweaking...
Why do you invent something crazy here? We already have
BR2_HOSTARCH_NEEDS_IA32_COMPILER which tests exactly what your new test
intends to do. However, I'm not sure this test is actually completely
correct: -m32 is a x86 compiler option. And my understanding is that
Luajit needs to be built with a host that has the same bitness, so for
example building a x86-64 target on a x86 system would not work, and
your test would not catch such a situation.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 19:40 ` Thomas Petazzoni
@ 2014-03-07 20:37 ` Fabio Porcedda
2014-03-07 20:46 ` Thomas Petazzoni
2014-03-07 21:38 ` Yann E. MORIN
1 sibling, 1 reply; 18+ messages in thread
From: Fabio Porcedda @ 2014-03-07 20:37 UTC (permalink / raw)
To: buildroot
On Fri, Mar 7, 2014 at 8:40 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Yann E. MORIN,
>
> On Fri, 7 Mar 2014 18:49:03 +0100, Yann E. MORIN wrote:
>
>> Doing the check in dependencies is not much better than doing it as a
>> pre-configure hook: it can be delayed quite late in the build process.
>>
>> > Right now i don't know how to check about the presence of the 32bit
>> > support on the 64 bit host toolchain.
>>
>> What about something like this:
>>
>> ifeq ($(BR2_PACKAGE_LUAJIT),y)
>> ifeq ($(TARGET_32BIT)$(HOST_64BIT),yy)
>> ifneq ($(shell echo 'int main() { return 0; }' |gcc -m32 -o foo -x c - >/dev/null 2>&1 && echo y; rm -f foo),y)
>> $(error Can't build luajit for 32-bit target on this machine (mising 32-bit development packages))
>> endif
>> endif
>> endif
>>
>> Not really trivial, but should work with some tweaking...
>
> Why do you invent something crazy here? We already have
> BR2_HOSTARCH_NEEDS_IA32_COMPILER which tests exactly what your new test
That's great so we need to add just:
diff --git a/package/luajit/Config.in b/package/luajit/Config.in
index 9c4ecc3..d0c1512 100644
--- a/package/luajit/Config.in
+++ b/package/luajit/Config.in
@@ -4,6 +4,7 @@ config BR2_PACKAGE_LUAJIT
# Luajit is only available for some target architectures, and
# has some complexity wrt 32/64. See luajit.mk for details.
depends on BR2_i386 || (BR2_x86_64 && BR2_HOSTARCH='x86_64')
|| BR2_powerpc || BR2_arm || BR2_armeb
+ select BR2_HOSTARCH_NEEDS_IA32_COMPILER if !BR2_x86_64
help
LuaJIT implements the full set of language features defined
by Lua 5.1. The virtual machine (VM) is API- and
> intends to do. However, I'm not sure this test is actually completely
> correct: -m32 is a x86 compiler option. And my understanding is that
> Luajit needs to be built with a host that has the same bitness, so for
> example building a x86-64 target on a x86 system would not work, and
> your test would not catch such a situation.
For such a case there is already a check:
config BR2_PACKAGE_LUAJIT
depends on BR2_i386 || (BR2_x86_64 && BR2_HOSTARCH='x86_64') ||
BR2_powerpc || BR2_arm || BR2_armeb
Regards
--
Fabio Porcedda
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 20:37 ` Fabio Porcedda
@ 2014-03-07 20:46 ` Thomas Petazzoni
2014-03-07 20:51 ` Fabio Porcedda
0 siblings, 1 reply; 18+ messages in thread
From: Thomas Petazzoni @ 2014-03-07 20:46 UTC (permalink / raw)
To: buildroot
Dear Fabio Porcedda,
On Fri, 7 Mar 2014 21:37:14 +0100, Fabio Porcedda wrote:
> diff --git a/package/luajit/Config.in b/package/luajit/Config.in
> index 9c4ecc3..d0c1512 100644
> --- a/package/luajit/Config.in
> +++ b/package/luajit/Config.in
> @@ -4,6 +4,7 @@ config BR2_PACKAGE_LUAJIT
> # Luajit is only available for some target architectures, and
> # has some complexity wrt 32/64. See luajit.mk for details.
> depends on BR2_i386 || (BR2_x86_64 && BR2_HOSTARCH='x86_64')
> || BR2_powerpc || BR2_arm || BR2_armeb
> + select BR2_HOSTARCH_NEEDS_IA32_COMPILER if !BR2_x86_64
This will prevent building Luajit for ARM, while running Buildroot on
an ARM platform. It's fairly unlikely, but still. "gcc -m32" will only
work on x86, or x86-64 with the 32 bits development files installed.
While in fact Luajit can build in situation where the bitness of the
target and the bitness of the arch match.
For example, Peter has one PowerPC build server: a "gcc -m32" test
would fail on it, even though it would be perfectly capable of building
the ARM 32 bits, PowerPC or x86 Luajit.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 20:46 ` Thomas Petazzoni
@ 2014-03-07 20:51 ` Fabio Porcedda
2014-03-07 20:58 ` Thomas Petazzoni
0 siblings, 1 reply; 18+ messages in thread
From: Fabio Porcedda @ 2014-03-07 20:51 UTC (permalink / raw)
To: buildroot
On Fri, Mar 7, 2014 at 9:46 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Fabio Porcedda,
>
> On Fri, 7 Mar 2014 21:37:14 +0100, Fabio Porcedda wrote:
>
>> diff --git a/package/luajit/Config.in b/package/luajit/Config.in
>> index 9c4ecc3..d0c1512 100644
>> --- a/package/luajit/Config.in
>> +++ b/package/luajit/Config.in
>> @@ -4,6 +4,7 @@ config BR2_PACKAGE_LUAJIT
>> # Luajit is only available for some target architectures, and
>> # has some complexity wrt 32/64. See luajit.mk for details.
>> depends on BR2_i386 || (BR2_x86_64 && BR2_HOSTARCH='x86_64')
>> || BR2_powerpc || BR2_arm || BR2_armeb
>> + select BR2_HOSTARCH_NEEDS_IA32_COMPILER if !BR2_x86_64
>
> This will prevent building Luajit for ARM, while running Buildroot on
> an ARM platform. It's fairly unlikely, but still. "gcc -m32" will only
> work on x86, or x86-64 with the 32 bits development files installed.
> While in fact Luajit can build in situation where the bitness of the
> target and the bitness of the arch match.
>
> For example, Peter has one PowerPC build server: a "gcc -m32" test
> would fail on it, even though it would be perfectly capable of building
> the ARM 32 bits, PowerPC or x86 Luajit.
Reading the gcc documentation the option -m32 work even on PowerPC:
http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/RS_002f6000-and-PowerPC-Options.html
RS/6000 and PowerPC Options -mcpu=cpu-type -mtune=cpu-type
-mcmodel=code-model -mpowerpc64 -maltivec -mno-altivec
-mpowerpc-gpopt -mno-powerpc-gpopt -mpowerpc-gfxopt
-mno-powerpc-gfxopt -mmfcrf -mno-mfcrf -mpopcntb -mno-popcntb
-mpopcntd -mno-popcntd -mfprnd -mno-fprnd -mcmpb -mno-cmpb
-mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp -mfull-toc
-mminimal-toc -mno-fp-in-toc -mno-sum-in-toc -m64 -m32
So maybe we need to change the name of the option
BR2_HOSTARCH_NEEDS_IA32_COMPILER
Regards
--
Fabio Porcedda
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 20:51 ` Fabio Porcedda
@ 2014-03-07 20:58 ` Thomas Petazzoni
2014-03-07 21:11 ` Fabio Porcedda
0 siblings, 1 reply; 18+ messages in thread
From: Thomas Petazzoni @ 2014-03-07 20:58 UTC (permalink / raw)
To: buildroot
Dear Fabio Porcedda,
On Fri, 7 Mar 2014 21:51:57 +0100, Fabio Porcedda wrote:
> Reading the gcc documentation the option -m32 work even on PowerPC:
> http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/RS_002f6000-and-PowerPC-Options.html
Ok, but not on ARM or MIPS, and probably not on many other 32 bits
architectures supported by Buildroot. Bottom line: testing 'gcc -m32'
is not a good way of testing whether the architecture is 32 bits or is
a 64 bits architecture capable of building and running 32 bits binaries.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 20:58 ` Thomas Petazzoni
@ 2014-03-07 21:11 ` Fabio Porcedda
2014-03-07 21:30 ` Thomas Petazzoni
0 siblings, 1 reply; 18+ messages in thread
From: Fabio Porcedda @ 2014-03-07 21:11 UTC (permalink / raw)
To: buildroot
On Fri, Mar 7, 2014 at 9:58 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Fabio Porcedda,
>
> On Fri, 7 Mar 2014 21:51:57 +0100, Fabio Porcedda wrote:
>
>> Reading the gcc documentation the option -m32 work even on PowerPC:
>> http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/RS_002f6000-and-PowerPC-Options.html
>
> Ok, but not on ARM or MIPS, and probably not on many other 32 bits
> architectures supported by Buildroot. Bottom line: testing 'gcc -m32'
> is not a good way of testing whether the architecture is 32 bits or is
> a 64 bits architecture capable of building and running 32 bits binaries.
We need to test if 32bit binaries are built only for 64bit host architectures.
Which are the 64bit host architectures that Buildroot supports?
--
Fabio Porcedda
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 21:11 ` Fabio Porcedda
@ 2014-03-07 21:30 ` Thomas Petazzoni
2014-03-07 21:58 ` Fabio Porcedda
0 siblings, 1 reply; 18+ messages in thread
From: Thomas Petazzoni @ 2014-03-07 21:30 UTC (permalink / raw)
To: buildroot
Dear Fabio Porcedda,
On Fri, 7 Mar 2014 22:11:33 +0100, Fabio Porcedda wrote:
> > Ok, but not on ARM or MIPS, and probably not on many other 32 bits
> > architectures supported by Buildroot. Bottom line: testing 'gcc -m32'
> > is not a good way of testing whether the architecture is 32 bits or is
> > a 64 bits architecture capable of building and running 32 bits binaries.
>
> We need to test if 32bit binaries are built only for 64bit host architectures.
> Which are the 64bit host architectures that Buildroot supports?
Potentially any 64 bits architecture, we don't have particular
dependencies on the host architecture.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 19:40 ` Thomas Petazzoni
2014-03-07 20:37 ` Fabio Porcedda
@ 2014-03-07 21:38 ` Yann E. MORIN
1 sibling, 0 replies; 18+ messages in thread
From: Yann E. MORIN @ 2014-03-07 21:38 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2014-03-07 20:40 +0100, Thomas Petazzoni spake thusly:
> Dear Yann E. MORIN,
>
> On Fri, 7 Mar 2014 18:49:03 +0100, Yann E. MORIN wrote:
>
> > Doing the check in dependencies is not much better than doing it as a
> > pre-configure hook: it can be delayed quite late in the build process.
> >
> > > Right now i don't know how to check about the presence of the 32bit
> > > support on the 64 bit host toolchain.
> >
> > What about something like this:
> >
> > ifeq ($(BR2_PACKAGE_LUAJIT),y)
> > ifeq ($(TARGET_32BIT)$(HOST_64BIT),yy)
> > ifneq ($(shell echo 'int main() { return 0; }' |gcc -m32 -o foo -x c - >/dev/null 2>&1 && echo y; rm -f foo),y)
> > $(error Can't build luajit for 32-bit target on this machine (mising 32-bit development packages))
> > endif
> > endif
> > endif
> >
> > Not really trivial, but should work with some tweaking...
>
> Why do you invent something crazy here? We already have
> BR2_HOSTARCH_NEEDS_IA32_COMPILER which tests exactly what your new test
> intends to do.
Gah.. I forgot about that one.
To my defense, the test is not completely crazy, as it's exactly what
support/dependencies/dependencies.sh does. ;-)
> However, I'm not sure this test is actually completely
> correct: -m32 is a x86 compiler option. And my understanding is that
> Luajit needs to be built with a host that has the same bitness, so for
> example building a x86-64 target on a x86 system would not work, and
> your test would not catch such a situation.
Indeed not. I was just randoly throwing some rough ideasa at the problem
at stake. A final solution would have anyway had to be much more
involved.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 21:30 ` Thomas Petazzoni
@ 2014-03-07 21:58 ` Fabio Porcedda
2014-03-07 22:19 ` Fabio Porcedda
0 siblings, 1 reply; 18+ messages in thread
From: Fabio Porcedda @ 2014-03-07 21:58 UTC (permalink / raw)
To: buildroot
On Fri, Mar 7, 2014 at 10:30 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Fabio Porcedda,
>
> On Fri, 7 Mar 2014 22:11:33 +0100, Fabio Porcedda wrote:
>
>> > Ok, but not on ARM or MIPS, and probably not on many other 32 bits
>> > architectures supported by Buildroot. Bottom line: testing 'gcc -m32'
>> > is not a good way of testing whether the architecture is 32 bits or is
>> > a 64 bits architecture capable of building and running 32 bits binaries.
>>
>> We need to test if 32bit binaries are built only for 64bit host architectures.
>> Which are the 64bit host architectures that Buildroot supports?
>
> Potentially any 64 bits architecture, we don't have particular
> dependencies on the host architecture.
Ok i undertand the general problem but right now the luajit package
support building 32 binaries on a 64 host architecture only if the
host compiler support the -m32 option so right now it's fine to test
only if the -m32 option is used.
So i think adding the line
select BR2_HOSTARCH_NEEDS_IA32_COMPILER if BR2_ARCH_IS_64
it's the right solution for checking the configurations supported by
the luajit package.
--
Fabio Porcedda
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] luajit package fails to build on x86_64 for x86
2014-03-07 21:58 ` Fabio Porcedda
@ 2014-03-07 22:19 ` Fabio Porcedda
0 siblings, 0 replies; 18+ messages in thread
From: Fabio Porcedda @ 2014-03-07 22:19 UTC (permalink / raw)
To: buildroot
On Fri, Mar 7, 2014 at 10:58 PM, Fabio Porcedda
<fabio.porcedda@gmail.com> wrote:
> On Fri, Mar 7, 2014 at 10:30 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>> Dear Fabio Porcedda,
>>
>> On Fri, 7 Mar 2014 22:11:33 +0100, Fabio Porcedda wrote:
>>
>>> > Ok, but not on ARM or MIPS, and probably not on many other 32 bits
>>> > architectures supported by Buildroot. Bottom line: testing 'gcc -m32'
>>> > is not a good way of testing whether the architecture is 32 bits or is
>>> > a 64 bits architecture capable of building and running 32 bits binaries.
>>>
>>> We need to test if 32bit binaries are built only for 64bit host architectures.
>>> Which are the 64bit host architectures that Buildroot supports?
>>
>> Potentially any 64 bits architecture, we don't have particular
>> dependencies on the host architecture.
>
> Ok i undertand the general problem but right now the luajit package
> support building 32 binaries on a 64 host architecture only if the
> host compiler support the -m32 option so right now it's fine to test
> only if the -m32 option is used.
>
> So i think adding the line
> select BR2_HOSTARCH_NEEDS_IA32_COMPILER if BR2_ARCH_IS_64
I've forgotten to add the "!" sign, so it's:
diff --git a/package/luajit/Config.in b/package/luajit/Config.in
index 9c4ecc3..dd93609 100644
--- a/package/luajit/Config.in
+++ b/package/luajit/Config.in
@@ -4,6 +4,7 @@ config BR2_PACKAGE_LUAJIT
# Luajit is only available for some target architectures, and
# has some complexity wrt 32/64. See luajit.mk for details.
depends on BR2_i386 || (BR2_x86_64 && BR2_HOSTARCH='x86_64')
|| BR2_powerpc || BR2_arm || BR2_armeb
+ select BR2_HOSTARCH_NEEDS_IA32_COMPILER if !BR2_ARCH_IS_64
help
LuaJIT implements the full set of language features defined
by Lua 5.1. The virtual machine (VM) is API- and
> it's the right solution for checking the configurations supported by
> the luajit package.
because in luajit.mk there is this:
ifeq ($(BR2_ARCH_IS_64),y)
LUAJIT_HOST_CC=$(HOSTCC)
else
LUAJIT_HOST_CC=$(HOSTCC) -m32
endif
Regards
--
Fabio Porcedda
^ permalink raw reply related [flat|nested] 18+ messages in thread
end of thread, other threads:[~2014-03-07 22:19 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-06 10:43 [Buildroot] luajit package fails to build on x86_64 for x86 Fabio Porcedda
2014-03-06 20:51 ` François Perrad
2014-03-07 10:19 ` Fabio Porcedda
2014-03-06 21:31 ` Yann E. MORIN
2014-03-07 9:59 ` Fabio Porcedda
2014-03-07 17:21 ` Yann E. MORIN
2014-03-07 17:32 ` Fabio Porcedda
2014-03-07 17:49 ` Yann E. MORIN
2014-03-07 19:40 ` Thomas Petazzoni
2014-03-07 20:37 ` Fabio Porcedda
2014-03-07 20:46 ` Thomas Petazzoni
2014-03-07 20:51 ` Fabio Porcedda
2014-03-07 20:58 ` Thomas Petazzoni
2014-03-07 21:11 ` Fabio Porcedda
2014-03-07 21:30 ` Thomas Petazzoni
2014-03-07 21:58 ` Fabio Porcedda
2014-03-07 22:19 ` Fabio Porcedda
2014-03-07 21:38 ` 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