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