mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Get GCC to mostly build with Cosmo
This commit is contained in:
parent
2eb7148474
commit
9b55dbe417
54 changed files with 113 additions and 132 deletions
|
@ -111,11 +111,11 @@ int WinThreadLaunch(void *arg, // rdi
|
|||
// 2. windows owns the stack memory right now
|
||||
// we need win32 raw imports because:
|
||||
// 1. generated thunks are function logged
|
||||
noasan noinstrument static textwindows wontreturn void //
|
||||
WinThreadEntry(int rdi, // rcx
|
||||
int rsi, // rdx
|
||||
int rdx, // r8
|
||||
struct CloneArgs *wt) { // r9
|
||||
noasan dontinstrument static textwindows wontreturn void //
|
||||
WinThreadEntry(int rdi, // rcx
|
||||
int rsi, // rdx
|
||||
int rdx, // r8
|
||||
struct CloneArgs *wt) { // r9
|
||||
int rc;
|
||||
if (wt->tls) __set_tls_win32(wt->tls);
|
||||
*wt->ctid = wt->tid;
|
||||
|
|
|
@ -37,9 +37,8 @@ forceinline char *MemChr(const char *s, unsigned char c, unsigned long n) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static textwindows noasan noinstrument axdx_t Recode16to8(char *dst,
|
||||
size_t dstsize,
|
||||
const char16_t *src) {
|
||||
static textwindows noasan dontinstrument axdx_t
|
||||
Recode16to8(char *dst, size_t dstsize, const char16_t *src) {
|
||||
bool v;
|
||||
axdx_t r;
|
||||
uint64_t w;
|
||||
|
@ -72,7 +71,7 @@ static textwindows noasan noinstrument axdx_t Recode16to8(char *dst,
|
|||
return r;
|
||||
}
|
||||
|
||||
textwindows noinstrument noasan void FixPath(char *path) {
|
||||
textwindows dontinstrument noasan void FixPath(char *path) {
|
||||
char *p;
|
||||
size_t i;
|
||||
|
||||
|
@ -112,9 +111,9 @@ textwindows noinstrument noasan void FixPath(char *path) {
|
|||
// @param envp stores NULL-terminated string pointer list (optional)
|
||||
// @param max is the pointer count capacity of envp
|
||||
// @return number of variables decoded, excluding NULL-terminator
|
||||
textwindows noasan noinstrument int GetDosEnviron(const char16_t *env,
|
||||
char *buf, size_t size,
|
||||
char **envp, size_t max) {
|
||||
textwindows noasan dontinstrument int GetDosEnviron(const char16_t *env,
|
||||
char *buf, size_t size,
|
||||
char **envp, size_t max) {
|
||||
int i;
|
||||
char *p;
|
||||
axdx_t r;
|
||||
|
|
|
@ -27,7 +27,7 @@ extern _Hide struct SymbolTable *__symtab;
|
|||
* @param t if null will be auto-populated only if already open
|
||||
* @return index or -1 if nothing found
|
||||
*/
|
||||
noinstrument privileged int __get_symbol(struct SymbolTable *t, intptr_t a) {
|
||||
dontinstrument privileged int __get_symbol(struct SymbolTable *t, intptr_t a) {
|
||||
// we need privileged because:
|
||||
// kprintf is privileged and it depends on this
|
||||
// we don't want function tracing because:
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/runtime/symbols.internal.h"
|
||||
|
||||
privileged noinstrument noasan noubsan char *__get_symbol_name(
|
||||
privileged dontinstrument noasan noubsan char *__get_symbol_name(
|
||||
struct SymbolTable *t, int s) {
|
||||
/* asan runtime depends on this function */
|
||||
if (t && s != -1) {
|
||||
|
|
|
@ -106,7 +106,8 @@ static privileged void HookFunction(code_t *func, void *dest) {
|
|||
* @param st can be obtained using `GetSymbolTable()`
|
||||
* @see ape/ape.lds
|
||||
*/
|
||||
privileged noinstrument noasan int __hook(void *dest, struct SymbolTable *st) {
|
||||
privileged dontinstrument noasan int __hook(void *dest,
|
||||
struct SymbolTable *st) {
|
||||
long i;
|
||||
sigset_t mask;
|
||||
code_t *p, *pe;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/kprintf.h"
|
||||
|
||||
privileged noasan noinstrument void __stack_chk_fail(void) {
|
||||
void __stack_chk_fail(void) {
|
||||
kprintf("stack smashed\n");
|
||||
__builtin_trap();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue