From b04c15e8f56dc7f79a1d9b9bbc17436c182ecc77 Mon Sep 17 00:00:00 2001 From: Istvan Miklos Date: Tue, 3 Apr 2018 12:05:32 +0200 Subject: [PATCH] Remove TARGET_HOST macros Remove TARGET_HOST defines from the jerry-libc module and replace with compiler provided macros. JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu --- CMakeLists.txt | 1 + jerry-libc/CMakeLists.txt | 13 ------------- jerry-libc/arch/arm-v7.h | 6 +++--- jerry-libc/target/posix/jerry-asm.S | 10 +++++----- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bab261295b..1a03b3ceee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,6 +240,7 @@ endif() # External compiler & linker flags if(DEFINED EXTERNAL_COMPILE_FLAGS) jerry_add_compile_flags(${EXTERNAL_COMPILE_FLAGS}) + jerry_add_flags(CMAKE_ASM_FLAGS "${EXTERNAL_COMPILE_FLAGS}") endif() if(DEFINED EXTERNAL_LINKER_FLAGS) diff --git a/jerry-libc/CMakeLists.txt b/jerry-libc/CMakeLists.txt index 300a91cc34..08520c8860 100644 --- a/jerry-libc/CMakeLists.txt +++ b/jerry-libc/CMakeLists.txt @@ -22,19 +22,6 @@ if(FEATURE_INIT_FINI) set(DEFINES_LIBC ${DEFINES_LIBC} ENABLE_INIT_FINI) endif() -# Architecture-specific configuration -if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") - set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_x64) -elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l") - set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_ARMv7 __TARGET_HOST_ARMv7_HARD_FLOAT) -elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l-el") - set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_ARMv7 __TARGET_HOST_ARMv7_SOFT_FLOAT) -elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686") - set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_x86) -else() - message(FATAL_ERROR "Machine architecture ${CMAKE_SYSTEM_PROCESSOR} isn't supported") -endif() - # Include directories set(INCLUDE_LIBC "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/jerry-libc/arch/arm-v7.h b/jerry-libc/arch/arm-v7.h index bfe28194c7..eb665a6442 100644 --- a/jerry-libc/arch/arm-v7.h +++ b/jerry-libc/arch/arm-v7.h @@ -117,15 +117,15 @@ * store s16-s31 vfp registers to buffer, pointed with r0 register, * and increase the register on size of stored data. */ -#ifdef __TARGET_HOST_ARMv7_HARD_FLOAT +#if defined (__VFP_FP__) && !defined (__SOFTFP__) # define _STORE_VFP_S16_S31_IF_HARD_FLOAT \ vstm r0!, {s16 - s31}; # define _LOAD_VFP_S16_S31_IF_HARD_FLOAT \ vldm r0!, {s16 - s31}; -#else /* !__TARGET_HOST_ARMv7_HARD_FLOAT */ +#else /* !__VFP_FP__ || __SOFTFP__ */ # define _STORE_VFP_S16_S31_IF_HARD_FLOAT # define _LOAD_VFP_S16_S31_IF_HARD_FLOAT -#endif /* __TARGET_HOST_ARMv7_HARD_FLOAT */ +#endif /* __VFP_FP__ && !__SOFTFP__ */ /* * setjmp diff --git a/jerry-libc/target/posix/jerry-asm.S b/jerry-libc/target/posix/jerry-asm.S index 8722fc1a68..9deb0b137b 100644 --- a/jerry-libc/target/posix/jerry-asm.S +++ b/jerry-libc/target/posix/jerry-asm.S @@ -13,15 +13,15 @@ * limitations under the License. */ -#if defined (__TARGET_HOST_x64) +#if defined (__x86_64__) #include "arch/x86-64.h" -#elif defined (__TARGET_HOST_x86) +#elif defined (__i386__) #include "arch/x86-32.h" -#elif defined (__TARGET_HOST_ARMv7) +#elif defined (__ARM_ARCH_7A__) #include "arch/arm-v7.h" -#else /* !__TARGET_HOST_x64 && !__TARGET_HOST_x86 && !__TARGET_HOST_ARMv7 */ +#else /* !__x86_64__ && !__i386__ && !__ARM_ARCH_7A__ */ #error "Unsupported architecture" -#endif /* __TARGET_HOST_x64 */ +#endif /* __x86_64__ */ #if defined (__linux__) .macro func _name