34
34
# CONFIG_LTO=y
35
35
# consider warnings as errors (for development)
36
36
# CONFIG_WERROR=y
37
- # force 32 bit build for some utilities
37
+ # force 32 bit build on x86_64
38
38
# CONFIG_M32=y
39
39
# cosmopolitan build (see https://github.com/jart/cosmopolitan)
40
40
# CONFIG_COSMO=y
@@ -129,6 +129,13 @@ else
129
129
endif
130
130
endif
131
131
STRIP? =$(CROSS_PREFIX ) strip
132
+ ifdef CONFIG_M32
133
+ CFLAGS+ =-msse2 -mfpmath=sse # use SSE math for correct FP rounding
134
+ ifndef CONFIG_WIN32
135
+ CFLAGS+ =-m32
136
+ LDFLAGS+ =-m32
137
+ endif
138
+ endif
132
139
CFLAGS+ =-fwrapv # ensure that signed overflows behave as expected
133
140
ifdef CONFIG_WERROR
134
141
CFLAGS+ =-Werror
195
202
QJSC_CC =$(CC )
196
203
QJSC =./qjsc$(EXE )
197
204
endif
198
- ifdef CONFIG_M32
199
- PROGS+ =qjs32 qjs32_s
200
- endif
201
205
PROGS+ =libquickjs.a
202
206
ifdef CONFIG_LTO
203
207
PROGS+ =libquickjs.lto.a
@@ -208,7 +212,11 @@ ifeq ($(CROSS_PREFIX),)
208
212
ifndef CONFIG_ASAN
209
213
ifndef CONFIG_MSAN
210
214
ifndef CONFIG_UBSAN
211
- PROGS+ =examples/hello examples/hello_module examples/test_fib
215
+ PROGS+ =examples/hello examples/test_fib
216
+ # no -m32 option in qjsc
217
+ ifndef CONFIG_M32
218
+ PROGS+ =examples/hello_module
219
+ endif
212
220
ifdef CONFIG_SHARED_LIBS
213
221
PROGS+ =examples/fib.so examples/point.so
214
222
endif
@@ -270,13 +278,6 @@ QJSC_HOST_DEFINES:=-DCONFIG_CC=\"$(HOST_CC)\" -DCONFIG_PREFIX=\"$(PREFIX)\"
270
278
$(OBJDIR ) /qjsc.o : CFLAGS+=$(QJSC_DEFINES )
271
279
$(OBJDIR ) /qjsc.host.o : CFLAGS+=$(QJSC_HOST_DEFINES )
272
280
273
- qjs32 : $(patsubst % .o, % .m32.o, $(QJS_OBJS ) )
274
- $(CC ) -m32 $(LDFLAGS ) $(LDEXPORT ) -o $@ $^ $(LIBS )
275
-
276
- qjs32_s : $(patsubst % .o, % .m32s.o, $(QJS_OBJS ) )
277
- $(CC ) -m32 $(LDFLAGS ) -o $@ $^ $(LIBS )
278
- @size $@
279
-
280
281
ifdef CONFIG_LTO
281
282
LTOEXT =.lto
282
283
else
@@ -298,8 +299,7 @@ repl.c: $(QJSC) repl.js
298
299
$(QJSC ) -c -o $@ -m repl.js
299
300
300
301
ifneq ($(wildcard unicode/UnicodeData.txt) ,)
301
- $(OBJDIR)/libunicode.o $(OBJDIR)/libunicode.m32.o $(OBJDIR)/libunicode.m32s.o \
302
- $(OBJDIR ) /libunicode.nolto.o : libunicode-table.h
302
+ $(OBJDIR ) /libunicode.o $(OBJDIR ) /libunicode.nolto.o : libunicode-table.h
303
303
304
304
libunicode-table.h : unicode_gen
305
305
./unicode_gen unicode $@
@@ -311,10 +311,7 @@ run-test262: $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS)
311
311
run-test262-debug : $(patsubst % .o, % .debug.o, $(OBJDIR ) /run-test262.o $(QJS_LIB_OBJS ) )
312
312
$(CC ) $(LDFLAGS ) -o $@ $^ $(LIBS )
313
313
314
- run-test262-32 : $(patsubst % .o, % .m32.o, $(OBJDIR ) /run-test262.o $(QJS_LIB_OBJS ) )
315
- $(CC ) -m32 $(LDFLAGS ) -o $@ $^ $(LIBS )
316
-
317
- # object suffix order: nolto, [m32|m32s]
314
+ # object suffix order: nolto
318
315
319
316
$(OBJDIR ) /% .o : % .c | $(OBJDIR )
320
317
$(CC ) $(CFLAGS_OPT ) -c -o $@ $<
@@ -331,12 +328,6 @@ $(OBJDIR)/%.pic.o: %.c | $(OBJDIR)
331
328
$(OBJDIR ) /% .nolto.o : % .c | $(OBJDIR )
332
329
$(CC ) $(CFLAGS_NOLTO ) -c -o $@ $<
333
330
334
- $(OBJDIR ) /% .m32.o : % .c | $(OBJDIR )
335
- $(CC ) -m32 $(CFLAGS_OPT ) -c -o $@ $<
336
-
337
- $(OBJDIR ) /% .m32s.o : % .c | $(OBJDIR )
338
- $(CC ) -m32 $(CFLAGS_SMALL ) -c -o $@ $<
339
-
340
331
$(OBJDIR ) /% .debug.o : % .c | $(OBJDIR )
341
332
$(CC ) $(CFLAGS_DEBUG ) -c -o $@ $<
342
333
@@ -358,7 +349,7 @@ clean:
358
349
rm -f hello.c test_fib.c
359
350
rm -f examples/* .so tests/* .so
360
351
rm -rf $(OBJDIR ) / * .dSYM/ qjs-debug
361
- rm -rf run-test262-debug run-test262-32
352
+ rm -rf run-test262-debug
362
353
rm -f run_octane run_sunspider_like
363
354
364
355
install : all
@@ -385,13 +376,8 @@ HELLO_OPTS=-fno-string-normalize -fno-map -fno-promise -fno-typedarray \
385
376
hello.c : $(QJSC ) $(HELLO_SRCS )
386
377
$(QJSC ) -e $(HELLO_OPTS ) -o $@ $(HELLO_SRCS )
387
378
388
- ifdef CONFIG_M32
389
- examples/hello : $(OBJDIR ) /hello.m32s.o $(patsubst % .o, % .m32s.o, $(QJS_LIB_OBJS ) )
390
- $(CC ) -m32 $(LDFLAGS ) -o $@ $^ $(LIBS )
391
- else
392
379
examples/hello : $(OBJDIR ) /hello.o $(QJS_LIB_OBJS )
393
380
$(CC ) $(LDFLAGS ) -o $@ $^ $(LIBS )
394
- endif
395
381
396
382
# example of static JS compilation with modules
397
383
HELLO_MODULE_SRCS =examples/hello_module.js
@@ -440,9 +426,6 @@ doc/%.html: doc/%.html.pre
440
426
ifdef CONFIG_SHARED_LIBS
441
427
test : tests/bjson.so examples/point.so
442
428
endif
443
- ifdef CONFIG_M32
444
- test : qjs32
445
- endif
446
429
447
430
test : qjs
448
431
./qjs tests/test_closure.js
@@ -456,43 +439,27 @@ ifdef CONFIG_SHARED_LIBS
456
439
./qjs tests/test_bjson.js
457
440
./qjs examples/test_point.js
458
441
endif
459
- ifdef CONFIG_M32
460
- ./qjs32 tests/test_closure.js
461
- ./qjs32 tests/test_language.js
462
- ./qjs32 --std tests/test_builtin.js
463
- ./qjs32 tests/test_loop.js
464
- ./qjs32 tests/test_bigint.js
465
- ./qjs32 tests/test_std.js
466
- ./qjs32 tests/test_worker.js
467
- endif
468
442
469
- stats : qjs qjs32
443
+ stats : qjs
470
444
./qjs -qd
471
- ./qjs32 -qd
472
445
473
446
microbench : qjs
474
447
./qjs --std tests/microbench.js
475
448
476
- microbench-32 : qjs32
477
- ./qjs32 --std tests/microbench.js
478
-
479
449
ifeq ($(wildcard test262o/tests.txt) ,)
480
- test2o test2o-32 test2o- update :
450
+ test2o test2o-update :
481
451
@echo test262o tests not installed
482
452
else
483
453
# ES5 tests (obsolete)
484
454
test2o : run-test262
485
455
time ./run-test262 -t -m -c test262o.conf
486
456
487
- test2o-32 : run-test262-32
488
- time ./run-test262-32 -t -m -c test262o.conf
489
-
490
457
test2o-update : run-test262
491
458
./run-test262 -t -u -c test262o.conf
492
459
endif
493
460
494
461
ifeq ($(wildcard test262/features.txt) ,)
495
- test2 test2-32 test2- update test2-default test2-check :
462
+ test2 test2-update test2-default test2-check :
496
463
@echo test262 tests not installed
497
464
else
498
465
# Test262 tests
@@ -502,9 +469,6 @@ test2-default: run-test262
502
469
test2 : run-test262
503
470
time ./run-test262 -t -m -c test262.conf -a
504
471
505
- test2-32 : run-test262-32
506
- time ./run-test262-32 -t -m -c test262.conf -a
507
-
508
472
test2-update : run-test262
509
473
./run-test262 -t -u -c test262.conf -a
510
474
@@ -514,9 +478,7 @@ endif
514
478
515
479
testall : all test microbench test2o test2
516
480
517
- testall-32 : all test-32 microbench-32 test2o-32 test2-32
518
-
519
- testall-complete : testall testall-32
481
+ testall-complete : testall
520
482
521
483
node-test :
522
484
node tests/test_closure.js
0 commit comments