History

Import changesets (part 4) 428,457,460,467: defines for openbsd etc.

grischka committed 18 years ago

Commit 6c96c411 parent f4665775 files · +40 −16Browse files

Unified · Split

5 files
  1. Changelog +6 −1
  2. Makefile +4 −1
  3. bcheck.c +4 −3
  4. configure +16 −7
  5. tcc.c +10 −4
Changelog+6−1
@@ -1,6 +1,11 @@
11 version 0.9.24:
22
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
49
510 - Some in-between fixes:
611 TCC -E no longer hangs with macro calls involving newlines.
Makefile+4−1
@@ -5,7 +5,10 @@ include config.mak · 4 unmodified lines
55
66 CFLAGS+=-g -Wall
77 ifndef CONFIG_WIN32
8−LIBS=-ldl
8+LIBS=-lm
9+ifndef CONFIG_NOLDL
10+LIBS+=-ldl
11+endif
912 BCHECK_O=bcheck.o
1013 endif
1114 CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC
bcheck.c+4−3
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #include <stdio.h>
2222 #include <stdarg.h>
2323 #include <string.h>
24−#ifndef __FreeBSD__
24+#if !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__OpenBSD__)
2525 #include <malloc.h>
2626 #endif
2727
@@ -36,8 +36,9 @@ · 8 unmodified lines
3636
3737 #define HAVE_MEMALIGN
3838
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.
4142 #undef CONFIG_TCC_MALLOC_HOOKS
4243 #undef HAVE_MEMALIGN
4344 #endif
configure+16−7
@@ -68,6 +68,12 @@ case $targetos in · 67 unmodified lines
6868 MINGW32*)
6969 mingw32="yes"
7070 ;;
71+DragonFly)
72+noldl="yes"
73+;;
74+OpenBSD)
75+noldl="yes"
76+;;
7177 *) ;;
7278 esac
7379
@@ -142,15 +148,15 @@ if test -z "$cross_prefix" ; then · 68 unmodified lines
142148 cat > $TMPC << EOF
143149 #include <inttypes.h>
144150 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;
147153 }
148154 EOF
149155
150156 if $cc -o $TMPE $TMPC 2>/dev/null ; then
151−$TMPE && bigendian="yes"
157+ $TMPE && bigendian="yes"
152158 else
153−echo big/little test failed
159+ echo big/little test failed
154160 fi
155161
156162 else
@@ -302,6 +308,9 @@ else · 145 unmodified lines
302308 echo "Unsupported CPU"
303309 exit 1
304310 fi
311+if test "$noldl" = "yes" ; then
312+ echo "CONFIG_NOLDL=yes" >> config.mak
313+fi
305314 if test "$mingw32" = "yes" ; then
306315 echo "CONFIG_WIN32=yes" >> config.mak
307316 echo "#define CONFIG_WIN32 1" >> $TMPH
@@ -327,7 +336,7 @@ if test "$source_path_used" = "yes" ; then · 19 unmodified lines
327336 DIRS="tests"
328337 FILES="Makefile tests/Makefile"
329338 for dir in $DIRS ; do
330− mkdir -p $dir
339+ mkdir -p $dir
331340 done
332341 for f in $FILES ; do
333342 ln -sf $source_path/$f $f
@@ -337,9 +346,9 @@ echo "SRC_PATH=$source_path" >> config.mak · 3 unmodified lines
337346
338347 diff $TMPH config.h >/dev/null 2>&1
339348 if test $? -ne 0 ; then
340− mv -f $TMPH config.h
349+ mv -f $TMPH config.h
341350 else
342− echo "config.h is unchanged"
351+ echo "config.h is unchanged"
343352 fi
344353
345354 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
tcc.c+10−4
@@ -738,7 +738,8 @@ int __stdcall VirtualProtect(void*,unsigned long,unsigned long,unsigned long*); · 737 unmodified lines
738738 #define strtof (float)strtod
739739 #define strtoll (long long)strtol
740740 #endif
741−#elif defined(TCC_UCLIBC) || defined(__FreeBSD__)
741+#elif defined(TCC_UCLIBC) || defined(__FreeBSD__) || defined(__DragonFly__) \
742+ || defined(__OpenBSD__)
742743 /* currently incorrect */
743744 long double strtold(const char *nptr, char **endptr)
744745 {
@@ -10013,9 +10014,15 @@ TCCState *tcc_new(void) · 9268 unmodified lines
1001310014 tcc_define_symbol(s, "arm", NULL);
1001410015 tcc_define_symbol(s, "__APCS_32__", NULL);
1001510016 #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)
1001710023 tcc_define_symbol(s, "__linux__", NULL);
10018− tcc_define_symbol(s, "linux", NULL);
10024+ tcc_define_symbol(s, "__linux", NULL);
10025+#endif
1001910026 #endif
1002010027 /* tiny C specific defines */
1002110028 tcc_define_symbol(s, "__TINYC__", NULL);
@@ -10025,7 +10032,6 @@ TCCState *tcc_new(void) · 3 unmodified lines
1002510032 tcc_define_symbol(s, "__PTRDIFF_TYPE__", "int");
1002610033 #ifdef TCC_TARGET_PE
1002710034 tcc_define_symbol(s, "__WCHAR_TYPE__", "unsigned short");
10028− tcc_define_symbol(s, "_WIN32", NULL);
1002910035 #else
1003010036 tcc_define_symbol(s, "__WCHAR_TYPE__", "int");
1003110037 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t