From 0ac29b53dc038408b08e0f8515ae6edabc145f76 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Thu, 20 Apr 2017 22:01:50 +0200 Subject: Add support of musl-libc The port is functional. Bound checking is not supported yet. --- lib/Makefile | 4 ++++ lib/bcheck.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Makefile b/lib/Makefile index 3c5b988..9861743 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -30,6 +30,10 @@ ifeq ($(TARGETOS),Darwin) BCHECK_O = endif +ifeq ($(CONFIG_musl),yes) + BCHECK_O = +endif + I386_O = libtcc1.o alloca86.o alloca86-bt.o $(BCHECK_O) X86_64_O = libtcc1.o alloca86_64.o alloca86_64-bt.o $(BCHECK_O) ARM_O = libtcc1.o armeabi.o alloca-arm.o diff --git a/lib/bcheck.c b/lib/bcheck.c index 9eb012f..41c08aa 100644 --- a/lib/bcheck.c +++ b/lib/bcheck.c @@ -48,7 +48,7 @@ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \ || defined(__DragonFly__) || defined(__dietlibc__) \ || defined(__UCLIBC__) || defined(__OpenBSD__) || defined(__NetBSD__) \ - || defined(_WIN32) || defined(TCC_UCLIBC) + || defined(_WIN32) || defined(TCC_UCLIBC) || defined(TCC_MUSL) //#warning Bound checking does not support malloc (etc.) in this environment. #undef CONFIG_TCC_MALLOC_HOOKS #undef HAVE_MEMALIGN -- cgit v1.3.1