Skip to contentSkip to conversation

New: Lua with hard-float on MIPS by buildroot doesn't work

Buildroot bugzilla at busybox.net 1 participant 15 messages Jan 29, 2015 – Apr 2, 2015

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=7844

Summary: Lua with hard-float on MIPS by buildroot doesn't work
Product: buildroot
Version: 2014.11
Platform: PC
OS/Version: Linux
Status: NEW
Severity: critical
Priority: P5
Component: Other
AssignedTo: unassigned at buildroot.uclibc.org
ReportedBy: brotherjinho at gmail.com
CC: buildroot at uclibc.org
Estimated Hours: 0.0

I found something strange.

I wrote simple script that print the variable in Lua. It worked on x86 on linux. I tried to run it on my target device that is MIPS little endian. I prepared the lua by buildroot. I used 'hard-float' option for performance issue. But this simple script doesn't work. I used Sourcery CodeBench.

I tested it with 'soft-float' option. Then lua worked correctly. Have you the experience like that?

The lua code is like below.

=================
local var = 131523;
print(var);
=================

It must print 131523. But my target printed 0 . What's wrong?

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

Thomas Petazzoni <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at buildroot.uclibc |vincent.riera at imgtec.com
|.org |

--- Comment #2 from Thomas Petazzoni <[email protected]> 2015-01-29 08:18:41 UTC --- Thanks for the report. I've reassigned the bug to our MIPS guy Vicente.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

--- Comment #3 from Vicente Olivert Riera <[email protected]> 2015-01-29 10:51:14 UTC --- Hello.

I have done a Buildroot build for x86_64 using the Sourcery CodeBench toolchain and then I chrooted into it to check if this problem is not present in other architectures.

I have never used Lua so, please tell me if this is expected:

# chroot images /bin/bash
bash-4.3# lua  
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
Quoted 2 lines

local var = 12345
print(var)

nil

Quoted 2 lines

var = 12345
print(var)

12345

I see exactly the same behavior on MIPS big endian, tested in real hardware, for both soft and hard float. I will check it on little endian if you think that is necessary.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#4 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

--- Comment #4 from Gustavo Zacarias <[email protected]> 2015-01-29 11:05:27 UTC ---
Vicente: yes, it's expected, see http://www.lua.org/pil/4.2.html (search for interactive, it's not considered the same block in that case).
Try to run it from a file.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#5 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

--- Comment #5 from Carlos Santos <[email protected]> 2015-01-29 11:17:42 UTC --- This is the expected behavior, as documented on http://www.lua.org/pil/4.2.html

$ rpm -qi lua
Name        : lua
Version     : 5.2.2
Release     : 8.fc21
Architecture: x86_64
Install Date: Wed 03 Dec 2014 06:33:31 PM BRST
Group       : Development/Languages
Size        : 602972
License     : MIT
Signature   : RSA/SHA256, Sun 17 Aug 2014 12:08:57 PM BRT, Key ID
89ad4e8795a43f54
Source RPM  : lua-5.2.2-8.fc21.src.rpm
Build Date  : Sun 17 Aug 2014 11:59:50 AM BRT
Build Host  : buildhw-02.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://www.lua.org/
Summary     : Powerful light-weight programming language
[...]
$ lua
Lua 5.2.2  Copyright (C) 1994-2013 Lua.org, PUC-Rio
Quoted 2 lines

local var = 12345
print(var)

nil

Quoted 2 lines

var = 12345
print(var)

12345

Quoted 4 lines

if 6 > 4 then

Quoted 3 lines

local var = 12345
print(var)
end

12345

Quoted 1 line

I'd close this as "not a bug".

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#6 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

--- Comment #6 from Vicente Olivert Riera <[email protected]> 2015-01-29 12:16:51 UTC --- I have tested it on real MIPS hardware. I have built a Buildroot rootfs for MIPS32 Little-Endian Hard-Float using the Sourcery CodeBench toolchain.

This is the defconfig I have used:

BR2_mipsel=y
# BR2_MIPS_SOFT_FLOAT is not set
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_SYSV=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
BR2_TARGET_GENERIC_ROOT_PASSWD="root"
BR2_PACKAGE_LUA=y

It works for me:

Welcome to Buildroot
buildroot login: root
Password:

# cat > test.lua << EOF
Quoted 3 lines

local var = 12345;
print(var);
EOF

# lua test.lua 
12345

What target device do you have? Can you share your defconfig with us? What kernel are you using?

Thanks.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#7 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

--- Comment #7 from Jinho Yoo <[email protected]> 2015-01-30 14:43:39 UTC --- Created attachment 5834
--> https://bugs.busybox.net/attachment.cgi?id=5834
Our linux build configuration

It's my linux build configuration.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#8 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

--- Comment #8 from Vicente Olivert Riera <[email protected]> 2015-01-30 14:46:01 UTC --- (In reply to comment #7)

Quoted 4 lines

Created attachment 5834 [details]
Our linux build configuration

It's my linux build configuration.

Please, tell us:
1. what target device are you using
2. what kernel version are you using
3. what defconfig are you using to generate the buildroot rootfs

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#9 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

--- Comment #9 from Jinho Yoo <[email protected]> 2015-01-31 00:48:47 UTC --- OK, I see.

Quoted 1 line

1. what target device are you using

It's MIPS Little endian device. We're developing our own embedded system by collaborating other H/W company.

Quoted 1 line

2. what kernel version are you using

It's Linux kernel release 3.x.

Quoted 1 line

3. what defconfig are you using to generate the build root rootfs

Please check the attached file.
(https://bugs.busybox.net/attachment.cgi?id=5834). We don't use buildroot to build kernel. We're using buildroot to build 3rd parties.

Jinho Yoo

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#10 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

--- Comment #10 from Vicente Olivert Riera <[email protected]> 2015-02-03 12:21:27 UTC --- (In reply to comment #9)

Quoted 3 lines
Quoted 1 line

1. what target device are you using

It's MIPS Little endian device. We're developing our own embedded system by collaborating other H/W company.

Ok, so it's not a common device but a custom one you are developing. Could you tell me at least which SoC are you using?

Quoted 2 lines
Quoted 1 line

2. what kernel version are you using

It's Linux kernel release 3.x.

3.x? Please, tell me the exact version you are using so I can try to reproduce your problem. If you tell me 3.x, what kernel should I try? 3.0, 3.0.1, 3.0.2, ... 3.18.3, 3.19?

Quoted 4 lines
Quoted 1 line

3. what defconfig are you using to generate the buildroot rootfs

Please check the attached file.
(https://bugs.busybox.net/attachment.cgi?id=5834). We don't use buildroot to build kernel. We're using buildroot to build 3rd parties.

I didn't say anything about the kernel here. I wanted to see the defconfig you are using to build the Buildroot rootfs. You have attached a binary file. The defconfig should be a text file.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#11 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

--- Comment #11 from Jinho Yoo <[email protected]> 2015-02-03 14:13:12 UTC ---

Sorry for my late response.

The kernel version we are using is 3.8.13.

The attached file is ascii file, not binary. Please try to open it via text editor.

Well.. Is it enough information?
========================
MIPS32 Core

- MIPS32 APTIV UP Core
- 32KB instruction and 32KB data L1 cache
- VPE(Virtual Processing Element)
- Hardware TC(Thread Context)
========================

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#12 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

--- Comment #12 from Vicente Olivert Riera <[email protected]> 2015-04-02 15:21:39 UTC --- I cannot reproduce the bug, sorry. Are you still having this problem?

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#13 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

--- Comment #13 from Jinho Yoo <[email protected]> 2015-04-02 15:26:44 UTC --- Dear Everybody.

I found the reason. The CPU on target board doesn't have floating point
calculation unit. I got this information from our H/W partner. I'm very sorry to make you guys confuse.

Regards,
Jinho Yoo

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#14 lore raw

[Buildroot] [Bug 7844] Lua with hard-float on MIPS by buildroot doesn't work

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7844

Jinho Yoo <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #14 from Jinho Yoo <[email protected]> 2015-04-02 15:28:00 UTC --- It's my mistake. I had to check target board's CPU specification.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.