Fix build flags for kprintf()

This commit is contained in:
Justine Tunney 2022-03-17 13:54:16 -07:00
parent 46a3b88594
commit 741c836e9d
2 changed files with 6 additions and 11 deletions

View file

@ -69,10 +69,6 @@ o/$(MODE)/libc/intrin/ubsan.o: \
-fno-sanitize=all \
-fno-stack-protector
o/$(MODE)/libc/intrin/memcmp.o: \
OVERRIDE_CFLAGS += \
-Os
o//libc/intrin/memmove.o: \
OVERRIDE_CFLAGS += \
-fno-toplevel-reorder
@ -90,18 +86,18 @@ o/$(MODE)/libc/intrin/memmove.o: \
OVERRIDE_CFLAGS += \
-fpie
o/$(MODE)/libc/intrin/printf.o: \
o/$(MODE)/libc/intrin/kprintf.greg.o: \
OVERRIDE_CFLAGS += \
-Os \
-fpie \
-mgeneral-regs-only
-fwrapv \
-fno-sanitize=all \
-fschedule-insns2
LIBC_INTRIN_LIBS = $(foreach x,$(LIBC_INTRIN_ARTIFACTS),$($(x)))
LIBC_INTRIN_HDRS = $(foreach x,$(LIBC_INTRIN_ARTIFACTS),$($(x)_HDRS))
LIBC_INTRIN_SRCS = $(foreach x,$(LIBC_INTRIN_ARTIFACTS),$($(x)_SRCS))
LIBC_INTRIN_CHECKS = $(foreach x,$(LIBC_INTRIN_ARTIFACTS),$($(x)_CHECKS))
LIBC_INTRIN_OBJS = $(foreach x,$(LIBC_INTRIN_ARTIFACTS),$($(x)_OBJS))
LIBC_INTRIN_CHECKS = $(LIBC_INTRIN_HDRS:%=o/$(MODE)/%.ok)
$(LIBC_INTRIN_OBJS): $(BUILD_FILES) libc/intrin/intrin.mk
.PHONY: o/$(MODE)/libc/intrin

View file

@ -26,9 +26,8 @@
typedef char xmm_t __attribute__((__vector_size__(16), __aligned__(1)));
static dontinline antiquity int memcmp_sse(const unsigned char *p,
const unsigned char *q, size_t n) {
uint64_t w;
unsigned u, u0, u1, u2, u3;
const unsigned char *q, size_t n) {
unsigned u;
if (n > 32) {
while (n > 16 + 16) {
if (!(u = PMOVMSKB(*(xmm_t *)p == *(xmm_t *)q) ^ 0xffff)) {