Since the project is now hosted at the JS Foundation we can move to unified copyright notices for the project.
Starting with this commit all future contributions to the project should only carry the following copyright notice (except for third-party code which requires copyright information to be preserved):
"Copyright JS Foundation and other contributors, http://js.foundation" (without the quotes)
This avoids cluttering the codebase with contributor-specific copyright notices which have a higher maintenance overhead and tend to get outdated quickly. Also dropping the year from the copyright notices helps to avoid yearly code changes just to update the copyright notices.
Note that each contributor still retains full copyright ownership of his/her contributions and the respective authorship is tracked very accurately via Git.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
Zephyr 1.6 switched to "unified kernel API". Old API is supported, but
deprecated and leads to warnings.
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
If we are building JerryScript from some other makefile that passes
down a -j option to make we should respect that when we build Zephyr.
JerryScript-DCO-1.0-Signed-off-by: Kumar Gala kumar.gala@linaro.org
For a normal zephyr application the pristine target simply runs
"rm -rf outdir". However the JerryScript build overrides the output
directory [O=$(OUTPUT)] so Zephyr's implementation pristine is not able
to to a full aggressive clean up for all boards.
For this reason it is better for the JerryScript build wrapper to have
its own implementation of pristine.
JerryScript-DCO-1.0-Signed-off-by: Daniel Thompson daniel.thompson@linaro.org
Currently if USE_CCACHE=1 is set to one than the Zephyr build system
will include ccache in the CC variable. ccache cannot be passed to
cmake using EXTERNAL_CMAKE_C_COMPILER (even if we fix the quoting)
because it fails a PATH reachability test within cmake. For that
reasons we solve the build failure simply by removing ccahce from CC
before we pass it into cmake.
The problem described about is a regression due to commit ac1bf19c90d6
("build: Adopt outputexports") and the fix contained in this patch
restores the original behaviour (zephyr exploits ccache, jerryscript
library build does not).
JerryScript-DCO-1.0-Signed-off-by: Daniel Thompson daniel.thompson@linaro.org
The file was named jerry-entry.c and not even built. Rename for clarity,
and add jerry_port_fatal(), jerry_port_get_current_time(),
jerry_port_get_time_zone() functions. User-visible result is that
if Date builtin is enabled (e.g. if building "full" config, its
Date.now() method can be used to measure relative time difference,
e.g. for benchmarking).
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
This patch simplifies the integration with the zephyr build system
whilst at the same time enriching the set of build targets to allow
zephyr to be configured using its kbuild features.
It works by exploiting "make outputexports", a feature of the zephyr
build system that makes the zephyr compiler configuration available to
other build systems in an easily accessible manner.
Whilst looking at the build we also correct the implementation of clean
so that it no longer destroys any custom zephyr configuration. Like any
other zephyr application one must use "make pristine" to remove the
config too.
JerryScript-DCO-1.0-Signed-off-by: Daniel Thompson daniel.thompson@linaro.org
JerryScript Zephyr port overrides standard Zephyr output location. But
components integrating Zephyr port may want to override it again. Make
sure that arbitrary overrides are possible, and just set the default
value to Zephyr port's custom preference.
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
The new zephyr build system doesn't support the arduino_101_factory
board.
This change restores the default BOARD to arduino_101 which
is the current recommended method.
If you are in an older SDK / Zephyr you can still use.
`make -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101_factory`
JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez sergio.martinez.rodriguez@intel.com
Currently the zephyr port fails to build with some cross-toolsets because
warnings from the system headers are being treated as errors. Using
-isystem for any includes in TOOLCHAIN_CFLAGS allows us to crank up the
warning levels without worrying about newlib headers breaking the build.
JerryScript-DCO-1.0-Signed-off-by: Daniel Thompson daniel.thompson@linaro.org
Currently we need to modify the JerryScript Makefiles for every new
board we want to work with. It is better to study the zephyr configuration
and used the CONFIG_ options to determine the right compiler flags.
We expose the CONFIG_ options to make by adding machinary to the makefiles
to import the Zephyr .config file, allow us to make the decisions we
need.
JerryScript-DCO-1.0-Signed-off-by: Daniel Thompson daniel.thompson@linaro.org
Several non-script files have been added with exec permission to
the repository. This patch revokes the erroneous permissions.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
It's stated in the Guidelines that all contributions must be under
the Apache License 2.0. To avoid potential mistakes from manual
reviews, this patch adds the check-license.py script to
automatically check all source files for license headers.
Travis CI is also configured to run the check.
Fallout: it turned out that some files already in the code base
either miss a license header or have some minor typo differences.
The patch fixes up some of these deficiences.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Although both jerry-libc and jerry-libm have configuration options
that enable/disable their build, in practice, only jerry-libc can be
replaced with the system (compiler-default) libc. If jerry-libm is
disabled, the build of jerry-main fails, as there is no way to
instruct the linker to link the system libm to the binary. (The
build system does have a way to pass flags to the linker, but those
flags are listed before the linked objects. For the references to
get resolved correctly, the libraries to be linked have to be
specified _after_ the objects.)
This patch adds the EXTERNAL_LINK_LIBS configuration option to
CMakeLists, which ensures that the specified libraries get
correctly passed to the linker. (E.g, replacing jerry-libm with
system libm becomes possible with
`JERRY_LIBM=OFF EXTERNAL_LINK_LIBS='-lm'`.)
Additionally, the patch also makes the following related changes:
* Removes the COMPILER_DEFAULT_LIBC configuration option, as it is
(almost) always the opposite of JERRY_LIBC. Moreover, its name is
misleading: its only role is to add `-nostdlib` to the linker
flags.
* Makes use of transitive library dependencies: if a library has
another library as dependency, and it is linked to a binary, its
dependency is linked as well. Thus, jerry-libc, jerry-libm, and
any external libraries are added to jerry-core as dependency, and
then only jerry-core is linked to executables (cmake will take
care of the rest).
* build.py and run-tests.py follow up the changes, along with some
minor syntax changes.
* Moves static linking option to global CMakeLists, as unit test
binaries should be linked the same way as jerry-main.
* Adds EXTERNAL_COMPILER_FLAGS and EXTERNAL_LINKER_FLAGS as last to
the flag list, to allow user override of (nearly) anything.
The patch speculatively follows up the build system changes in the
mbed, riot-stm32f4, and zephyr targets.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Fix Zephyr build
With the changes to the zephyr sdk, gettimeofday is being guarded
by XOPEN_SOURCE_EXTENDED which requires at least 700 on XOPEN_SOURCE to be active
This little patch also helps on removing most of the warnings we had before
related to that issue.
More info on this feature:
http://man7.org/linux/man-pages/man7/feature_test_macros.7.html
Another option was to enable _GNU_SOURCE for this port.
There are still some harmless warnings related to __sputc_r for which we still require
the convertion warning.
Tested on qemu_cortex_m3, qemu_x86, arduino_101 and frdm_k64f.
Zephyr Sdk 0.8.2, Zephyr 1.5.0-rc4 & Zephyr ec39b216
Closes#1311.
JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez sergio.martinez.rodriguez@intel.com
The original implementation used shell facility, but it was designed for
a unix shell like input, and automatically tokenized it into
space-separated "words", with limit of 10 (i.e. 9 spaces per line). For
JavaScript input, it is quite easy to have more than 9 spaces per line,
and get error:
Too many parameters (max 10)
After consultation with upstream
(https://jira.zephyrproject.org/browse/ZEP-532) it was decided that the
best approach is to skip using shell facility and use Zephyr console
facility. That however requires some Zephyr-specific boilerplate code.
This code was implemented as reusable modules in
https://github.com/pfalcon/zephyr_console_helpers repository, to be
usable for other console-based projects too. zephyr_getline.h/c in this
commits are direct imports from this repository.
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
This is now required, as Zephyr for frdm_k64f is built with hard float ABI.
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
Zephyr SDK 0.8.2 contains newlib 2.4.0 which doesn't provide gettimeofday()
declaration by default, but needs _XOPEN_SOURCE defined for this. While
this is definitely an issue with newlib 2.4.0 (to be fixed in one of the
next releases), defining _XOPEN_SOURCE is quite a harmless workaround.
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
- Zephyr now requires two passes to create the configuration for the cross compiling
- Added the missing bits required to build a valid new jerryscript minimal configuration
JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez sergio.martinez.rodriguez@intel.com
With this change, REPL works almost the same as a standard JS REPL does
(browser console, Node.js, etc.). A result of each expression is
printed, e.g. "2+2" will print "4". Result is printed even if its
value is "undefined", e.g. "print(1)" will print "1", and on the next
line "undefined" (which is again how "normal" JS console work, except
a normal JS way to print to console is console.log()).
If an exception occured, a message "Error executing statement:", followed
by external representation of exception object, is printed. Note that
distinctive exception objects are supported only in "cp" (compact profile),
not in "cp_minimal". In the latter case, there's only exception hierarchy
top-level prototype, so any error message will look like:
Error executing statement: [object Function]
(That's the reason why there's error message prefix - so it weren't too
confusing even if used in cp_minimal config. Unfortunately, compile-time
JerryScript configuration isn't available to Zephyr's main.c, so there's
no easy way to implement cp vs cp_minimal distinction).
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
Related issue: #964
Implemented the IO API of Jerry ports. Removed log file from API level.
The port implementation should define the destination of log messages.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Various calls updated to use API from jerry-api.h (to-be JerryScript 1.0
API).
Use jerry_eval() instead of jerry_run_simple(), as it allow to store (and
then access) variables in a global environment. E.g. following now works
(entered and executed as two separate lines):
a = 1
print(a)
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
- Fixed problem when the x86 hangs waiting for the ARC to
be initialized. If you flash as arduino_101 instead of
arduino_101_factory this will happen and you will not get
a command line.
- Changed default build to arduino_101_factory which is
the current recommended method of flashing the arduino_101
- Updated documentation to explain a few bits on how to flash
the board and conform to the v1.4.0 way of flashing the device.
- Added a helper to run the dfu-util command directly on make.
JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez sergio.martinez.rodriguez@intel.com
In Makefile.zephyr the SOURCE_DIR variable was introduced recently.
However, the SOURCE_DIR variable is heavily used in zephyr. If you try to build
the jerryscript zephyr port from a zephyr project using the makefiles, the
SOURCE_DIR gets set by the zephyr build system and points to wrong place here.
This patch creates unique name to avoid the name clash.
JerryScript-DCO-1.0-Signed-off-by: Sakari Poussa sakari.poussa@intel.com
Read the zephyr crosscompile settings earlier so correct values are used.
Currently, the crosscompilation does not work on OSX. With this fix it does.
JerryScript-DCO-1.0-Signed-off-by: Sakari Poussa sakari.poussa@intel.com
- Add preliminary support for ARC architecture.
Using "em_starterkit" board supported by Zephyr. Only build for this board
is tested, not booted on a real device due to lack of access. There's no
QEMU emulation support for ARC in Zephyr (yet) either.
- Update README to cover different Zephyr architectures/boards.
- Changed the arduino_101 paths to something more generic and adaptable
- Made sure it compiles and runs on Arduino 101
JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez sergio.martinez.rodriguez@intel.com
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org