mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-23 22:49:00 +00:00
Freshen build/bootstrap/cocmd
See https://news.ycombinator.com/item?id=41055121
This commit is contained in:
parent
8621034d42
commit
e18fe1e112
11 changed files with 15 additions and 18 deletions
13
Makefile
13
Makefile
|
@ -115,10 +115,8 @@ ZIPCOPY = $(BOOTSTRAP)/zipcopy
|
|||
PECHECK = $(BOOTSTRAP)/pecheck
|
||||
FIXUPOBJ = $(BOOTSTRAP)/fixupobj
|
||||
OBJBINCOPY = $(BOOTSTRAP)/objbincopy
|
||||
MKDIR = build/bootstrap/mkdir -p
|
||||
COMPILE = build/bootstrap/compile -V9 -M2048m -P8192 $(QUOTA)
|
||||
|
||||
IGNORE := $(shell $(MKDIR) $(TMPDIR))
|
||||
MKDIR = $(BOOTSTRAP)/mkdir.ape -p
|
||||
COMPILE = $(BOOTSTRAP)/compile.ape -V9 -M2048m -P8192 $(QUOTA)
|
||||
|
||||
# the default build modes is empty string
|
||||
# on x86_64 hosts, MODE= is the same as MODE=x86_64
|
||||
|
@ -141,7 +139,6 @@ HOSTS ?= freebsd rhel7 xnu openbsd netbsd win10
|
|||
endif
|
||||
|
||||
ZIPOBJ_FLAGS += -a$(ARCH)
|
||||
IGNORE := $(shell $(MKDIR) $(TMPDIR))
|
||||
|
||||
export ADDR2LINE
|
||||
export LC_ALL
|
||||
|
@ -150,10 +147,12 @@ export MODE
|
|||
export SOURCE_DATE_EPOCH
|
||||
export TMPDIR
|
||||
|
||||
COSMOCC = .cosmocc/3.6.0
|
||||
COSMOCC = .cosmocc/3.6.2
|
||||
BOOTSTRAP = $(COSMOCC)/bin
|
||||
TOOLCHAIN = $(COSMOCC)/bin/$(ARCH)-linux-cosmo-
|
||||
DOWNLOAD := $(shell build/download-cosmocc.sh $(COSMOCC) 3.6.0 4918c45ac3e0972ff260e2a249e25716881e39fb679d5e714ae216a2ef6c3f7e)
|
||||
DOWNLOAD := $(shell build/download-cosmocc.sh $(COSMOCC) 3.6.2 268aa82d9bfd774f76951b250f87b8edcefd5c754b8b409e1639641e8bd8d5bc)
|
||||
|
||||
IGNORE := $(shell $(MKDIR) $(TMPDIR))
|
||||
|
||||
AS = $(TOOLCHAIN)as
|
||||
CC = $(TOOLCHAIN)gcc
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -16,6 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/createfileflags.internal.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/sig.internal.h"
|
||||
|
@ -155,11 +156,11 @@ static textwindows void FreeKeystrokeImpl(struct Dll *key) {
|
|||
|
||||
static textwindows struct Keystroke *NewKeystroke(void) {
|
||||
struct Dll *e = dll_first(__keystroke.free);
|
||||
if (!e) // See MIN(freekeys) before ReadConsoleInput()
|
||||
__builtin_trap();
|
||||
struct Keystroke *k = KEYSTROKE_CONTAINER(e);
|
||||
dll_remove(&__keystroke.free, &k->elem);
|
||||
--__keystroke.freekeys;
|
||||
// TODO(jart): What's wrong with GCC 12.3?
|
||||
asm("" : "+r"(k));
|
||||
k->buflen = 0;
|
||||
return k;
|
||||
}
|
||||
|
@ -560,18 +561,15 @@ static textwindows void IngestConsoleInput(void) {
|
|||
return;
|
||||
if (__keystroke.end_of_file)
|
||||
return;
|
||||
if (!GetNumberOfConsoleInputEvents(__keystroke.cin, &n)) {
|
||||
if (!GetNumberOfConsoleInputEvents(__keystroke.cin, &n))
|
||||
goto UnexpectedEof;
|
||||
}
|
||||
if (!n)
|
||||
return;
|
||||
n = MIN(__keystroke.freekeys, MIN(ARRAYLEN(records), n));
|
||||
if (!ReadConsoleInput(__keystroke.cin, records, n, &n)) {
|
||||
if (!ReadConsoleInput(__keystroke.cin, records, n, &n))
|
||||
goto UnexpectedEof;
|
||||
}
|
||||
for (i = 0; i < n && !__keystroke.end_of_file; ++i) {
|
||||
for (i = 0; i < n && !__keystroke.end_of_file; ++i)
|
||||
IngestConsoleInputRecord(records + i);
|
||||
}
|
||||
}
|
||||
UnexpectedEof:
|
||||
STRACE("console read error %d", GetLastError());
|
||||
|
|
|
@ -38,7 +38,7 @@ size_t wcsnrtombs(char *dst, const wchar_t **wcs, size_t wn, size_t n,
|
|||
if (!dst)
|
||||
n = 0;
|
||||
while (ws && wn) {
|
||||
char tmp[MB_LEN_MAX];
|
||||
char tmp[MB_LEN_MAX] = {0};
|
||||
size_t l = wcrtomb(n < MB_LEN_MAX ? tmp : dst, *ws, 0);
|
||||
if (l == -1) {
|
||||
cnt = -1;
|
||||
|
|
|
@ -128,8 +128,8 @@ wontreturn void pthread_exit(void *rc) {
|
|||
// implementation called exit() with a zero argument at thread
|
||||
// termination time." ──Quoth POSIX.1-2017
|
||||
if (orphan) {
|
||||
for (const uintptr_t *p = __fini_array_end; p > __fini_array_start;)
|
||||
((void (*)(void))(*--p))();
|
||||
for (int i = __fini_array_end - __fini_array_start; i--;)
|
||||
((void (*)(void))__fini_array_start[i])();
|
||||
_Exit(0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue