Giter VIP home page Giter VIP logo

Comments (10)

LaszloLango avatar LaszloLango commented on May 19, 2024

CC: @tczene, @kkristof

from jerryscript.

egavrin avatar egavrin commented on May 19, 2024

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.

kkristof avatar kkristof commented on May 19, 2024

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.

galpeter avatar galpeter commented on May 19, 2024

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.

seanshpark avatar seanshpark commented on May 19, 2024

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

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

galpeter avatar galpeter commented on May 19, 2024

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.

galpeter avatar galpeter commented on May 19, 2024

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

seanshpark avatar seanshpark commented on May 19, 2024

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

galpeter avatar galpeter commented on May 19, 2024

For me after applying the patch the VFP errors were gone, I'll do the pull request.

from jerryscript.

seanshpark avatar seanshpark commented on May 19, 2024

It's working ok for me too with jerryscript-project/iotjs#52. Thank you.

from jerryscript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.