aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile6
-rw-r--r--lib/alloca86-bt.S2
-rw-r--r--lib/alloca86.S2
-rw-r--r--lib/alloca86_64-bt.S2
-rw-r--r--lib/alloca86_64.S4
-rw-r--r--lib/bcheck.c20
-rw-r--r--lib/libtcc1.c6
-rw-r--r--lib/va_list.c2
8 files changed, 26 insertions, 18 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 35046a4..3b582d4 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -29,7 +29,7 @@ endif
# only for native compiler
$(X)BCHECK_O = bcheck.o
-ifeq ($(CONFIG_musl),yes)
+ifeq ($(CONFIG_musl)$(CONFIG_uClibc),yes)
BCHECK_O =
endif
@@ -61,10 +61,10 @@ $(BIN) : $(patsubst %.o,$(X)%.o,$(OBJ-$T))
$(XAR) rcs $@ $^
$(X)%.o : %.c
- $(XCC) -c $< -o $@ $(DEFINES) $(XFLAGS)
+ $(XCC) -c $< -o $@ $(XFLAGS)
$(X)%.o : %.S
- $(XCC) -c $< -o $@ $(DEFINES) $(XFLAGS)
+ $(XCC) -c $< -o $@ $(XFLAGS)
$(X)crt1w.o : crt1.c
$(X)wincrt1w.o : wincrt1.c
diff --git a/lib/alloca86-bt.S b/lib/alloca86-bt.S
index 5215505..4f95cf1 100644
--- a/lib/alloca86-bt.S
+++ b/lib/alloca86-bt.S
@@ -11,7 +11,7 @@ __bound_alloca:
and $-4,%eax
jz p6
-#ifdef TCC_TARGET_PE
+#ifdef _WIN32
p4:
cmp $4096,%eax
jbe p5
diff --git a/lib/alloca86.S b/lib/alloca86.S
index ec1e185..bb7a2c2 100644
--- a/lib/alloca86.S
+++ b/lib/alloca86.S
@@ -10,7 +10,7 @@ alloca:
and $-4,%eax
jz p3
-#ifdef TCC_TARGET_PE
+#ifdef _WIN32
p1:
cmp $4096,%eax
jbe p2
diff --git a/lib/alloca86_64-bt.S b/lib/alloca86_64-bt.S
index 9b6c3c6..4cbad90 100644
--- a/lib/alloca86_64-bt.S
+++ b/lib/alloca86_64-bt.S
@@ -4,7 +4,7 @@
.globl __bound_alloca
__bound_alloca:
-#ifdef TCC_TARGET_PE
+#ifdef _WIN32
# bound checking is not implemented
pop %rdx
mov %rcx,%rax
diff --git a/lib/alloca86_64.S b/lib/alloca86_64.S
index 4f4dad7..ae3c97d 100644
--- a/lib/alloca86_64.S
+++ b/lib/alloca86_64.S
@@ -5,7 +5,7 @@
alloca:
pop %rdx
-#ifdef TCC_TARGET_PE
+#ifdef _WIN32
mov %rcx,%rax
#else
mov %rdi,%rax
@@ -14,7 +14,7 @@ alloca:
and $-16,%rax
jz p3
-#ifdef TCC_TARGET_PE
+#ifdef _WIN32
p1:
cmp $4096,%rax
jbe p2
diff --git a/lib/bcheck.c b/lib/bcheck.c
index 41c08aa..d0c1ae2 100644
--- a/lib/bcheck.c
+++ b/lib/bcheck.c
@@ -21,10 +21,15 @@
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
-#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) \
- && !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
+
+#if !defined(__FreeBSD__) \
+ && !defined(__FreeBSD_kernel__) \
+ && !defined(__DragonFly__) \
+ && !defined(__OpenBSD__) \
+ && !defined(__NetBSD__)
#include <malloc.h>
#endif
+
#if !defined(_WIN32)
#include <unistd.h>
#endif
@@ -45,10 +50,13 @@
#define CONFIG_TCC_MALLOC_HOOKS
#define HAVE_MEMALIGN
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
- || defined(__DragonFly__) || defined(__dietlibc__) \
- || defined(__UCLIBC__) || defined(__OpenBSD__) || defined(__NetBSD__) \
- || defined(_WIN32) || defined(TCC_UCLIBC) || defined(TCC_MUSL)
+#if defined(__FreeBSD__) \
+ || defined(__FreeBSD_kernel__) \
+ || defined(__DragonFly__) \
+ || defined(__OpenBSD__) \
+ || defined(__NetBSD__) \
+ || defined(__dietlibc__) \
+ || defined(_WIN32)
//#warning Bound checking does not support malloc (etc.) in this environment.
#undef CONFIG_TCC_MALLOC_HOOKS
#undef HAVE_MEMALIGN
diff --git a/lib/libtcc1.c b/lib/libtcc1.c
index 0702a59..0e46618 100644
--- a/lib/libtcc1.c
+++ b/lib/libtcc1.c
@@ -107,10 +107,10 @@ union float_long {
};
/* XXX: we don't support several builtin supports for now */
-#if !defined(TCC_TARGET_X86_64) && !defined(TCC_TARGET_ARM)
+#if !defined __x86_64__ && !defined __arm__
/* XXX: use gcc/tcc intrinsic ? */
-#if defined(TCC_TARGET_I386)
+#if defined __i386__
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
__asm__ ("subl %5,%1\n\tsbbl %3,%0" \
: "=r" ((USItype) (sh)), \
@@ -589,7 +589,7 @@ long long __fixdfdi (double a1)
return s ? ret : -ret;
}
-#ifndef TCC_TARGET_ARM
+#ifndef __arm__
unsigned long long __fixunsxfdi (long double a1)
{
register union ldouble_long dl1;
diff --git a/lib/va_list.c b/lib/va_list.c
index 57dce0d..8749f46 100644
--- a/lib/va_list.c
+++ b/lib/va_list.c
@@ -1,6 +1,6 @@
/* va_list.c - tinycc support for va_list on X86_64 */
-#if defined TCC_TARGET_X86_64
+#if defined __x86_64__
/* Avoid include files, they may not be available when cross compiling */
extern void *memset(void *s, int c, __SIZE_TYPE__ n);