iotjs
iotjs copied to clipboard
MIPS Buildroot Linux Port
Can you give any tips for how to port IOTJS to a 32bit MIPS architecture using a Linux OS supplied in a Buildroot environment? I am currently using Buildroot cs_mips-214.05.
Is this a relatively simple port or do many changes need to be made?
Shouldn't be hard. If you use snapshots (enabled by default) you might have some endianness issues if you cross compile iotjs (the snapshot tool might be compiled on x86 little endianness, dependin on your environment).
Hi @mark3072! I've recently tried to compile the iotjs to MIPS OpenWRT router. The main points were:
- Correctly select the toolchain, which will be used during the build. In iotjs, libtuv there are different toolchain files which could be adapted.
- For now you should disable the snapshot function in iotjs as there is currently no support to handle the little endian snapshots on big endian systems.
- Disable the jerry-libc option, use the build root's libc.
I don't see any blocker things currently, just some minor things. Hope this helps.
Everything builds fine with the suggested modifications. However, I am having a problem with Buffer on my Mips Linux build.
var buff1 = new Buffer("test"); assert.equal(buff1.toString(), "test");
fails with:
uncaughtException: AssertionError: {"actual":"t","expected":"test","operator":"=="}
Is this a big/little endian issue? Do I need to dive into buffer implementation or is there something easy I am missing?
@mark3072 That's strange. I don't think it is related to the big/little endianness. Could you check what does the buff1.toString()
returns? Also would it be possible to share your modifications in some way?
I've tested on my openwrt build and there was no assert with the given example code. Small note: I've used an older iotjs build not the latest (~1.5 months old).
I confirm version 1.0 is building fine on mips and other arch: https://buildd.debian.org/status/package.php?p=iotjs&suite=unstable
you can even download precompiled package from debian's testing branch.