Skip to content

Instantly share code, notes, and snippets.

@kjellski
Created November 23, 2012 08:34
Show Gist options
  • Select an option

  • Save kjellski/4134541 to your computer and use it in GitHub Desktop.

Select an option

Save kjellski/4134541 to your computer and use it in GitHub Desktop.
llvm test compile after clean installation on ubuntu not working.
[~/bin/emscripten (master)]$ ./emcc --version
emcc (Emscripten GCC-like replacement) 2.0
Copyright (C) 2012 the Emscripten authors.
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[~/bin/emscripten (master)]$ clang --version
Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0)
Target: x86_64-pc-linux-gnu
Thread model: posix
[~/bin/emscripten (master)]$ ./emcc tests/hello_world.cpp
/usr/bin/llvm-nm: /tmp/tmpIa2Lg4/hello_world_0.o: Invalid MODULE_CODE_GLOBALVAR record
/usr/bin/llvm-nm: /tmp/tmpIa2Lg4/hello_world_0.o: Invalid MODULE_CODE_GLOBALVAR record
/usr/bin/llvm-nm: /tmp/tmpIa2Lg4/hello_world_0.o: Invalid MODULE_CODE_GLOBALVAR record
/usr/bin/opt: /tmp/tmpIa2Lg4/a.out.bc: Invalid MODULE_CODE_GLOBALVAR recordnn
Traceback (most recent call last):
File "./emcc", line 1028, in <module>
shared.Building.llvm_opt(in_temp(target_basename + '.bc'), link_opts)
File "/home/kjellski/bin/emscripten/tools/shared.py", line 805, in llvm_opt
assert os.path.exists(filename + '.opt.bc'), 'Failed to run llvm optimizations: ' + output
AssertionError: Failed to run llvm optimizations:
[~/bin/emscripten (master)]$
to get rid of this, remove llvm-2.9 from ubuntu like this:
sudo apt-get remove llvm-2.9 llvm-2.9-dev llvm-2.9-runtime
and then export the right version for emconfigure like this:
[~/bin/emscripten (master)]$ export LLVM_ADD_VERSION="3.0"
[~/bin/emscripten (master)]$ echo $LLVM_ADD_VERSION
3.0
[~/bin/emscripten (master)]$ ./emconfigure
[~/bin/emscripten (master)]$ ./emcc tests/hello_world.cpp
Traceback (most recent call last):
File "/home/kjellski/bin/emscripten/emscripten.py", line 348, in <module>
temp_files.run_and_clean(lambda: main(keywords))
File "/home/kjellski/bin/emscripten/tools/shared.py", line 422, in run_and_clean
func()
File "/home/kjellski/bin/emscripten/emscripten.py", line 348, in <lambda>
temp_files.run_and_clean(lambda: main(keywords))
File "/home/kjellski/bin/emscripten/emscripten.py", line 309, in main
emscript(args.infile, settings, args.outfile, libraries)
File "/home/kjellski/bin/emscripten/emscripten.py", line 133, in emscript
out = shared.run_js(compiler, shared.COMPILER_ENGINE, [settings_file, pre_file, 'pre'] + libraries, stdout=subprocess.PIPE, cwd=path_from_root('src'))
File "/home/kjellski/bin/emscripten/tools/shared.py", line 452, in run_js
return timeout_run(Popen(command, stdout=stdout, stderr=stderr, cwd=cwd), 15*60 if check_timeout else None, 'Execution')
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Traceback (most recent call last):
File "./emcc", line 1047, in <module>
final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
File "/home/kjellski/bin/emscripten/tools/shared.py", line 890, in emscripten
assert os.path.exists(filename + '.o.js') and len(open(filename + '.o.js', 'r').read()) > 0, 'Emscripten failed to generate .js: ' + str(compiler_output)
AssertionError: Emscripten failed to generate .js:
[~/bin/emscripten (master)]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment