Remove TARGET_HOST macros (#2264)

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
This commit is contained in:
Istvan Miklos
2018-04-03 14:58:47 +02:00
committed by László Langó
parent a0e315719b
commit ff37959195
4 changed files with 9 additions and 21 deletions
+1
View File
@@ -240,6 +240,7 @@ endif()
# External compiler & linker flags # External compiler & linker flags
if(DEFINED EXTERNAL_COMPILE_FLAGS) if(DEFINED EXTERNAL_COMPILE_FLAGS)
jerry_add_compile_flags(${EXTERNAL_COMPILE_FLAGS}) jerry_add_compile_flags(${EXTERNAL_COMPILE_FLAGS})
jerry_add_flags(CMAKE_ASM_FLAGS "${EXTERNAL_COMPILE_FLAGS}")
endif() endif()
if(DEFINED EXTERNAL_LINKER_FLAGS) if(DEFINED EXTERNAL_LINKER_FLAGS)
-13
View File
@@ -22,19 +22,6 @@ if(FEATURE_INIT_FINI)
set(DEFINES_LIBC ${DEFINES_LIBC} ENABLE_INIT_FINI) set(DEFINES_LIBC ${DEFINES_LIBC} ENABLE_INIT_FINI)
endif() 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 # Include directories
set(INCLUDE_LIBC "${CMAKE_CURRENT_SOURCE_DIR}") set(INCLUDE_LIBC "${CMAKE_CURRENT_SOURCE_DIR}")
+3 -3
View File
@@ -117,15 +117,15 @@
* store s16-s31 vfp registers to buffer, pointed with r0 register, * store s16-s31 vfp registers to buffer, pointed with r0 register,
* and increase the register on size of stored data. * 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 \ # define _STORE_VFP_S16_S31_IF_HARD_FLOAT \
vstm r0!, {s16 - s31}; vstm r0!, {s16 - s31};
# define _LOAD_VFP_S16_S31_IF_HARD_FLOAT \ # define _LOAD_VFP_S16_S31_IF_HARD_FLOAT \
vldm r0!, {s16 - s31}; vldm r0!, {s16 - s31};
#else /* !__TARGET_HOST_ARMv7_HARD_FLOAT */ #else /* !__VFP_FP__ || __SOFTFP__ */
# define _STORE_VFP_S16_S31_IF_HARD_FLOAT # define _STORE_VFP_S16_S31_IF_HARD_FLOAT
# define _LOAD_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 * setjmp
+5 -5
View File
@@ -13,15 +13,15 @@
* limitations under the License. * limitations under the License.
*/ */
#if defined (__TARGET_HOST_x64) #if defined (__x86_64__)
#include "arch/x86-64.h" #include "arch/x86-64.h"
#elif defined (__TARGET_HOST_x86) #elif defined (__i386__)
#include "arch/x86-32.h" #include "arch/x86-32.h"
#elif defined (__TARGET_HOST_ARMv7) #elif defined (__ARM_ARCH_7A__)
#include "arch/arm-v7.h" #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" #error "Unsupported architecture"
#endif /* __TARGET_HOST_x64 */ #endif /* __x86_64__ */
#if defined (__linux__) #if defined (__linux__)
.macro func _name .macro func _name