From 680daf1210e3cf39ef53b434f2ecc278d151d5e1 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Tue, 6 Oct 2020 12:13:15 -0700 Subject: [PATCH] Fix build/test breakage caused by last commit --- libc/str/getutf16.ncabi.c | 2 +- libc/str/utf16.h | 2 +- net/http/http.mk | 1 + test/libc/fmt/test.mk | 2 ++ test/libc/runtime/test.mk | 7 +++++++ third_party/zlib/zlib.mk | 6 ------ tool/tags/tags.mk | 5 ++--- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/libc/str/getutf16.ncabi.c b/libc/str/getutf16.ncabi.c index 2dfaa934..69b84753 100644 --- a/libc/str/getutf16.ncabi.c +++ b/libc/str/getutf16.ncabi.c @@ -35,7 +35,7 @@ forcealignargpointer unsigned(getutf16)(const char16_t *p, wint_t *wc) { if (IsUcs2(p[skip])) { *wc = p[skip]; return skip + 1; - } else if (IsUtf16Cont(p[skip + 1])) { + } else if (!IsUtf16Cont(p[skip + 1])) { *wc = INVALID_CODEPOINT; return -1; } else { diff --git a/libc/str/utf16.h b/libc/str/utf16.h index 0827a205..b3ed77c1 100644 --- a/libc/str/utf16.h +++ b/libc/str/utf16.h @@ -6,7 +6,7 @@ #define UTF16_CONT 0xdc00 /* 0xDC00..0xDBFF */ #define IsUcs2(wc) (((wc)&UTF16_MASK) != UTF16_MOAR) -#define IsUtf16Cont(wc) (((wc)&UTF16_MASK) != UTF16_MOAR) +#define IsUtf16Cont(wc) (((wc)&UTF16_MASK) == UTF16_CONT) #define MergeUtf16(lo, hi) ((((lo)-0xD800) << 10) + ((hi)-0xDC00) + 0x10000) #endif /* COSMOPOLITAN_LIBC_STR_UTF16_H_ */ diff --git a/net/http/http.mk b/net/http/http.mk index 80d9e860..0572727c 100644 --- a/net/http/http.mk +++ b/net/http/http.mk @@ -33,6 +33,7 @@ NET_HTTP_A_DIRECTDEPS = \ LIBC_CONV \ LIBC_FMT \ LIBC_LOG \ + LIBC_LOG_ASAN \ LIBC_NEXGEN32E \ LIBC_RUNTIME \ LIBC_SOCK \ diff --git a/test/libc/fmt/test.mk b/test/libc/fmt/test.mk index 2f03bac9..d917a7b8 100644 --- a/test/libc/fmt/test.mk +++ b/test/libc/fmt/test.mk @@ -26,6 +26,8 @@ TEST_LIBC_FMT_DIRECTDEPS = \ LIBC_MEM \ LIBC_NEXGEN32E \ LIBC_RUNTIME \ + LIBC_LOG \ + LIBC_LOG_ASAN \ LIBC_STDIO \ LIBC_STR \ LIBC_STUBS \ diff --git a/test/libc/runtime/test.mk b/test/libc/runtime/test.mk index f7cc408f..c72e7c6d 100644 --- a/test/libc/runtime/test.mk +++ b/test/libc/runtime/test.mk @@ -35,6 +35,7 @@ TEST_LIBC_RUNTIME_DIRECTDEPS = \ LIBC_RUNTIME \ LIBC_STDIO \ LIBC_LOG \ + LIBC_LOG_ASAN \ LIBC_STR \ LIBC_STUBS \ LIBC_SYSV \ @@ -62,6 +63,12 @@ $(TEST_LIBC_RUNTIME_OBJS): \ DEFAULT_CCFLAGS += \ -fno-builtin +ifeq (,$(MODE)) +$(TEST_LIBC_RUNTIME_OBJS): \ + OVERRIDE_CFLAGS += \ + -fsanitize=address +endif + o/$(MODE)/test/libc/runtime/getenv_test.com.runs: \ o/$(MODE)/test/libc/runtime/getenv_test.com @HELLO=THERE build/runit $@ $< diff --git a/third_party/zlib/zlib.mk b/third_party/zlib/zlib.mk index 81c6ac40..9d29c102 100644 --- a/third_party/zlib/zlib.mk +++ b/third_party/zlib/zlib.mk @@ -57,12 +57,6 @@ o/$(MODE)/third_party/zlib/adler32.o: \ -ffunction-sections \ -fdata-sections -ifeq (,$(MODE)) -$(THIRD_PARTY_ZLIB_A_OBJS): \ - OVERRIDE_CFLAGS += \ - -fsanitize=address -endif - THIRD_PARTY_ZLIB_LIBS = $(foreach x,$(THIRD_PARTY_ZLIB_ARTIFACTS),$($(x))) THIRD_PARTY_ZLIB_SRCS = $(foreach x,$(THIRD_PARTY_ZLIB_ARTIFACTS),$($(x)_SRCS)) THIRD_PARTY_ZLIB_HDRS = $(foreach x,$(THIRD_PARTY_ZLIB_ARTIFACTS),$($(x)_HDRS)) diff --git a/tool/tags/tags.mk b/tool/tags/tags.mk index 3f544c40..d02e1b22 100644 --- a/tool/tags/tags.mk +++ b/tool/tags/tags.mk @@ -70,6 +70,5 @@ o/$(MODE)/tool/tags/%.com.dbg: \ @$(APELINK) .PHONY: o/$(MODE)/tool/tags -o/$(MODE)/tool/tags: \ - $(TOOL_TAGS_BINS) \ - $(TOOL_TAGS_CHECKS) +o/$(MODE)/tool/tags: +# TODO: Why isn't tags.h.inc being generated?