Hi everyone,

I’ve been trying to build the trunk version of the Boehm GC using emscripten, 
which now appears to be an officially supported platform based on some of the 
change sets from the last few months (some work was upstreamed from Unity).  
Has anyone had success in doing this?  I’ve managed to produce a compiled 
library of LLVM bit code with the emscripten target triple, but attempting to 
link even a trivial program against it causes emcc to crash.

I’ve asked about this on the Boehm GC mailing list with no luck.

I modified the standard Boehm build instructions according to standard 
emscripten practice and based on the changes to the GC library itself:

autoreconf -vif
automake --add-missing
emconfigure ./configure --prefix=$OUTPUT --without-threads --disable-threads 
__EMSCRIPTEN__=1 EMSCRIPTEN=1
emmake make
make install

This produces an LLVM bitcode file in $OUTPUT/lib/libgc.dylib (OS X 10.9.5) 
which, when disassembled, appears to contain the relevant symbols, code, and 
the target triple asmjs-unknown-emscripten.  But linking even a minimal program 
against this cases emcc (from the portable SDK, I’ve tried 1.22 and 1.25) to 
fail.

Example program:

#include<gc.h>
int main() {
    GC_INIT(); // Initialize the GC allocator
    return 0;
}

Compiled via:
emcc –g –I $OUTPUT/include –L$(OUTPUT)/lib –lgc boehm.c

Produces:
fs.js:427
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory '--'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.readFileSync (fs.js:284:15)
    at read (.../external/emsdk/emscripten/1.22.0/src/compiler.js:57:34)
    at Object.<anonymous> 
(.../external/emsdk/emscripten/1.22.0/src/compiler.js:145:29)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
Traceback (most recent call last):
  File ".../external/emsdk/emscripten/1.22.0/emscripten.py", line 1490, in 
<module>
    _main(environ=os.environ)
  File ".../external/emsdk/emscripten/1.22.0/emscripten.py", line 1478, in _main
    temp_files.run_and_clean(lambda: main(
  File ".../external/emsdk/emscripten/1.22.0/tools/tempfiles.py", line 39, in 
run_and_clean
    return func()
  File ".../external/emsdk/emscripten/1.22.0/emscripten.py", line 1486, in 
<lambda>
    DEBUG_CACHE=DEBUG_CACHE,
  File ".../external/emsdk/emscripten/1.22.0/emscripten.py", line 1373, in main
    jcache=jcache, temp_files=temp_files, DEBUG=DEBUG, DEBUG_CACHE=DEBUG_CACHE)
  File ".../external/emsdk/emscripten/1.22.0/emscripten.py", line 861, in 
emscript_fast
    cwd=path_from_root('src'), error_limit=300)
  File ".../external/emsdk/emscripten/1.22.0/tools/jsrun.py", line 43, in run_js
    raise Exception('Expected the command ' + str(command) + ' to finish with 
return code ' + str(assert_returncode) + ', but it returned with code ' + 
str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])
Exception: Expected the command 
['.../external/emsdk/node/0.10.18_64bit/bin/node', 
'.../external/emsdk/emscripten/1.22.0/src/compiler.js', '--', 
'/var/folders/nx/_cvrfktd5cs5h3ktk6v3z310qn9lg1/T/tmp6TBpfX.txt', ';', 'glue'] 
to finish with return code 0, but it returned with code 8 instead! Output:
Traceback (most recent call last):
  File "external/emsdk/emscripten/1.22.0/emcc", line 1642, in <module>
    final = shared.Building.emscripten(final, append_ext=False, 
extra_args=extra_args)
  File ".../external/emsdk/emscripten/1.22.0/tools/shared.py", line 1464, in 
emscripten
    assert os.path.exists(filename + '.o.js'), 'Emscripten failed to generate 
.js'
AssertionError: Emscripten failed to generate .js

A very similar stack trace showed up in another recent mail to this list 
(https://groups.google.com/forum/#!topic/emscripten-discuss/Wn6YnoHu9XQ).

Has anyone had more success than this?  Am I missing another 
emscripten-specific build tweak?

Thanks in advance,
Colin

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to