* Cmake had LTO OFF, build.py had LTO ON by default. ON became the
common setting.
* Cmake had snapshot save/exec OFF, build.py had them ON by
default. OFF became the common setting.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
"ecma_builtin_number_prototype_helper_round" is used by following
functions:
* ecma_builtin_number_prototype_object_to_fixed
* ecma_builtin_number_prototype_object_to_exponential
* ecma_builtin_number_prototype_object_to_precision
The current implementation does not support currying numbers and will
produce illegal digit for some test cases. For example, the result of
"0.95.toFixed(1)" is "0.:".
This patch fixs the issue, however the implementation of "toFixed" is
still problematic, at least not meet section 15.7.4.5 8.a of the
specification. The related test case is:
* assert((0.995).toFixed(2) === "0.99");
* assert((9.995).toFixed(2) === "9.99");
Reference:
* http://www.ecma-international.org/ecma-262/5.1/#sec-15.7.4.5
JerryScript-DCO-1.0-Signed-off-by: Yanhui Shen shen.elf@gmail.com
Properties are changed to a type and value pair instead of a pointer to an internal
representation. Functions such as ecma_op_object_get_[own_]property do not
return with property pointers anymore.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
The current content in CONTRIBUTING.md is largely based on the "Patch Submission Process" Wiki page.
This commit also moves the DCO from the Wiki into the source tree.
In addition, clarify in README.md that contributions need to be licensed under the Apache License 2.0 and signed with the DCO.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
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
call_stack_size should be register_count + maximum stack depth
* We don't add in the parser to save the size of snapshot header
* jerry_snapshot_version 5 -> 6
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
The new build script does not support ninja anymore, and we haven't
been building bare-metal arm targets for long. This patch removes
now-obsolete dependencies from install scripts.
This can also help to reduce the load on Travis CI (as it keeps
installing dependencies for each build job over and over again).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Previously only a copy of the Apache License 2.0 header (for inclusion into source files) was distributed as part of the sources.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
With the new build system, the conventional `cmake && make` already
works. However, the last step, i.e., `make install` was still
missing (didn't work). This patch adds the `install()` commands to
CMakeLists that are required to generate the `install` target in
the Makefile.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The ecma_op_object_get_[own_]property calls should be phased out from
the project eventually and virtual properties should be introduced instead.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
`tools/build.py --help` prints a lot of output, which is sometimes
hard to comprehend, especially since some described options are
useful for developers only.
This patch:
* shortens how options are displayed in the output with the help of
the "metavar" feature of the argparse module ("--option {on, off}"
becomes "--option X" and the choices are listed in the description
only); and
* hides all developer-specific options from "--help", and reveals
them only for "--devhelp".
As a result, help output becomes more readable, especially for
ordinary users, and needs less space.
Some additional changes:
* the options are ordered in a more logical way (although that's
somewhat subjective);
* help strings start with lowercase letters (it aligns better with
argparse's overall style); and
* rename "--cpointer_32_bit" to "--cpointer-32bit" (underscores are
alien to command line options).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Don't increment the current position in case of a continuation byte.
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
* Print location on parser errors.
* Do not print messages on parse error if FEATURE_ERROR_MESSAGES is not set.
* Minor style fixes
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Until now,
* the link map of jerry-main has always been generated, even though
it is not used that often;
* static linking has always been forced except for the OSX target.
This patch adds configuration options for these features.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
In tolerant mode, only the existence of the Signed-off-by line is
checked but the name and address is not matched against the author
of the commit.
The tools/run-tests.py script is extended to allow calling the
check script in tolerant mode and also to detect whether it is
being run by Travis CI.
The Travis CI config has been modified to check PRs in strict mode
but use tolerant mode for merges to master. This should enable the
use of the Merge button on the GitHub web interface. (The PR is
strictly checked when a contributor opens it but when a committer
merges it via the web interface and GitHub rewrites author details
from the contributor's profile, master will not turn red either.)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Previously, jerry-core was built with various build identification
info (build date, git commit hash, git branch name), which was both
available from string constants of the library and also exposed by
jerry-main via the `--version` command line option. As of late,
jerry-core identifies itself only with API version number macros,
but sometimes it could be helpful to get access to the git commit
hash as well, even if that info does not become part of the API.
This patch moves the git commit hash retrieval logic from the build
scripts of jerry-core to jerry-main, and changes `--version` handler
to print the hash as well.
Resolves#1295
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
It should not import things it does not use and it should define
settings data only (i.e., definition of functions should not happen
there).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
OS X build regularly reports some 39 warnings falling in 3 major
categories:
* "static function '...' is used in an inline function with
external linkage [-Wstatic-in-inline]": Some semantics around
`inline` have changed between C89 and C99, and gcc and clang seem
to disagree on how strict they should be about them. Solution
chosen is to use `-Wnostatic-in-inline` command line option for
clang.
* "implicit conversion turns floating-point number into integer:
'double' to 'bool' [-Wfloat-conversion]": `if (fmod (..., ...))`
was used at different places, which is not nice anyway, thus the
return value is compared explicitly against `ECMA_NUMBER_ZERO`.
* "format string is not a string literal [-Wformat-nonliteral]":
Console and log port I/O functions have a printf-like interface,
and the default implementations actually pass both format string
and the remaining arguments to a vfprintf. However, clang is
strict about the format string parameter of vfprintf and expects
a literal there. By annotating the port I/O functions with
`__attribute__ ((format (printf, ..., ...)))`, clang will check
the format string being a literal string earlier, when the port
functions are called, and will not complain within them when
vfprintf is called.
(Actually, this has revealed an incorrect format string, which
has been fixed as well.)
(There were also some single conversion errors not listed above.)
The patch was tested on OS X (where all warnings disappeared), but
it should help clang compilation on other OS's as well.
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
Define constants are undefined at the end of the corresponding files of jerry-libm supporting all-in-one build.
JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
Removing a lot of ECMA_PROPERTY_VALUE_PTR macro calls. The only drawback
is free callbacks for native objects cannot be deleted anymore. Redefining
a free callback is a rare case, so this trade-of is acceptable.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
* Split list into two: what is needed for building and what is
needed for development only.
* Remove g++ from install list.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
* Remove JERRY_CORE CMake option: the building of the core
JerryScript library should not be optional.
* Fix wording of comments, status and error messages.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu