Fix package.sh build error

This commit is contained in:
Justine Tunney 2024-07-26 06:57:24 -07:00
parent 642e9cb91a
commit efb3a34608
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3 changed files with 12 additions and 18 deletions

View file

@ -82,7 +82,7 @@ ENABLE_FTRACE = 1
CONFIG_OFLAGS ?= -g -ggdb
CONFIG_CPPFLAGS += -DNDEBUG -DSYSDEBUG
CONFIG_CCFLAGS += $(BACKTRACES) -O3 -fmerge-all-constants
TARGET_ARCH ?= -march=native
CONFIG_TARGET_ARCH ?= -march=native
endif
# Optimized Linux Mode
@ -100,14 +100,14 @@ CONFIG_OFLAGS ?= -g -ggdb
CONFIG_CPPFLAGS += -DNDEBUG -DSYSDEBUG -DSUPPORT_VECTOR=1
CONFIG_CCFLAGS += -O3 -fmerge-all-constants
CONFIG_COPTS += -mred-zone
TARGET_ARCH ?= -march=native
CONFIG_TARGET_ARCH ?= -march=native
endif
ifeq ($(MODE), x86_64-optlinux)
CONFIG_OFLAGS ?= -g -ggdb
CONFIG_CPPFLAGS += -DNDEBUG -DSYSDEBUG -DSUPPORT_VECTOR=1
CONFIG_CCFLAGS += -O3 -fmerge-all-constants
CONFIG_COPTS += -mred-zone
TARGET_ARCH ?= -march=native
CONFIG_TARGET_ARCH ?= -march=native
endif
ifeq ($(MODE), aarch64-optlinux)
CONFIG_OFLAGS ?= -g -ggdb
@ -223,8 +223,6 @@ CONFIG_CCFLAGS += \
-momit-leaf-frame-pointer \
-foptimize-sibling-calls \
-DDWARFLESS
TARGET_ARCH ?= \
-msse3
PYFLAGS += \
-O2 \
-B
@ -244,8 +242,6 @@ CONFIG_CCFLAGS += \
-momit-leaf-frame-pointer \
-foptimize-sibling-calls \
-DDWARFLESS
TARGET_ARCH ?= \
-msse3
PYFLAGS += \
-O2 \
-B
@ -297,8 +293,6 @@ CONFIG_CCFLAGS += \
-fno-align-jumps \
-fno-align-labels \
-fno-align-loops
TARGET_ARCH ?= \
-msse3
endif
# Linux+BSD Tiny Mode
@ -328,8 +322,6 @@ CONFIG_CCFLAGS += \
-fno-align-jumps \
-fno-align-labels \
-fno-align-loops
TARGET_ARCH ?= \
-msse3
endif
# Unix Tiny Mode
@ -358,8 +350,6 @@ CONFIG_CCFLAGS += \
-fno-align-jumps \
-fno-align-labels \
-fno-align-loops
TARGET_ARCH ?= \
-msse3
endif
# Tiny Metallic Unix Mode
@ -388,8 +378,6 @@ CONFIG_CCFLAGS += \
-fno-align-jumps \
-fno-align-labels \
-fno-align-loops
TARGET_ARCH ?= \
-msse3
endif
# no x87 instructions mode
@ -522,3 +510,5 @@ ifeq ($(ARCH), aarch64)
CONFIG_CCFLAGS += -fpatchable-function-entry=7,6
endif
endif
TARGET_ARCH ?= $(CONFIG_TARGET_ARCH)

View file

@ -40,8 +40,12 @@ static int malloc_wipe(MLOCK_T *lk) {
static int malloc_lock(MLOCK_T *lk) {
if (!__threaded) return 0;
while (atomic_exchange_explicit(lk, 1, memory_order_acquire)) {
pthread_pause_np();
for (;;) {
if (!atomic_exchange_explicit(lk, 1, memory_order_acquire))
break;
for (;;)
if (!atomic_load_explicit(lk, memory_order_relaxed))
break;
}
return 0;
}

View file

@ -85,7 +85,7 @@ make -j64 m=$AMD64-dbg \
o/$AMD64-dbg/cosmopolitan.a \
o/$AMD64-dbg/third_party/libcxx/libcxx.a \
make TARGET_ARCH= -j64 m=$AMD64-optlinux \
make CONFIG_TARGET_ARCH= -j64 m=$AMD64-optlinux \
o/cosmocc.h.txt \
o/$AMD64-optlinux/ape/ape.lds \
o/$AMD64-optlinux/libc/crt/crt.o \