Howdy,

I thought I’d play around with getting Jerryscript up and running with Mynewt.

Generally, it was a painless endeavor, however, I needed to make a few changes to newt:

- If the src/ext directory of a SDK package doesn’t exist, ignore it when recursively processing includes.

- When processing includes, take the contents of “src_dirs” and also include them in the recursively include processing.

The changes I made to newt are here:

https://github.com/apache/incubator-mynewt-newt/compare/develop...sterlinghughes:develop?expand=1

However, I also ran into something else that has bothered us before. Specifically, I needed to do the following to the jerryscript source:

https://github.com/jerryscript-project/jerryscript/compare/master...sterlinghughes:master

Note the changes:

- Adding a pkg.yml and repository.yml — this worked surprisingly well! Not much magick to get this up and running. Although, given namespacing, I do wonder if we shouldn’t have newt look for these files in the base of the directory, but also search a directory “.newt” or “newt” in the base directory as well.

- And the awfulness: changes to jcontext/jcontext.c and jerry.c

Essentially, jcontext.c is a file that just declares global variables. Because this file doesn’t have any functions that are explicitly used, it gets dropped from the link. By declaring a function that is empty, yet called in jerry.c things magically work.

I believe this is the same problem we saw with using linker sections in init before, and has to do with the fact that we compile packages into archive files instead of linking all the generated objects at the end of the build. We had discussed in the past:

- Linking all generated objects together

- Leaving the archive files so we don’t lose things like newt size, which rely on them being generated to summarize size information

Thoughts?

Sterling

Reply via email to