mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-13 05:10:07 +08:00
tccrun: update for apple and openbsd
Apple needs CONFIG_RUNMEM_RO=1 I now only set CONFIG_RUNMEM_RO=0 on _WIN32 Openbsd does not have malloc.h so remove some code Also fix some warnings when compiling lib with gcc
This commit is contained in:
parent
4e91d38ddc
commit
f9cb198aa8
@ -69,6 +69,7 @@ void exit(int code)
|
||||
f.fp = 0;
|
||||
f.ip = exit;
|
||||
__rt_exit(&f, code);
|
||||
for (;;); // avoid noreturn warning
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
|
19
tccrun.c
19
tccrun.c
@ -91,17 +91,6 @@ static void *win64_add_function_table(TCCState *s1);
|
||||
static void win64_del_function_table(void *);
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
# define CONFIG_RUNMEM_ALIGNED 0
|
||||
#else
|
||||
# ifndef CONFIG_RUNMEM_ALIGNED
|
||||
# define CONFIG_RUNMEM_ALIGNED 1
|
||||
# endif
|
||||
# if CONFIG_RUNMEM_ALIGNED
|
||||
# include <malloc.h> /* memalign() */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !_WIN32 && !__APPLE__
|
||||
//#define HAVE_SELINUX 1
|
||||
#endif
|
||||
@ -286,7 +275,11 @@ static void cleanup_sections(TCCState *s1)
|
||||
/* 0 = .text rwx other rw */
|
||||
/* 1 = .text rx .rdata r .data/.bss rw */
|
||||
#ifndef CONFIG_RUNMEM_RO
|
||||
# define CONFIG_RUNMEM_RO 0
|
||||
# ifdef _WIN32
|
||||
# define CONFIG_RUNMEM_RO 0
|
||||
# else
|
||||
# define CONFIG_RUNMEM_RO 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* relocate code. Return -1 on error, required size if ptr is NULL,
|
||||
@ -1184,7 +1177,9 @@ int _tcc_backtrace(rt_frame *f, const char *fmt, va_list ap)
|
||||
}
|
||||
rt_printf("\n");
|
||||
|
||||
#ifndef CONFIG_TCC_BACKTRACE_ONLY
|
||||
check_break:
|
||||
#endif
|
||||
if (rc2
|
||||
&& bi.func_pc
|
||||
&& bi.func_pc == (addr_t)rc2->top_func)
|
||||
|
Loading…
Reference in New Issue
Block a user