Skip to content

Commit 96e7965

Browse files
author
Fabrice Bellard
committed
removed the ability to do simultaneous 64 and 32 bit x86 builds in order to simplify the Makefile
1 parent 22dbf49 commit 96e7965

File tree

1 file changed

+20
-58
lines changed

1 file changed

+20
-58
lines changed

Makefile

Lines changed: 20 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ endif
3434
#CONFIG_LTO=y
3535
# consider warnings as errors (for development)
3636
#CONFIG_WERROR=y
37-
# force 32 bit build for some utilities
37+
# force 32 bit build on x86_64
3838
#CONFIG_M32=y
3939
# cosmopolitan build (see https://github.com/jart/cosmopolitan)
4040
#CONFIG_COSMO=y
@@ -129,6 +129,13 @@ else
129129
endif
130130
endif
131131
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
132139
CFLAGS+=-fwrapv # ensure that signed overflows behave as expected
133140
ifdef CONFIG_WERROR
134141
CFLAGS+=-Werror
@@ -195,9 +202,6 @@ else
195202
QJSC_CC=$(CC)
196203
QJSC=./qjsc$(EXE)
197204
endif
198-
ifdef CONFIG_M32
199-
PROGS+=qjs32 qjs32_s
200-
endif
201205
PROGS+=libquickjs.a
202206
ifdef CONFIG_LTO
203207
PROGS+=libquickjs.lto.a
@@ -208,7 +212,11 @@ ifeq ($(CROSS_PREFIX),)
208212
ifndef CONFIG_ASAN
209213
ifndef CONFIG_MSAN
210214
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
212220
ifdef CONFIG_SHARED_LIBS
213221
PROGS+=examples/fib.so examples/point.so
214222
endif
@@ -270,13 +278,6 @@ QJSC_HOST_DEFINES:=-DCONFIG_CC=\"$(HOST_CC)\" -DCONFIG_PREFIX=\"$(PREFIX)\"
270278
$(OBJDIR)/qjsc.o: CFLAGS+=$(QJSC_DEFINES)
271279
$(OBJDIR)/qjsc.host.o: CFLAGS+=$(QJSC_HOST_DEFINES)
272280

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-
280281
ifdef CONFIG_LTO
281282
LTOEXT=.lto
282283
else
@@ -298,8 +299,7 @@ repl.c: $(QJSC) repl.js
298299
$(QJSC) -c -o $@ -m repl.js
299300

300301
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
303303

304304
libunicode-table.h: unicode_gen
305305
./unicode_gen unicode $@
@@ -311,10 +311,7 @@ run-test262: $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS)
311311
run-test262-debug: $(patsubst %.o, %.debug.o, $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS))
312312
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
313313

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
318315

319316
$(OBJDIR)/%.o: %.c | $(OBJDIR)
320317
$(CC) $(CFLAGS_OPT) -c -o $@ $<
@@ -331,12 +328,6 @@ $(OBJDIR)/%.pic.o: %.c | $(OBJDIR)
331328
$(OBJDIR)/%.nolto.o: %.c | $(OBJDIR)
332329
$(CC) $(CFLAGS_NOLTO) -c -o $@ $<
333330

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-
340331
$(OBJDIR)/%.debug.o: %.c | $(OBJDIR)
341332
$(CC) $(CFLAGS_DEBUG) -c -o $@ $<
342333

@@ -358,7 +349,7 @@ clean:
358349
rm -f hello.c test_fib.c
359350
rm -f examples/*.so tests/*.so
360351
rm -rf $(OBJDIR)/ *.dSYM/ qjs-debug
361-
rm -rf run-test262-debug run-test262-32
352+
rm -rf run-test262-debug
362353
rm -f run_octane run_sunspider_like
363354

364355
install: all
@@ -385,13 +376,8 @@ HELLO_OPTS=-fno-string-normalize -fno-map -fno-promise -fno-typedarray \
385376
hello.c: $(QJSC) $(HELLO_SRCS)
386377
$(QJSC) -e $(HELLO_OPTS) -o $@ $(HELLO_SRCS)
387378

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
392379
examples/hello: $(OBJDIR)/hello.o $(QJS_LIB_OBJS)
393380
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
394-
endif
395381

396382
# example of static JS compilation with modules
397383
HELLO_MODULE_SRCS=examples/hello_module.js
@@ -440,9 +426,6 @@ doc/%.html: doc/%.html.pre
440426
ifdef CONFIG_SHARED_LIBS
441427
test: tests/bjson.so examples/point.so
442428
endif
443-
ifdef CONFIG_M32
444-
test: qjs32
445-
endif
446429

447430
test: qjs
448431
./qjs tests/test_closure.js
@@ -456,43 +439,27 @@ ifdef CONFIG_SHARED_LIBS
456439
./qjs tests/test_bjson.js
457440
./qjs examples/test_point.js
458441
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
468442

469-
stats: qjs qjs32
443+
stats: qjs
470444
./qjs -qd
471-
./qjs32 -qd
472445

473446
microbench: qjs
474447
./qjs --std tests/microbench.js
475448

476-
microbench-32: qjs32
477-
./qjs32 --std tests/microbench.js
478-
479449
ifeq ($(wildcard test262o/tests.txt),)
480-
test2o test2o-32 test2o-update:
450+
test2o test2o-update:
481451
@echo test262o tests not installed
482452
else
483453
# ES5 tests (obsolete)
484454
test2o: run-test262
485455
time ./run-test262 -t -m -c test262o.conf
486456

487-
test2o-32: run-test262-32
488-
time ./run-test262-32 -t -m -c test262o.conf
489-
490457
test2o-update: run-test262
491458
./run-test262 -t -u -c test262o.conf
492459
endif
493460

494461
ifeq ($(wildcard test262/features.txt),)
495-
test2 test2-32 test2-update test2-default test2-check:
462+
test2 test2-update test2-default test2-check:
496463
@echo test262 tests not installed
497464
else
498465
# Test262 tests
@@ -502,9 +469,6 @@ test2-default: run-test262
502469
test2: run-test262
503470
time ./run-test262 -t -m -c test262.conf -a
504471

505-
test2-32: run-test262-32
506-
time ./run-test262-32 -t -m -c test262.conf -a
507-
508472
test2-update: run-test262
509473
./run-test262 -t -u -c test262.conf -a
510474

@@ -514,9 +478,7 @@ endif
514478

515479
testall: all test microbench test2o test2
516480

517-
testall-32: all test-32 microbench-32 test2o-32 test2-32
518-
519-
testall-complete: testall testall-32
481+
testall-complete: testall
520482

521483
node-test:
522484
node tests/test_closure.js

0 commit comments

Comments
 (0)