From 410ecf02eece802e46f11a3bbc909769420fab4f Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Sat, 7 Mar 2026 15:11:00 +0100 Subject: [PATCH] tcc build for linux, basic changes --- build.sh | 16 ++++------------ src/core/core_basic.h | 4 +++- 2 files changed, 7 insertions(+), 13 deletions(-) mode change 100644 => 100755 build.sh diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index 46a9de1..54227d9 --- a/build.sh +++ b/build.sh @@ -3,15 +3,7 @@ cd "$(dirname "$0")" if [ ! -d build ]; then mkdir build fi -pushd build -clang ../src/testing/testing_main.c -g -popd - -# if [ ! -f build/build_tool.exe ]; then -# echo build_tool rebuild -# cd build -# clang ../src/meta/build_tool.c -ldl -lbacktrace -o build_tool.exe -g -fdiagnostics-absolute-paths -Wno-single-bit-bitfield-constant-conversion -Wno-unsequenced -# cd .. -# fi - -# ./build/build_tool.exe clang ../build_file.c -o build_file.exe -ldl -lm -lbacktrace -g -Wall -Wextra -Wno-missing-braces -Wno-missing-field-initializers -Wno-single-bit-bitfield-constant-conversion -fdiagnostics-absolute-paths -Wno-writable-strings -Wno-unsequenced +cd build +# clang ../src/testing/testing_main.c -o testing_main -I../src/ -ldl -lm -lbacktrace -g -Wall -Wextra -Wno-missing-braces -Wno-missing-field-initializers -Wno-single-bit-bitfield-constant-conversion -fdiagnostics-absolute-paths -Wno-writable-strings -Wno-unsequenced +tcc $(realpath ../src/testing/testing_main.c) -o testing_main -I$(realpath ../src/) -ldl -lm -Wall -Wextra +./testing_main \ No newline at end of file diff --git a/src/core/core_basic.h b/src/core/core_basic.h index a4f1ce7..4f270a4 100644 --- a/src/core/core_basic.h +++ b/src/core/core_basic.h @@ -259,12 +259,14 @@ int IsDebuggerPresent(void); #elif PLATFORM_WASM void wasm_trap(void); #define debug__break() wasm_trap() +#elif PLATFORM_TCC +#define debug__break() raise(SIGTRAP) #else #define debug__break() __builtin_trap() #endif #define debug_break() (debug__break(), 1) -#if PLATFORM_WASM +#if PLATFORM_WASM | PLATFORM_TCC #define gb_thread #elif PLATFORM_GCC | PLATFORM_CLANG #define gb_thread __thread