From a26832f3c9ada7e01d863b2b97079dbef978983a Mon Sep 17 00:00:00 2001 From: Evgeny Gavrin Date: Thu, 9 Jul 2015 15:25:21 +0300 Subject: [PATCH 1/2] Fix strip handling for cross build configurations. JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com --- build/configs/toolchain_linux_armv7l-el.cmake | 2 ++ build/configs/toolchain_linux_armv7l-hf.cmake | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build/configs/toolchain_linux_armv7l-el.cmake b/build/configs/toolchain_linux_armv7l-el.cmake index 13f06769a8..7ae74d3d57 100644 --- a/build/configs/toolchain_linux_armv7l-el.cmake +++ b/build/configs/toolchain_linux_armv7l-el.cmake @@ -17,5 +17,7 @@ set(CMAKE_SYSTEM_PROCESSOR armv7l-el) set(CMAKE_C_COMPILER arm-linux-gnueabi-gcc) set(CMAKE_CXX_COMPILER arm-linux-gnueabi-g++) +# FIXME: This could break cross compilation, when the strip is not for the target architecture +find_program(CMAKE_STRIP NAMES arm-linux-gnueabi-strip strip) set(FLAGS_COMMON_ARCH -mlittle-endian -mthumb) diff --git a/build/configs/toolchain_linux_armv7l-hf.cmake b/build/configs/toolchain_linux_armv7l-hf.cmake index a5205a510a..80ebe41edf 100644 --- a/build/configs/toolchain_linux_armv7l-hf.cmake +++ b/build/configs/toolchain_linux_armv7l-hf.cmake @@ -17,7 +17,8 @@ set(CMAKE_SYSTEM_PROCESSOR armv7l-hf) set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) - +# FIXME: This could break cross compilation, when the strip is not for the target architecture +find_program(CMAKE_STRIP NAMES arm-linux-gnueabihf-strip strip) # # Limit fpu to VFPv3 with d0-d15 registers # From 9c18648b6c25b9e6d5c9e1859e44167e68476d40 Mon Sep 17 00:00:00 2001 From: Evgeny Gavrin Date: Thu, 9 Jul 2015 15:26:10 +0300 Subject: [PATCH 2/2] Fix build for GCC 4.7. JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com --- jerry-core/lit/lit-strings.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jerry-core/lit/lit-strings.cpp b/jerry-core/lit/lit-strings.cpp index 4abcdcf064..230e4173f6 100644 --- a/jerry-core/lit/lit-strings.cpp +++ b/jerry-core/lit/lit-strings.cpp @@ -555,10 +555,10 @@ lit_read_code_point_from_utf8 (const lit_utf8_byte_t *buf_p, /**< buffer with ch { JERRY_ASSERT (buf_p && buf_size); - lit_utf8_byte_t c = (uint8_t) buf_p[0]; + lit_utf8_byte_t c = buf_p[0]; if ((c & LIT_UTF8_1_BYTE_MASK) == LIT_UTF8_1_BYTE_MARKER) { - *code_point = (uint32_t) (c & LIT_UTF8_LAST_7_BITS_MASK); + *code_point = (lit_code_point_t) (c & LIT_UTF8_LAST_7_BITS_MASK); return 1; } @@ -567,17 +567,17 @@ lit_read_code_point_from_utf8 (const lit_utf8_byte_t *buf_p, /**< buffer with ch if ((c & LIT_UTF8_2_BYTE_MASK) == LIT_UTF8_2_BYTE_MARKER) { bytes_count = 2; - ret = ((uint32_t) (c & LIT_UTF8_LAST_5_BITS_MASK)); + ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_5_BITS_MASK)); } else if ((c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER) { bytes_count = 3; - ret = ((uint32_t) (c & LIT_UTF8_LAST_4_BITS_MASK)); + ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_4_BITS_MASK)); } else if ((c & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER) { bytes_count = 4; - ret = ((uint32_t) (c & LIT_UTF8_LAST_3_BITS_MASK)); + ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_3_BITS_MASK)); } else { @@ -608,8 +608,8 @@ lit_utf8_string_calc_hash_last_bytes (const lit_utf8_byte_t *utf8_buf_p, /**< ch { JERRY_ASSERT (utf8_buf_p != NULL); - lit_utf8_byte_t byte1 = (utf8_buf_size > 0) ? utf8_buf_p[utf8_buf_size - 1] : 0; - lit_utf8_byte_t byte2 = (utf8_buf_size > 1) ? utf8_buf_p[utf8_buf_size - 2] : 0; + lit_utf8_byte_t byte1 = (utf8_buf_size > 0) ? utf8_buf_p[utf8_buf_size - 1] : (lit_utf8_byte_t) 0; + lit_utf8_byte_t byte2 = (utf8_buf_size > 1) ? utf8_buf_p[utf8_buf_size - 2] : (lit_utf8_byte_t) 0; uint32_t t1 = (uint32_t) byte1 + (uint32_t) byte2; uint32_t t2 = t1 * 0x24418b66;