jerryscript-project / iotjs

Platform for Internet of Things with JavaScript http://www.iotjs.net
Other
2.58k stars 440 forks source link

MIPS Buildroot Linux Port #1312

Open mark3072 opened 6 years ago

mark3072 commented 6 years ago

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?

zherczeg commented 6 years ago

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).

galpeter commented 6 years ago

Hi @mark3072! I've recently tried to compile the iotjs to MIPS OpenWRT router. The main points were:

I don't see any blocker things currently, just some minor things. Hope this helps.

mark3072 commented 6 years ago

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?

galpeter commented 6 years ago

@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?

galpeter commented 6 years ago

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).

rzr commented 6 years ago

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.