initial tests

This commit is contained in:
2021-06-25 20:26:13 +02:00
commit d40ebbbff5
48 changed files with 21542 additions and 0 deletions

45
cflags Executable file
View File

@@ -0,0 +1,45 @@
#!/bin/sh
cflags="-std=c89 -pedantic"
cflags="$cflags -Os"
cflags="$cflags -fno-strict-aliasing"
cflags="$cflags -Wall"
cflags="$cflags -ffunction-sections -fdata-sections"
if [ -z $DBGINFO ]; then
cflags="$cflags -g0 -fno-unwind-tables -s"
cflags="$cflags -fno-asynchronous-unwind-tables"
cflags="$cflags -fno-stack-protector"
else
cflags="$cflags -g -fsanitize=address -fsanitize=leak "
cflags="$cflags -fsanitize=signed-integer-overflow -fsanitize=undefined -static-libasan"
fi
if [ $(uname) = "Darwin" ]; then
cflags="$cflags -Wl,-dead_strip"
else
cflags="$cflags -Wl,--gc-sections,--build-id=none"
fi
ldflags="-lm"
cflags="$cflags $CFLAGS"
ldflags="$ldflags $LDFLAGS"
cc="$CC"
if [ $(uname) = "Darwin" ]; then
cc=${cc:-clang}
else
cc=${cc:-gcc}
fi
uname -a > flags.log
echo $cc >> flags.log
echo $cflags >> flags.log
echo $ldflags >> flags.log
$cc --version >> flags.log
$cc -dumpmachine >> flags.log
export cflags="$cflags"
export ldflags="$ldflags"
export cc="$cc"