Skip to content

Commit ff37959

Browse files
Istvan MiklosLaszloLango
authored andcommitted
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
1 parent a0e3157 commit ff37959

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ endif()
240240
# External compiler & linker flags
241241
if(DEFINED EXTERNAL_COMPILE_FLAGS)
242242
jerry_add_compile_flags(${EXTERNAL_COMPILE_FLAGS})
243+
jerry_add_flags(CMAKE_ASM_FLAGS "${EXTERNAL_COMPILE_FLAGS}")
243244
endif()
244245

245246
if(DEFINED EXTERNAL_LINKER_FLAGS)

jerry-libc/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,6 @@ if(FEATURE_INIT_FINI)
2222
set(DEFINES_LIBC ${DEFINES_LIBC} ENABLE_INIT_FINI)
2323
endif()
2424

25-
# Architecture-specific configuration
26-
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
27-
set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_x64)
28-
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l")
29-
set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_ARMv7 __TARGET_HOST_ARMv7_HARD_FLOAT)
30-
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l-el")
31-
set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_ARMv7 __TARGET_HOST_ARMv7_SOFT_FLOAT)
32-
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
33-
set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_x86)
34-
else()
35-
message(FATAL_ERROR "Machine architecture ${CMAKE_SYSTEM_PROCESSOR} isn't supported")
36-
endif()
37-
3825
# Include directories
3926
set(INCLUDE_LIBC "${CMAKE_CURRENT_SOURCE_DIR}")
4027

jerry-libc/arch/arm-v7.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@
117117
* store s16-s31 vfp registers to buffer, pointed with r0 register,
118118
* and increase the register on size of stored data.
119119
*/
120-
#ifdef __TARGET_HOST_ARMv7_HARD_FLOAT
120+
#if defined (__VFP_FP__) && !defined (__SOFTFP__)
121121
# define _STORE_VFP_S16_S31_IF_HARD_FLOAT \
122122
vstm r0!, {s16 - s31};
123123
# define _LOAD_VFP_S16_S31_IF_HARD_FLOAT \
124124
vldm r0!, {s16 - s31};
125-
#else /* !__TARGET_HOST_ARMv7_HARD_FLOAT */
125+
#else /* !__VFP_FP__ || __SOFTFP__ */
126126
# define _STORE_VFP_S16_S31_IF_HARD_FLOAT
127127
# define _LOAD_VFP_S16_S31_IF_HARD_FLOAT
128-
#endif /* __TARGET_HOST_ARMv7_HARD_FLOAT */
128+
#endif /* __VFP_FP__ && !__SOFTFP__ */
129129

130130
/*
131131
* setjmp

jerry-libc/target/posix/jerry-asm.S

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
* limitations under the License.
1414
*/
1515

16-
#if defined (__TARGET_HOST_x64)
16+
#if defined (__x86_64__)
1717
#include "arch/x86-64.h"
18-
#elif defined (__TARGET_HOST_x86)
18+
#elif defined (__i386__)
1919
#include "arch/x86-32.h"
20-
#elif defined (__TARGET_HOST_ARMv7)
20+
#elif defined (__ARM_ARCH_7A__)
2121
#include "arch/arm-v7.h"
22-
#else /* !__TARGET_HOST_x64 && !__TARGET_HOST_x86 && !__TARGET_HOST_ARMv7 */
22+
#else /* !__x86_64__ && !__i386__ && !__ARM_ARCH_7A__ */
2323
#error "Unsupported architecture"
24-
#endif /* __TARGET_HOST_x64 */
24+
#endif /* __x86_64__ */
2525

2626
#if defined (__linux__)
2727
.macro func _name

0 commit comments

Comments
 (0)