mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 03:38:31 +00:00
Remove some legacy cruft
Function trace logs will report stack usage accurately. It won't include the argv/environ block. Our clone() polyfill is now simpler and does not use as much stack memory. Function call tracing on x86 is now faster too
This commit is contained in:
parent
8db646f6b2
commit
a15958edc6
21 changed files with 291 additions and 467 deletions
|
@ -84,7 +84,8 @@ o/$(MODE)/libc/sysv/sysret.o: private \
|
|||
CFLAGS += \
|
||||
-ffreestanding \
|
||||
-fno-stack-protector \
|
||||
-fno-sanitize=all
|
||||
-fno-sanitize=all \
|
||||
-mgeneral-regs-only
|
||||
|
||||
ifeq ($(ARCH),aarch64)
|
||||
o/$(MODE)/libc/sysv/sysv.o: private \
|
||||
|
|
|
@ -35,8 +35,10 @@ errno_t __errno;
|
|||
|
||||
/**
|
||||
* Returns address of `errno` variable.
|
||||
*
|
||||
* This function promises to not clobber argument registers.
|
||||
*/
|
||||
errno_t *__errno_location(void) {
|
||||
nocallersavedregisters errno_t *__errno_location(void) {
|
||||
if (__tls_enabled) {
|
||||
return &__get_tls()->tib_errno;
|
||||
} else {
|
||||
|
|
|
@ -187,7 +187,7 @@ systemfive_error:
|
|||
#endif
|
||||
systemfive_errno:
|
||||
xchg %eax,%ecx
|
||||
.errno
|
||||
call __errno_location
|
||||
mov %ecx,(%rax) // normalize to c library convention
|
||||
push $-1 // negative one is only error result
|
||||
pop %rax // the push pop is to save code size
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue