Message ID | CAHkwnC8GuQJaRaqw_0A1KNNaFyz4scJBzsALRGx0ounsg7Y5mQ@mail.gmail.com |
---|---|
State | Superseded |
Headers | show |
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
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
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
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?
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
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.
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