Unified · Split
| @@ -1,6 +1,11 @@ | ||
| 1 | 1 | version 0.9.24: |
| 2 | 2 | |
| 3 | −- Import 409,410: ARM EABI by Daniel Gl�ckner | |
| 3 | +- Import changesets (part 4) 428,457,460,467: defines for openbsd etc. | |
| 4 | + | |
| 5 | +- Use _WIN32 for a windows hosted tcc and define it for the PE target, | |
| 6 | + otherwise define __unix / __linux (Detlef Riekenberg) | |
| 7 | + | |
| 8 | +- Import changesets (part 3) 409,410: ARM EABI by Daniel Gl�ckner | |
| 4 | 9 | |
| 5 | 10 | - Some in-between fixes: |
| 6 | 11 | TCC -E no longer hangs with macro calls involving newlines. |
| @@ -5,7 +5,10 @@ include config.mak · 4 unmodified lines | ||
| 5 | 5 | |
| 6 | 6 | CFLAGS+=-g -Wall |
| 7 | 7 | ifndef CONFIG_WIN32 |
| 8 | −LIBS=-ldl | |
| 8 | +LIBS=-lm | |
| 9 | +ifndef CONFIG_NOLDL | |
| 10 | +LIBS+=-ldl | |
| 11 | +endif | |
| 9 | 12 | BCHECK_O=bcheck.o |
| 10 | 13 | endif |
| 11 | 14 | CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC |
| @@ -21,7 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #include <stdio.h> |
| 22 | 22 | #include <stdarg.h> |
| 23 | 23 | #include <string.h> |
| 24 | −#ifndef __FreeBSD__ | |
| 24 | +#if !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__OpenBSD__) | |
| 25 | 25 | #include <malloc.h> |
| 26 | 26 | #endif |
| 27 | 27 | |
| @@ -36,8 +36,9 @@ · 8 unmodified lines | ||
| 36 | 36 | |
| 37 | 37 | #define HAVE_MEMALIGN |
| 38 | 38 | |
| 39 | −#if defined(__FreeBSD__) || defined(__dietlibc__) | |
| 40 | −#warning Bound checking not fully supported on FreeBSD | |
| 39 | +#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__dietlibc__) \ | |
| 40 | + || defined(__UCLIBC__) || defined(__OpenBSD__) | |
| 41 | +#warning Bound checking not fully supported in this environment. | |
| 41 | 42 | #undef CONFIG_TCC_MALLOC_HOOKS |
| 42 | 43 | #undef HAVE_MEMALIGN |
| 43 | 44 | #endif |
| @@ -68,6 +68,12 @@ case $targetos in · 67 unmodified lines | ||
| 68 | 68 | MINGW32*) |
| 69 | 69 | mingw32="yes" |
| 70 | 70 | ;; |
| 71 | +DragonFly) | |
| 72 | +noldl="yes" | |
| 73 | +;; | |
| 74 | +OpenBSD) | |
| 75 | +noldl="yes" | |
| 76 | +;; | |
| 71 | 77 | *) ;; |
| 72 | 78 | esac |
| 73 | 79 | |
| @@ -142,15 +148,15 @@ if test -z "$cross_prefix" ; then · 68 unmodified lines | ||
| 142 | 148 | cat > $TMPC << EOF |
| 143 | 149 | #include <inttypes.h> |
| 144 | 150 | int main(int argc, char ** argv){ |
| 145 | − volatile uint32_t i=0x01234567; | |
| 146 | − return (*((uint8_t*)(&i))) == 0x67; | |
| 151 | + volatile uint32_t i=0x01234567; | |
| 152 | + return (*((uint8_t*)(&i))) == 0x67; | |
| 147 | 153 | } |
| 148 | 154 | EOF |
| 149 | 155 | |
| 150 | 156 | if $cc -o $TMPE $TMPC 2>/dev/null ; then |
| 151 | −$TMPE && bigendian="yes" | |
| 157 | + $TMPE && bigendian="yes" | |
| 152 | 158 | else |
| 153 | −echo big/little test failed | |
| 159 | + echo big/little test failed | |
| 154 | 160 | fi |
| 155 | 161 | |
| 156 | 162 | else |
| @@ -302,6 +308,9 @@ else · 145 unmodified lines | ||
| 302 | 308 | echo "Unsupported CPU" |
| 303 | 309 | exit 1 |
| 304 | 310 | fi |
| 311 | +if test "$noldl" = "yes" ; then | |
| 312 | + echo "CONFIG_NOLDL=yes" >> config.mak | |
| 313 | +fi | |
| 305 | 314 | if test "$mingw32" = "yes" ; then |
| 306 | 315 | echo "CONFIG_WIN32=yes" >> config.mak |
| 307 | 316 | echo "#define CONFIG_WIN32 1" >> $TMPH |
| @@ -327,7 +336,7 @@ if test "$source_path_used" = "yes" ; then · 19 unmodified lines | ||
| 327 | 336 | DIRS="tests" |
| 328 | 337 | FILES="Makefile tests/Makefile" |
| 329 | 338 | for dir in $DIRS ; do |
| 330 | − mkdir -p $dir | |
| 339 | + mkdir -p $dir | |
| 331 | 340 | done |
| 332 | 341 | for f in $FILES ; do |
| 333 | 342 | ln -sf $source_path/$f $f |
| @@ -337,9 +346,9 @@ echo "SRC_PATH=$source_path" >> config.mak · 3 unmodified lines | ||
| 337 | 346 | |
| 338 | 347 | diff $TMPH config.h >/dev/null 2>&1 |
| 339 | 348 | if test $? -ne 0 ; then |
| 340 | − mv -f $TMPH config.h | |
| 349 | + mv -f $TMPH config.h | |
| 341 | 350 | else |
| 342 | − echo "config.h is unchanged" | |
| 351 | + echo "config.h is unchanged" | |
| 343 | 352 | fi |
| 344 | 353 | |
| 345 | 354 | rm -f $TMPO $TMPC $TMPE $TMPS $TMPH |
| @@ -738,7 +738,8 @@ int __stdcall VirtualProtect(void*,unsigned long,unsigned long,unsigned long*); · 737 unmodified lines | ||
| 738 | 738 | #define strtof (float)strtod |
| 739 | 739 | #define strtoll (long long)strtol |
| 740 | 740 | #endif |
| 741 | −#elif defined(TCC_UCLIBC) || defined(__FreeBSD__) | |
| 741 | +#elif defined(TCC_UCLIBC) || defined(__FreeBSD__) || defined(__DragonFly__) \ | |
| 742 | + || defined(__OpenBSD__) | |
| 742 | 743 | /* currently incorrect */ |
| 743 | 744 | long double strtold(const char *nptr, char **endptr) |
| 744 | 745 | { |
| @@ -10013,9 +10014,15 @@ TCCState *tcc_new(void) · 9268 unmodified lines | ||
| 10013 | 10014 | tcc_define_symbol(s, "arm", NULL); |
| 10014 | 10015 | tcc_define_symbol(s, "__APCS_32__", NULL); |
| 10015 | 10016 | #endif |
| 10016 | −#if defined(linux) | |
| 10017 | +#ifdef TCC_TARGET_PE | |
| 10018 | + tcc_define_symbol(s, "_WIN32", NULL); | |
| 10019 | +#else | |
| 10020 | + tcc_define_symbol(s, "__unix__", NULL); | |
| 10021 | + tcc_define_symbol(s, "__unix", NULL); | |
| 10022 | +#if defined(__linux) | |
| 10017 | 10023 | tcc_define_symbol(s, "__linux__", NULL); |
| 10018 | − tcc_define_symbol(s, "linux", NULL); | |
| 10024 | + tcc_define_symbol(s, "__linux", NULL); | |
| 10025 | +#endif | |
| 10019 | 10026 | #endif |
| 10020 | 10027 | /* tiny C specific defines */ |
| 10021 | 10028 | tcc_define_symbol(s, "__TINYC__", NULL); |
| @@ -10025,7 +10032,6 @@ TCCState *tcc_new(void) · 3 unmodified lines | ||
| 10025 | 10032 | tcc_define_symbol(s, "__PTRDIFF_TYPE__", "int"); |
| 10026 | 10033 | #ifdef TCC_TARGET_PE |
| 10027 | 10034 | tcc_define_symbol(s, "__WCHAR_TYPE__", "unsigned short"); |
| 10028 | − tcc_define_symbol(s, "_WIN32", NULL); | |
| 10029 | 10035 | #else |
| 10030 | 10036 | tcc_define_symbol(s, "__WCHAR_TYPE__", "int"); |
| 10031 | 10037 | #endif |