Open danielsitnik opened 8 years ago
hi, see this commit, ar9331 support is added, and I test compilation is ok.
your compiling error is due to jerry-libc is included, because jerry-libc has no mips or mipsel specific implement, but we can use external libc, this can be set in toos/build.py as below
if option.target_os == 'linux' or option.target_os == 'openwrt':
cmake_opt.append('-DUSE_COMPILER_DEFAULT_LIBC=YES')
Thanks for the prompt response Derek!
I managed to compile successfully as well, then transferred the binary to the Omega and chmod +x iotjs
.
Now when I run just ./iotjs
I get some output to the console:
usage: iotjs <js> [<iotjs arguments>] [-- <app arguments>]
However, when I try to run any .js file there's no output to stdout or stderr. Even the most simple hello world script or even something with invalid code won't output anything. Is there any way to debug it? Or maybe I need to transfer something else from the compilation process as well?
it seems the js snapshot is wrong due to big endian, I would try to figure out how to fix this problem. you can change buildtype to 'debug' in build.config, so that the debug message can printed.
you can set 'no-snapshot' option to 'true' in build.config, that will make iotjs running ok on ar9331, but it will need more time to launch.
Oh, I was under the impression that debug mode was the default. Recompiled for debug and with no-snapshot, but still no luck.
root@Omega-2018:~# ./iotjs hello.js
ICE: Unreachable control path at /home/daniel/iotjs-openwrt/deps/jerry/jerry-core/ecma/operations/ecma-regexp-object.cpp(re_match_regexp):1132 was executed.
Error: ERR_FAILED_INTERNAL_ASSERTION
Aborted
hi, what in your hello.js.
Just a simple console.log('hello');
the iotjs has no builtin console module, you can change to
print('hello');
oh, I make mistake, it has console module.
No? As I understood from the tutorial it should have! Isn't it supposed to be compatible with Nodejs as well (meaning it's scripts can be run by Node)? That would mean it should have a console module.
you are right, it has console module. it seems
console.log('hello')
failed, but
print('hello')
is ok.
it's so weird, on mipsel board all thing going right, but in mips board, something is wrong.
I am hitting the same issue. I have tried with different versions of release/debug. Still debugging...
I bet the js2c is not producting a header file which is for a MIPS arch.
after fixing the endian of the header structure, there's still "out of memory" exception I had submited an issue to the official jerryscript repo, but it has not been fixed now.
See also this kernel problem (for nodejs but it might be related as well):
Hi Derek. I'd like to make iotjs work on the Onion Omega. This is an IoT development board that runs OpenWRT and has an Atheros AR9331 MIPS (not mipsel) SoC.
I have the toolchain for it and I have modified the CMake config files to use it (eg: mips-openwrt-linux-gcc instead of mipsel-openwrt-linux-gcc).
So far most of the build works, until it gets to this point where it finally fails:
Console output:
Stderr:
Do you know if it's possible to build it for the AR9331? Thanks and great job!