@@ -106,6 +106,12 @@ DEFINES:=-D_GNU_SOURCE -DCONFIG_VERSION=\"$(shell cat VERSION)\"
106106ifdef CONFIG_BIGNUM
107107DEFINES+ =-DCONFIG_BIGNUM
108108endif
109+ ifdef CONFIG_WIN32
110+ ifndef CONFIG_WIN64
111+ DEFINES+ =-D__USE_MINGW_ANSI_STDIO # for standard snprintf behavior
112+ endif
113+ endif
114+
109115CFLAGS+ =$(DEFINES )
110116CFLAGS_DEBUG =$(CFLAGS ) -O0
111117CFLAGS_SMALL =$(CFLAGS ) -Os
@@ -122,8 +128,8 @@ CFLAGS+=-p
122128LDFLAGS+ =-p
123129endif
124130ifdef CONFIG_ASAN
125- CFLAGS+=-fsanitize =address
126- LDFLAGS+=-fsanitize =address
131+ CFLAGS+=-fsanitize =address -fno-omit-frame-pointer
132+ LDFLAGS+=-fsanitize =address -fno-omit-frame-pointer
127133endif
128134ifdef CONFIG_WIN32
129135LDEXPORT =
@@ -179,10 +185,11 @@ QJS_LIB_OBJS+=$(OBJDIR)/libbf.o
179185QJS_OBJS+ =$(OBJDIR ) /qjscalc.o
180186endif
181187
188+ HOST_LIBS =-lm -ldl -lpthread
182189LIBS =-lm
183190ifndef CONFIG_WIN32
184191 ifndef CONFIG_WIN64
185- LIBS+ =-ldl
192+ LIBS+ =-ldl -lpthread
186193 endif
187194endif
188195
@@ -202,7 +209,7 @@ ifneq ($(CROSS_PREFIX),)
202209
203210$(QJSC ) : $(OBJDIR ) /qjsc.host.o \
204211 $(patsubst %.o, %.host.o, $(QJS_LIB_OBJS))
205- $(HOST_CC) $(LDFLAGS) $(LDEXTRAS) -o $@ $^ $(LIBS )
212+ $(HOST_CC) $(LDFLAGS) $(LDEXTRAS) -o $@ $^ $(HOST_LIBS )
206213
207214endif # CROSS_PREFIX
208215
@@ -254,13 +261,13 @@ libunicode-table.h: unicode_gen
254261endif
255262
256263run-test262 : $(OBJDIR ) /run-test262.o $(QJS_LIB_OBJS )
257- $(CC ) $(LDFLAGS ) $(LDEXTRAS ) -o $@ $^ $(LIBS ) -lpthread
264+ $(CC ) $(LDFLAGS ) $(LDEXTRAS ) -o $@ $^ $(LIBS )
258265
259266run-test262-debug : $(patsubst % .o, % .debug.o, $(OBJDIR ) /run-test262.o $(QJS_LIB_OBJS ) )
260- $(CC ) $(LDFLAGS ) -o $@ $^ $(LIBS ) -lpthread
267+ $(CC ) $(LDFLAGS ) -o $@ $^ $(LIBS )
261268
262269run-test262-32 : $(patsubst % .o, % .m32.o, $(OBJDIR ) /run-test262.o $(QJS_LIB_OBJS ) )
263- $(CC ) -m32 $(LDFLAGS ) -o $@ $^ $(LIBS ) -lpthread
270+ $(CC ) -m32 $(LDFLAGS ) -o $@ $^ $(LIBS )
264271
265272# object suffix order: nolto, [m32|m32s]
266273
@@ -300,7 +307,7 @@ unicode_gen: $(OBJDIR)/unicode_gen.host.o $(OBJDIR)/cutils.host.o libunicode.c u
300307clean :
301308 rm -f repl.c qjscalc.c out.c
302309 rm -f * .a * .o * .d * ~ jscompress unicode_gen regexp_test $(PROGS )
303- rm -f hello.c hello_module.c test_fib.c
310+ rm -f hello.c test_fib.c
304311 rm -f examples/* .so tests/* .so
305312 rm -rf $(OBJDIR ) / * .dSYM/ qjs-debug
306313 rm -rf run-test262-debug run-test262-32
@@ -394,10 +401,11 @@ endif
394401
395402test : qjs
396403 ./qjs tests/test_closure.js
397- ./qjs tests/test_op .js
404+ ./qjs tests/test_language .js
398405 ./qjs tests/test_builtin.js
399406 ./qjs tests/test_loop.js
400407 ./qjs tests/test_std.js
408+ ./qjs tests/test_worker.js
401409ifndef CONFIG_DARWIN
402410ifdef CONFIG_BIGNUM
403411 ./qjs --bignum tests/test_bjson.js
@@ -413,10 +421,11 @@ ifdef CONFIG_BIGNUM
413421endif
414422ifdef CONFIG_M32
415423 ./qjs32 tests/test_closure.js
416- ./qjs32 tests/test_op .js
424+ ./qjs32 tests/test_language .js
417425 ./qjs32 tests/test_builtin.js
418426 ./qjs32 tests/test_loop.js
419427 ./qjs32 tests/test_std.js
428+ ./qjs32 tests/test_worker.js
420429ifdef CONFIG_BIGNUM
421430 ./qjs32 --bignum tests/test_op_overloading.js
422431 ./qjs32 --bignum tests/test_bignum.js
0 commit comments