Comments (10)
from jerryscript.
It may not work on stm32, because it only supports single precision floating point format, not double. It seems that the DOUBLE_TO_ECMA_NUMBER_T macro should be implemented manually as low-level function. #33
from jerryscript.
Hi, I have run the make build_all_nuttx
which didn't show any error. We don't have any stm32 board so we can't try the binary. Could you give us more information like the make.log and the target which you can't build?
from jerryscript.
Hi, I think the reason for the link failure is that jerry uses the fdlibm (which is in the third-party dir) and you don't pass as a library when linking the final target. Also note that the fdlibm is a C project and not a C++ one, I saw that you only use CXX_FLAGS
in the toolchain files in iotjs.
from jerryscript.
Description for this issue was too short. Forgive me for insufficient explanation.
IoT.js for nuttx build orders are explain in https://github.com/Samsung/iotjs/wiki/Build-for-NuttX page.
You'll get the errors with it as fdlibm is not linked.
As there is a patch for this problem, #91, I've done with below steps in manual
- build iotjs
(cd to iotjs)
./tools/build.py --buildtype=release \
--target-arch=arm --target-os=nuttx \
--nuttx-home=/home/maxwell/harmony/nuttx/nuttx \
--buildlib --make-flags=-j1
- build jerry with patch
(in iotjs folder)
cd deps/jerry
git checkout master
git pull
git checkout -b tczene-fix-math master
git pull [email protected]:tczene/jerryscript.git fix-math
LTO=OFF make release.nuttx -j4
cp build/obj-VALGRIND-OFF-LTO-OFF/nuttx/third-party/fdlibm/librelease.jerry-fdlibm.third_party.lib.a \
../../build/arm-nuttx/release/libs/libfdlibm.a
- copy libs to nuttx
(back in iotjs folder)
cp build/arm-nuttx/release/libs/libjerrycore.a ../nuttx/nuttx/lib/libjerry.a
cp build/arm-nuttx/release/libs/libuv.a ../nuttx/nuttx/lib
cp build/arm-nuttx/release/iotjs/liblibiotjs.a ../nuttx/nuttx/lib/libiotjs.a
cp build/arm-nuttx/release/libs/libfdlibm.a ../nuttx/nuttx/lib/libfdlibm.a
- patch nuttx to apply libfdlibm.a
diff --git a/nuttx/FlatLibs.mk b/nuttx/FlatLibs.mk
index 458925b..f674495 100644
--- a/nuttx/FlatLibs.mk
+++ b/nuttx/FlatLibs.mk
@@ -115,6 +115,7 @@ endif
ifeq ($(CONFIG_LIBJERRY),y)
NUTTXLIBS += lib$(DELIM)libjerry$(LIBEXT)
+NUTTXLIBS += lib$(DELIM)libfdlibm$(LIBEXT)
endif
- build nuttx
(cd to nuttx where .config file exist)
make
But there are VFP issues.
LD: nuttx
arm-none-eabi-ld: error: .../harmony/nuttx/nuttx/nuttx uses VFP register arguments, .../harmony/nuttx/nuttx/lib/libfdlibm.a(w_log.c.obj) does not
arm-none-eabi-ld: failed to merge target specific data of file .../harmony/nuttx/nuttx/lib/libfdlibm.a(w_log.c.obj)
...
from jerryscript.
Hi @seanshpark,
This VFP linking issue is caused by the following: In iotjs the cmake config files only sets the CMAKE_CXX_FLAGS
but the fdlibm is a C
project, thus it will use CMAKE_C_FLAGS
which are not set by the iotjs config files. I've created a simple patch which also sets the CMAKE_C_FLAGS
with the required target specific options, should I create a pull request for it or just share it as a secret gist?
from jerryscript.
@seanshpark could you try this patch? https://gist.github.com/galpeter/4383e5d2a1c78c9a777d
This should set the required flags for the fdlibm and then there should be no link error related to the VFP registers.
from jerryscript.
@galpeter , thank you for the patch. please make a pull request to iotjs.
p.s. current iotjs build does not generate fdlibm so I may have to change the build script. manual building in deps/jerry folder still has VFP register arguments problem with nuttx.
from jerryscript.
For me after applying the patch the VFP errors were gone, I'll do the pull request.
from jerryscript.
It's working ok for me too with jerryscript-project/iotjs#52. Thank you.
from jerryscript.
Related Issues (20)
- ICE: Assertion 'context_p->stack_depth == context_p->context_stack_depth' failed at jerry-core/parser/js/js-parser-statm.c
- ICE: Assertion 'ecma_is_lexical_environment (obj_p) || !ecma_op_object_is_fast_array (obj_p)' failed at jerry-core/ecma/base/ecma-helpers.c
- SEGV ./jerry-core/ecma/base/ecma-helpers.c:238:58
- SEGV ./jerry-core/jmem/jmem-poolman.c:136:29 in jmem_pools_free
- Who to contact for security issues
- Segmentation Fault in release. Assertion 'context_p->next_scanner_info_p->type == SCANNER_TYPE_FUNCTION' failed on debug.
- Segmentation Fault in release. Assertion 'context_p->source_p < context_p->source_end_p' failed in debug version
- link error when build jerry.exe on MSYS2 MinGW64
- Assertion 'opts & PARSER_CLASS_LITERAL_CTOR_PRESENT' failed at /jerryscript/jerry-core/parser/js/js-parser-expr.c(parser_parse_class_body):538
- SEGV /jerryscript/jerry-core/vm/vm.c:1648:55 in vm_loop
- Not feasible to update some CI jobs to ubuntu 22.04 HOT 2
- Need a Bytecode Viewer, a tool to read Bytecode HOT 1
- Memory corruption in parser_parse_class
- Assertion 'ecma_is_value_object (iter_result)' failed
- Assertion 'context_p->next_scanner_info_p->source_p == context_p->source_p && context_p->next_scanner_info_p->type == SCANNER_TYPE_SWITCH' failed
- Snapshot doesn't support tagged template literals HOT 1
- RegExp.rightContext differs between Jerryscript and V8
- request a new release
- Online API reference docs doesn't match github's. HOT 1
- How to ensure that arguments of c method are not destroyed after the execution of the function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jerryscript.