Import changesets (part 4) 428,457,460,467: defines for openbsd etc.
This commit is contained in:
parent
f466577673
commit
6c96c41ee4
5 changed files with 40 additions and 16 deletions
|
@ -1,6 +1,11 @@
|
||||||
version 0.9.24:
|
version 0.9.24:
|
||||||
|
|
||||||
- Import 409,410: ARM EABI by Daniel Glöckner
|
- Import changesets (part 4) 428,457,460,467: defines for openbsd etc.
|
||||||
|
|
||||||
|
- Use _WIN32 for a windows hosted tcc and define it for the PE target,
|
||||||
|
otherwise define __unix / __linux (Detlef Riekenberg)
|
||||||
|
|
||||||
|
- Import changesets (part 3) 409,410: ARM EABI by Daniel Glöckner
|
||||||
|
|
||||||
- Some in-between fixes:
|
- Some in-between fixes:
|
||||||
TCC -E no longer hangs with macro calls involving newlines.
|
TCC -E no longer hangs with macro calls involving newlines.
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -5,7 +5,10 @@ include config.mak
|
||||||
|
|
||||||
CFLAGS+=-g -Wall
|
CFLAGS+=-g -Wall
|
||||||
ifndef CONFIG_WIN32
|
ifndef CONFIG_WIN32
|
||||||
LIBS=-ldl
|
LIBS=-lm
|
||||||
|
ifndef CONFIG_NOLDL
|
||||||
|
LIBS+=-ldl
|
||||||
|
endif
|
||||||
BCHECK_O=bcheck.o
|
BCHECK_O=bcheck.o
|
||||||
endif
|
endif
|
||||||
CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC
|
CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC
|
||||||
|
|
7
bcheck.c
7
bcheck.c
|
@ -21,7 +21,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifndef __FreeBSD__
|
#if !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__OpenBSD__)
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -36,8 +36,9 @@
|
||||||
|
|
||||||
#define HAVE_MEMALIGN
|
#define HAVE_MEMALIGN
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__dietlibc__)
|
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__dietlibc__) \
|
||||||
#warning Bound checking not fully supported on FreeBSD
|
|| defined(__UCLIBC__) || defined(__OpenBSD__)
|
||||||
|
#warning Bound checking not fully supported in this environment.
|
||||||
#undef CONFIG_TCC_MALLOC_HOOKS
|
#undef CONFIG_TCC_MALLOC_HOOKS
|
||||||
#undef HAVE_MEMALIGN
|
#undef HAVE_MEMALIGN
|
||||||
#endif
|
#endif
|
||||||
|
|
23
configure
vendored
23
configure
vendored
|
@ -68,6 +68,12 @@ case $targetos in
|
||||||
MINGW32*)
|
MINGW32*)
|
||||||
mingw32="yes"
|
mingw32="yes"
|
||||||
;;
|
;;
|
||||||
|
DragonFly)
|
||||||
|
noldl="yes"
|
||||||
|
;;
|
||||||
|
OpenBSD)
|
||||||
|
noldl="yes"
|
||||||
|
;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -142,15 +148,15 @@ if test -z "$cross_prefix" ; then
|
||||||
cat > $TMPC << EOF
|
cat > $TMPC << EOF
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
int main(int argc, char ** argv){
|
int main(int argc, char ** argv){
|
||||||
volatile uint32_t i=0x01234567;
|
volatile uint32_t i=0x01234567;
|
||||||
return (*((uint8_t*)(&i))) == 0x67;
|
return (*((uint8_t*)(&i))) == 0x67;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if $cc -o $TMPE $TMPC 2>/dev/null ; then
|
if $cc -o $TMPE $TMPC 2>/dev/null ; then
|
||||||
$TMPE && bigendian="yes"
|
$TMPE && bigendian="yes"
|
||||||
else
|
else
|
||||||
echo big/little test failed
|
echo big/little test failed
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -302,6 +308,9 @@ else
|
||||||
echo "Unsupported CPU"
|
echo "Unsupported CPU"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if test "$noldl" = "yes" ; then
|
||||||
|
echo "CONFIG_NOLDL=yes" >> config.mak
|
||||||
|
fi
|
||||||
if test "$mingw32" = "yes" ; then
|
if test "$mingw32" = "yes" ; then
|
||||||
echo "CONFIG_WIN32=yes" >> config.mak
|
echo "CONFIG_WIN32=yes" >> config.mak
|
||||||
echo "#define CONFIG_WIN32 1" >> $TMPH
|
echo "#define CONFIG_WIN32 1" >> $TMPH
|
||||||
|
@ -327,7 +336,7 @@ if test "$source_path_used" = "yes" ; then
|
||||||
DIRS="tests"
|
DIRS="tests"
|
||||||
FILES="Makefile tests/Makefile"
|
FILES="Makefile tests/Makefile"
|
||||||
for dir in $DIRS ; do
|
for dir in $DIRS ; do
|
||||||
mkdir -p $dir
|
mkdir -p $dir
|
||||||
done
|
done
|
||||||
for f in $FILES ; do
|
for f in $FILES ; do
|
||||||
ln -sf $source_path/$f $f
|
ln -sf $source_path/$f $f
|
||||||
|
@ -337,9 +346,9 @@ echo "SRC_PATH=$source_path" >> config.mak
|
||||||
|
|
||||||
diff $TMPH config.h >/dev/null 2>&1
|
diff $TMPH config.h >/dev/null 2>&1
|
||||||
if test $? -ne 0 ; then
|
if test $? -ne 0 ; then
|
||||||
mv -f $TMPH config.h
|
mv -f $TMPH config.h
|
||||||
else
|
else
|
||||||
echo "config.h is unchanged"
|
echo "config.h is unchanged"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
|
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
|
||||||
|
|
14
tcc.c
14
tcc.c
|
@ -738,7 +738,8 @@ int __stdcall VirtualProtect(void*,unsigned long,unsigned long,unsigned long*);
|
||||||
#define strtof (float)strtod
|
#define strtof (float)strtod
|
||||||
#define strtoll (long long)strtol
|
#define strtoll (long long)strtol
|
||||||
#endif
|
#endif
|
||||||
#elif defined(TCC_UCLIBC) || defined(__FreeBSD__)
|
#elif defined(TCC_UCLIBC) || defined(__FreeBSD__) || defined(__DragonFly__) \
|
||||||
|
|| defined(__OpenBSD__)
|
||||||
/* currently incorrect */
|
/* currently incorrect */
|
||||||
long double strtold(const char *nptr, char **endptr)
|
long double strtold(const char *nptr, char **endptr)
|
||||||
{
|
{
|
||||||
|
@ -10013,9 +10014,15 @@ TCCState *tcc_new(void)
|
||||||
tcc_define_symbol(s, "arm", NULL);
|
tcc_define_symbol(s, "arm", NULL);
|
||||||
tcc_define_symbol(s, "__APCS_32__", NULL);
|
tcc_define_symbol(s, "__APCS_32__", NULL);
|
||||||
#endif
|
#endif
|
||||||
#if defined(linux)
|
#ifdef TCC_TARGET_PE
|
||||||
|
tcc_define_symbol(s, "_WIN32", NULL);
|
||||||
|
#else
|
||||||
|
tcc_define_symbol(s, "__unix__", NULL);
|
||||||
|
tcc_define_symbol(s, "__unix", NULL);
|
||||||
|
#if defined(__linux)
|
||||||
tcc_define_symbol(s, "__linux__", NULL);
|
tcc_define_symbol(s, "__linux__", NULL);
|
||||||
tcc_define_symbol(s, "linux", NULL);
|
tcc_define_symbol(s, "__linux", NULL);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
/* tiny C specific defines */
|
/* tiny C specific defines */
|
||||||
tcc_define_symbol(s, "__TINYC__", NULL);
|
tcc_define_symbol(s, "__TINYC__", NULL);
|
||||||
|
@ -10025,7 +10032,6 @@ TCCState *tcc_new(void)
|
||||||
tcc_define_symbol(s, "__PTRDIFF_TYPE__", "int");
|
tcc_define_symbol(s, "__PTRDIFF_TYPE__", "int");
|
||||||
#ifdef TCC_TARGET_PE
|
#ifdef TCC_TARGET_PE
|
||||||
tcc_define_symbol(s, "__WCHAR_TYPE__", "unsigned short");
|
tcc_define_symbol(s, "__WCHAR_TYPE__", "unsigned short");
|
||||||
tcc_define_symbol(s, "_WIN32", NULL);
|
|
||||||
#else
|
#else
|
||||||
tcc_define_symbol(s, "__WCHAR_TYPE__", "int");
|
tcc_define_symbol(s, "__WCHAR_TYPE__", "int");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue