Skip to contentSkip to conversation

luajit: test SITEINFO_BITS instead of maintaining a list of 32bit targets

PATCH Superseded Andre McCurdy 2 participants 5 messages Jan 25, 2017 – Mar 13, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 luajit: test SITEINFO_BITS instead of maintaining a list of 32bit targets

When cross compiling, the word size of the compiler set via HOST_CC must match the word size of the target. That's achieved by appending "-m32" to BUILD_CC_ARCH if the target word size is known to be 32bits.

Unfortunately the current list of over-rides (powerpc, x86 and arm) does not cover all cases (e.g. it ignores MIPS). Using SITEINFO_BITS is a more generic solution.

---
 meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb +2 -4
index 964dc1d..430279f 100644
@@ -11,7 +11,7 @@ SRC_URI[sha256sum] = "620fa4eb12375021bef6e4f237cbd2dd5d49e56beb414bee052c746bee
 
 S = "${WORKDIR}/LuaJIT-${PV}"
 
-inherit pkgconfig binconfig
+inherit pkgconfig binconfig siteinfo
 
 BBCLASSEXTEND = "native"
 
@@ -21,9 +21,7 @@ BBCLASSEXTEND = "native"
 # you need to install the multilib development package (e.g.
 # libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part
 # (HOST_CC="gcc -m32").
-BUILD_CC_ARCH_append_powerpc = ' -m32'
-BUILD_CC_ARCH_append_x86 = ' -m32'
-BUILD_CC_ARCH_append_arm = ' -m32'
+BUILD_CC_ARCH_append = " ${@['-m32',''][d.getVar('SITEINFO_BITS') != '32']}"
 
 # The lua makefiles expect the TARGET_SYS to be from uname -s
 # Values: Windows, Linux, Darwin, iOS, SunOS, PS3, GNU/kFreeBSD
Signature · 1 line
1.9.1
#1 lore raw
Quoted 27 lines · Andre McCurdy

When cross compiling, the word size of the compiler set via HOST_CC must match the word size of the target. That's achieved by appending "-m32" to BUILD_CC_ARCH if the target word size is known to be 32bits.

Unfortunately the current list of over-rides (powerpc, x86 and arm) does not cover all cases (e.g. it ignores MIPS). Using SITEINFO_BITS is a more generic solution.

---
 meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb +1 -1
index 964dc1d..430279f 100644
@@ -11,7 +11,7 @@ SRC_URI[sha256sum] = "620fa4eb12375021bef6e4f237cbd2dd5d49e56beb414bee052c746bee
 
 S = "${WORKDIR}/LuaJIT-${PV}"
 
-inherit pkgconfig binconfig
+inherit pkgconfig binconfig siteinfo
 
 BBCLASSEXTEND = "native"
 

meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb BBCLASSEXTEND = "native" · line 25

Quoted 8 lines
meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb +1 -3
@@ -21,9 +21,7 @@ BBCLASSEXTEND = "native"
 # you need to install the multilib development package (e.g.
 # libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part
 # (HOST_CC="gcc -m32").
-BUILD_CC_ARCH_append_powerpc = ' -m32'
-BUILD_CC_ARCH_append_x86 = ' -m32'
-BUILD_CC_ARCH_append_arm = ' -m32'
+BUILD_CC_ARCH_append = " ${@['-m32',''][d.getVar('SITEINFO_BITS') != '32']}"
 

not related but
This makes me think about another issue, will it work on non-x86 build machines, currently we do have aarch64 based boxes

Quoted 3 lines
meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb +0 -0
 # The lua makefiles expect the TARGET_SYS to be from uname -s
 # Values: Windows, Linux, Darwin, iOS, SunOS, PS3, GNU/kFreeBSD
#2 lore raw
Quoted 27 lines · Khem Raj
Quoted 26 lines · Andre McCurdy

When cross compiling, the word size of the compiler set via HOST_CC must match the word size of the target. That's achieved by appending "-m32" to BUILD_CC_ARCH if the target word size is known to be 32bits.

Unfortunately the current list of over-rides (powerpc, x86 and arm) does not cover all cases (e.g. it ignores MIPS). Using SITEINFO_BITS is a more generic solution.

---
 meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb +1 -1
index 964dc1d..430279f 100644
@@ -11,7 +11,7 @@ SRC_URI[sha256sum] = "620fa4eb12375021bef6e4f237cbd2dd5d49e56beb414bee052c746bee
 
 S = "${WORKDIR}/LuaJIT-${PV}"
 
-inherit pkgconfig binconfig
+inherit pkgconfig binconfig siteinfo
 
 BBCLASSEXTEND = "native"
 
Quoted 12 lines

meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb BBCLASSEXTEND = "native" · line 24

Quoted 8 lines
meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb +1 -3
@@ -21,9 +21,7 @@ BBCLASSEXTEND = "native"
 # you need to install the multilib development package (e.g.
 # libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part
 # (HOST_CC="gcc -m32").
-BUILD_CC_ARCH_append_powerpc = ' -m32'
-BUILD_CC_ARCH_append_x86 = ' -m32'
-BUILD_CC_ARCH_append_arm = ' -m32'
+BUILD_CC_ARCH_append = " ${@['-m32',''][d.getVar('SITEINFO_BITS') != '32']}"

not related but
This makes me think about another issue, will it work on non-x86 build machines, currently we do have aarch64 based boxes

Right (unless aarch64 host toolchains accept "-m32"?)

Building on 32bit x86 is probably broken too.

Quoted 8 lines

meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb BBCLASSEXTEND = "native"

Quoted 3 lines
meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb +0 -0
 # The lua makefiles expect the TARGET_SYS to be from uname -s
 # Values: Windows, Linux, Darwin, iOS, SunOS, PS3, GNU/kFreeBSD
 

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#3 lore raw
In reply to Andre McCurdy
Quoted 7 lines · Andre McCurdy

When cross compiling, the word size of the compiler set via HOST_CC must match the word size of the target. That's achieved by appending "-m32" to BUILD_CC_ARCH if the target word size is known to be 32bits.

Unfortunately the current list of over-rides (powerpc, x86 and arm) does not cover all cases (e.g. it ignores MIPS). Using SITEINFO_BITS is a more generic solution.

Ping.

Quoted 32 lines
---
 meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb +2 -5
index 964dc1d..430279f 100644
@@ -11,7 +11,7 @@ SRC_URI[sha256sum] = "620fa4eb12375021bef6e4f237cbd2dd5d49e56beb414bee052c746bee
 
 S = "${WORKDIR}/LuaJIT-${PV}"
 
-inherit pkgconfig binconfig
+inherit pkgconfig binconfig siteinfo
 
 BBCLASSEXTEND = "native"
 
@@ -21,9 +21,7 @@ BBCLASSEXTEND = "native"
 # you need to install the multilib development package (e.g.
 # libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part
 # (HOST_CC="gcc -m32").
-BUILD_CC_ARCH_append_powerpc = ' -m32'
-BUILD_CC_ARCH_append_x86 = ' -m32'
-BUILD_CC_ARCH_append_arm = ' -m32'
+BUILD_CC_ARCH_append = " ${@['-m32',''][d.getVar('SITEINFO_BITS') != '32']}"
 
 # The lua makefiles expect the TARGET_SYS to be from uname -s
 # Values: Windows, Linux, Darwin, iOS, SunOS, PS3, GNU/kFreeBSD
--

1.9.1

#4 lore raw
Quoted 10 lines · Andre McCurdy
Quoted 7 lines · Andre McCurdy

When cross compiling, the word size of the compiler set via HOST_CC must match the word size of the target. That's achieved by appending "-m32" to BUILD_CC_ARCH if the target word size is known to be 32bits.

Unfortunately the current list of over-rides (powerpc, x86 and arm) does not cover all cases (e.g. it ignores MIPS). Using SITEINFO_BITS is a more generic solution.

Ping.

Actually this patch needs to be rebased since the earlier (incomplete) fix was merged. Sending a v2.

Quoted 32 lines
Quoted 32 lines
---
 meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb +2 -5
index 964dc1d..430279f 100644
@@ -11,7 +11,7 @@ SRC_URI[sha256sum] = "620fa4eb12375021bef6e4f237cbd2dd5d49e56beb414bee052c746bee
 
 S = "${WORKDIR}/LuaJIT-${PV}"
 
-inherit pkgconfig binconfig
+inherit pkgconfig binconfig siteinfo
 
 BBCLASSEXTEND = "native"
 
@@ -21,9 +21,7 @@ BBCLASSEXTEND = "native"
 # you need to install the multilib development package (e.g.
 # libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part
 # (HOST_CC="gcc -m32").
-BUILD_CC_ARCH_append_powerpc = ' -m32'
-BUILD_CC_ARCH_append_x86 = ' -m32'
-BUILD_CC_ARCH_append_arm = ' -m32'
+BUILD_CC_ARCH_append = " ${@['-m32',''][d.getVar('SITEINFO_BITS') != '32']}"
 
 # The lua makefiles expect the TARGET_SYS to be from uname -s
 # Values: Windows, Linux, Darwin, iOS, SunOS, PS3, GNU/kFreeBSD
--

1.9.1