mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 02:38:31 +00:00
Make improvements
- Fix unused local variable errors - Remove yoinks from sigaction() header - Add nox87 and aarch64 to github actions - Fix cosmocc -fportcosmo in linking mode - It's now possible to build `make m=llvm o/llvm/libc`
This commit is contained in:
parent
3dc86ce154
commit
f7ae50462a
118 changed files with 342 additions and 392 deletions
|
@ -169,7 +169,7 @@ asm("XnuThreadThunk:\n\t"
|
|||
"push\t%rax\n\t"
|
||||
"jmp\tXnuThreadMain\n\t"
|
||||
".size\tXnuThreadThunk,.-XnuThreadThunk");
|
||||
__attribute__((__used__, __no_reorder__))
|
||||
__attribute__((__used__))
|
||||
|
||||
static wontreturn void
|
||||
XnuThreadMain(void *pthread, // rdi
|
||||
|
|
|
@ -121,7 +121,7 @@ textstartup void __enable_tls(void) {
|
|||
|
||||
#ifdef __x86_64__
|
||||
|
||||
siz = ROUNDUP(I(_tls_size) + sizeof(*tib), _Alignof(__static_tls));
|
||||
siz = ROUNDUP(I(_tls_size) + sizeof(*tib), TLS_ALIGNMENT);
|
||||
if (siz <= sizeof(__static_tls)) {
|
||||
// if tls requirement is small then use the static tls block
|
||||
// which helps avoid a system call for appes with little tls
|
||||
|
|
|
@ -26,7 +26,7 @@ ftrace_hook:
|
|||
// like __errno_location which can be called from an inline asm()
|
||||
// statement. It's nice to have the flexibility anyway.
|
||||
|
||||
cmp $0,__ftrace(%rip)
|
||||
cmpl $0,__ftrace(%rip)
|
||||
jle 1f
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
|
|
|
@ -54,8 +54,6 @@ int __inflate(void *out, size_t outsize, const void *in, size_t insize) {
|
|||
rc = 0;
|
||||
} else if (rc == Z_OK) {
|
||||
rc = Z_STREAM_END; // coerce to nonzero
|
||||
} else {
|
||||
rc = rc;
|
||||
}
|
||||
} else {
|
||||
rc = _puff(out, &outsize, in, &insize);
|
||||
|
|
|
@ -31,13 +31,9 @@ static inline noasan void *GetFrameAddr(int f) {
|
|||
}
|
||||
|
||||
noasan void ReleaseMemoryNt(struct MemoryIntervals *mm, int l, int r) {
|
||||
int i, ok;
|
||||
size_t size;
|
||||
char *addr, *last;
|
||||
int i;
|
||||
for (i = l; i <= r; ++i) {
|
||||
addr = GetFrameAddr(mm->p[i].x);
|
||||
last = GetFrameAddr(mm->p[i].y);
|
||||
UnmapViewOfFile(addr);
|
||||
UnmapViewOfFile(GetFrameAddr(mm->p[i].x));
|
||||
CloseHandle(mm->p[i].h);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,7 +128,8 @@ o/$(MODE)/libc/runtime/enable_threads.o \
|
|||
o/$(MODE)/libc/runtime/morph_tls.o: private \
|
||||
CFLAGS += \
|
||||
-ffreestanding \
|
||||
-fno-sanitize=all
|
||||
-fno-sanitize=all \
|
||||
-fno-stack-protector
|
||||
|
||||
# TODO(jart): We need a way to avoid WinThreadEntry() being hooked.
|
||||
o/$(MODE)/libc/runtime/clone.o: private \
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2020 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
│ above copyright notice and this permission notice appear in all copies. │
|
||||
│ │
|
||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
||||
__attribute__((__weak__)) void __stack_chk_fail(void) {
|
||||
tinyprint(2, program_invocation_name, ": stack smashed\n", NULL);
|
||||
__builtin_trap();
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2020 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
│ above copyright notice and this permission notice appear in all copies. │
|
||||
│ │
|
||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/runtime/internal.h"
|
||||
|
||||
__attribute__((__weak__)) void __stack_chk_fail_local(void) {
|
||||
__stack_chk_fail();
|
||||
}
|
|
@ -154,6 +154,7 @@ __msabi static textwindows wontreturn void WinMainNew(const char16_t *cmdline) {
|
|||
: (DescribeNtConsoleInFlags)(inflagsbuf, kConsoleModes[i]),
|
||||
rc);
|
||||
}
|
||||
(void)rc;
|
||||
}
|
||||
_Static_assert(sizeof(struct WinArgs) % FRAMESIZE == 0, "");
|
||||
_mmi.p = _mmi.s;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue