chibi-scheme web assembly build fails

66 views
Skip to first unread message

Amirouche Boubekki

unread,
Nov 2, 2019, 10:49:15 AM11/2/19
to chibi-scheme
Trying to make chibi.js fails with the following error:

chibi-scheme$ make js/chibi.js

emmake make PLATFORM=emscripten CHIBI_DEPENDENCIES= CHIBI=./chibi-scheme-emscripten PREFIX= CFLAGS=-O2 SEXP_USE_DL=0 EXE=.bc SO=.bc CPPFLAGS="-DSEXP_USE_STRICT_TOPLEVEL_BINDINGS=1 -DSEXP_USE_ALIGNED_BYTECODE=1 -DSEXP_USE_STATIC_LIBS=1 -DSEXP_USE_STATIC_LIBS_NO_INCLUDE=0" clibs.c chibi-scheme-static.bc
cache:INFO: generating system asset: is_vanilla.txt... (this will be cached in "/home/amirouche/.emscripten_cache/is_vanilla.txt" for subsequent builds)
cache:INFO:  - ok
make: ['make', 'PLATFORM=emscripten', 'CHIBI_DEPENDENCIES=', 'CHIBI=./chibi-scheme-emscripten', 'PREFIX=', 'CFLAGS=-O2', 'SEXP_USE_DL=0', 'EXE=.bc', 'SO=.bc', 'CPPFLAGS=-DSEXP_USE_STRICT_TOPLEVEL_BINDINGS=1 -DSEXP_USE_ALIGNED_BYTECODE=1 -DSEXP_USE_STATIC_LIBS=1 -DSEXP_USE_STATIC_LIBS_NO_INCLUDE=0', 'clibs.c', 'chibi-scheme-static.bc']
make[1]: Entering directory '/home/amirouche/src/scheme/chibi/scheme-comparator/chibi-scheme'
Makefile:180: warning: overriding recipe for target 'chibi-scheme-static.bc'
Makefile:128: warning: ignoring old recipe for target 'chibi-scheme-static.bc'
git ls-files lib | grep .sld | ./chibi-scheme-emscripten -q ./tools/chibi-genstatic > clibs.c
/home/amirouche/src/scheme/chibi/scheme-comparator/emsdk/upstream/emscripten/emcc -Wall -DSEXP_USE_DL=0 -g -g3 -O3 -O2 -static -DSEXP_USE_DL=0 -o chibi-scheme-static.bc main.o gc.o sexp.o bignum.o gc_heap.o opcodes.o vm.o eval.o simplify.o   -lm
emcc:WARNING: main.o is not a valid input file
emcc:WARNING: gc.o is not a valid input file
emcc:WARNING: sexp.o is not a valid input file
emcc:WARNING: bignum.o is not a valid input file
emcc:WARNING: gc_heap.o is not a valid input file
emcc:WARNING: opcodes.o is not a valid input file
emcc:WARNING: vm.o is not a valid input file
emcc:WARNING: eval.o is not a valid input file
emcc:WARNING: simplify.o is not a valid input file
shared:ERROR: no input files
note that input files without a known suffix are ignored, make sure your input files end with one of: ('.c', '.C', '.i', '.cpp', '.cxx', '.cc', '.c++', '.CPP', '.CXX', '.CC', '.C++', '.ii', '.m', '.mi', '.mm', '.mii', '/dev/null', '.bc', '.o', '.obj', '.lo', '.dylib', '.so', '.a', '.ll', '.h', '.hxx', '.hpp', '.hh', '.H', '.HXX', '.HPP', '.HH')
make[1]: *** [Makefile:180: chibi-scheme-static.bc] Error 1
make[1]: Leaving directory '/home/amirouche/src/scheme/chibi/scheme-comparator/chibi-scheme'
make: *** [Makefile:128: chibi-scheme-static.bc] Error 2

Amirouche Boubekki

unread,
May 30, 2020, 1:46:37 PM5/30/20
to chibi-scheme
The error was probably due to the terribly unstable nature of emscripten. Anyway, I managed to do the usual cli dance: make && make js and documented the version of emscripten for which it works in a commit in chibi master.

and updated the demo app comparator with mostly out-of-date data: https://github.com/amirouche/scheme-comparator/

On possible improvement to the browser support, would be to make it possible to avoid the need to fork chibi to add custom libraries.

One way to go would be to pack libraries into a single .scm file without the need to install of emscripten

Another would be to make it possible to rebuild or append libraries to chibi.data, which does not work at the moment without recompiling the whole thing with emscripten.

Thanks for all the hard work! It is a pleasure to play in the browser with chibi :)

Alex Shinn

unread,
May 31, 2020, 7:27:07 PM5/31/20
to chibi-...@googlegroups.com
  • Good to know this is working! Are you hosting the build somewhere?

--
You received this message because you are subscribed to the Google Groups "chibi-scheme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chibi-scheme...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chibi-scheme/e3727d18-0a1a-4447-84f6-dd00e629063a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages