Removing musl libc usage. Linking to libgcc (for __aeabi_* routines on ARM target).

This commit is contained in:
Ruben Ayrapetyan
2014-11-18 21:13:54 +03:00
parent 988288c9e4
commit 9f7e17e9fd
6 changed files with 27 additions and 52 deletions
+3 -11
View File
@@ -45,10 +45,8 @@ export TARGET_RELEASE_MODES = release
export TARGET_PC_SYSTEMS = linux
export TARGET_MCU_SYSTEMS = $(addprefix stm32f,3 4)
export TARGET_PC_MODS = musl sanitize valgrind cp cp_minimal mem_stats \
musl-valgrind \
valgrind-cp \
musl-cp_minimal musl-mem_stats musl-cp_minimal-mem_stats \
export TARGET_PC_MODS = sanitize valgrind cp cp_minimal mem_stats \
cp-valgrind
export TARGET_MCU_MODS = cp_minimal
@@ -87,14 +85,8 @@ all: precommit
PRECOMMIT_CHECK_TARGETS_NO_VALGRIND_LIST= debug.linux.check \
release.linux.check
PRECOMMIT_CHECK_TARGETS_VALGRIND_LIST= debug.linux-valgrind.check \
release.linux-musl-valgrind.check \
debug.linux-valgrind-cp.check
# debug.linux-musl-valgrind.check \
release.linux-valgrind.check \
release.linux.check \
debug.linux-sanitize.check \
release.linux-sanitize.check \
release.linux-cp-valgrind.check
push: ./tools/push.sh
@ ./tools/push.sh
+5 -30
View File
@@ -150,16 +150,6 @@ ifeq ($(OPTION_OVERRIDE_DISABLE_OPTIMIZE),enable)
OPTION_OPTIMIZE = disable
endif
ifeq ($(filter musl,$(TARGET_MODS)), musl)
ifeq ($(OPTION_MCU),enable)
$(error MCU target doesn\'t support LIBC_MUSL)
endif
OPTION_LIBC := musl
else
OPTION_LIBC := raw
endif
# CompactProfile mode
ifeq ($(OPTION_MCU),enable)
OPTION_COMPACT_PROFILE := enable
@@ -180,10 +170,6 @@ else
endif
ifeq ($(filter sanitize,$(TARGET_MODS)), sanitize)
ifeq ($(OPTION_LIBC),musl)
$(error ASAN and LIBC_MUSL are mutually exclusive)
endif
OPTION_SANITIZE := enable
else
OPTION_SANITIZE := disable
@@ -249,9 +235,8 @@ CFLAGS_CORTEXM4 ?= -mlittle-endian -mcpu=cortex-m4 -march=armv7e-m -mthumb \
# Common
#
CFLAGS_COMMON ?= $(INCLUDES) -std=c99
LDFLAGS ?=
CFLAGS_COMMON ?= $(INCLUDES) -std=c99 -nostdlib
LDFLAGS ?= -lgcc
ifeq ($(OPTION_OPTIMIZE),enable)
CFLAGS_COMMON += $(CFLAGS_OPTIMIZE)
@@ -341,19 +326,9 @@ INCLUDES_JERRY = \
-I src/libcoreint \
-I src/libintstructs
# libc
ifeq ($(OPTION_LIBC),musl)
CC := musl-$(CC)
DEFINES_JERRY += -DLIBC_MUSL
CFLAGS_COMMON += -static
else
DEFINES_JERRY += -DLIBC_RAW
CFLAGS_COMMON += -nostdlib
ifeq ($(OPTION_SANITIZE),enable)
CFLAGS_COMMON += -fsanitize=address
LDFLAGS += -lasan
endif
ifeq ($(OPTION_SANITIZE),enable)
CFLAGS_COMMON += -fsanitize=address
LDFLAGS += -lasan
endif
ifeq ($(OPTION_NDEBUG),enable)
+1 -5
View File
@@ -19,11 +19,7 @@
/**
* Limit of data (system heap, engine's data except engine's own heap)
*/
#ifdef LIBC_RAW
# define CONFIG_MEM_DATA_LIMIT_MINUS_HEAP_SIZE 1024
#else /* !LIBC_RAW */
# define CONFIG_MEM_DATA_LIMIT_MINUS_HEAP_SIZE 16384
#endif /* !LIBC_RAW */
#define CONFIG_MEM_DATA_LIMIT_MINUS_HEAP_SIZE 1024
/**
* Limit of stack size
+1
View File
@@ -31,6 +31,7 @@ typedef signed long ssize_t;
* Attributes
*/
#define __unused __attribute__((unused))
#define __used __attribute__((used))
#define __packed __attribute__((packed))
#define __noreturn __attribute__((noreturn))
#define __noinline __attribute__((noinline))
+17 -4
View File
@@ -19,9 +19,6 @@
#include "jerry-libc.h"
FIXME(#ifndef LIBC_MUSL should be removed from here when own libc will be implemented)
#ifndef LIBC_MUSL
/**
* memcpy alias to __memcpy (for compiler usage)
*/
@@ -85,7 +82,23 @@ CALL_PRAGMA(GCC pop_options)
CALL_PRAGMA(GCC diagnostic pop)
#endif /* __GNUC__ */
#endif /* LIBC_MUSL */
/**
* Unreachable stubs for routines that are never called,
* but referenced from third-party libraries.
*/
#define JRT_UNREACHABLE_STUB_FOR(...) \
extern __VA_ARGS__; \
__used __VA_ARGS__ \
{ \
JERRY_UNREACHABLE (); \
}
JRT_UNREACHABLE_STUB_FOR(int raise (int sig_no __unused))
#ifdef __TARGET_HOST_ARMv7
JRT_UNREACHABLE_STUB_FOR(void __aeabi_unwind_cpp_pr0 (void))
#endif /* __TARGET_HOST_ARMv7 */
#undef JRT_UNREACHABLE_STUB_FOR
/**
* memset
@@ -8,9 +8,7 @@
# error "!__TARGET_HOST_x64 && !__TARGET_HOST_x86 && !__TARGET_HOST_ARMv7"
#endif /* !__TARGET_HOST_x64 && !__TARGET_HOST_x86 && !__TARGET_HOST_ARMv7 */
#ifdef LIBC_RAW
.global _start
_start:
_START
.end _start
#endif /* LIBC_RAW */