Vendor tinycc and build the compositor in debug with it (just build/run)
CI / test (push) Successful in 38s
CI / test (push) Successful in 38s
moon adds -DMOONBIT_NATIVE_NO_SYS_HEADER whenever the C compiler is tcc, which compiles the system runtime out and breaks linking a standalone exe; the scripts/tcc/tcc wrapper drops that flag. just tcc-build builds third_party/tinycc into _build/tcc; build-release keeps the optimised system-cc build. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
49e91b4c01
commit
7a37039673
96 files changed
+83760
-4
No files matched your search
Vendored
+56
@@ -0,0 +1,56 @@
|
||||
/* ------------------------------------------------------------- */
|
||||
/* function to get a stack backtrace on demand with a message */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#undef __attribute__
|
||||
|
||||
#ifdef _WIN32
|
||||
# define DLL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
# define DLL_EXPORT
|
||||
#endif
|
||||
|
||||
/* Needed when using ...libtcc1-usegcc=yes in lib/Makefile */
|
||||
#if (defined(__GNUC__) && (__GNUC__ >= 6)) || defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wframe-address"
|
||||
#endif
|
||||
|
||||
typedef struct rt_frame {
|
||||
void *ip, *fp, *sp;
|
||||
} rt_frame;
|
||||
|
||||
__attribute__((weak))
|
||||
int _tcc_backtrace(rt_frame *f, const char *fmt, va_list ap);
|
||||
|
||||
DLL_EXPORT int tcc_backtrace(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
if (_tcc_backtrace) {
|
||||
rt_frame f;
|
||||
f.fp = __builtin_frame_address(1);
|
||||
f.ip = __builtin_return_address(0);
|
||||
va_start(ap, fmt);
|
||||
ret = _tcc_backtrace(&f, fmt, ap);
|
||||
va_end(ap);
|
||||
} else {
|
||||
const char *p, *nl = "\n";
|
||||
if (fmt[0] == '^' && (p = strchr(fmt + 1, fmt[0])))
|
||||
fmt = p + 1;
|
||||
if (fmt[0] == '\001')
|
||||
++fmt, nl = "";
|
||||
va_start(ap, fmt);
|
||||
ret = vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
fprintf(stderr, "%s", nl), fflush(stderr);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if (defined(__GNUC__) && (__GNUC__ >= 6)) || defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
Reference in new issue
Block a user