Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
52 lines (36 loc) · 1.64 KB

File metadata and controls

executable file
·
52 lines (36 loc) · 1.64 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/python3
# Copyright 2011 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""Small utility to execute some llvm bitcode.
The use case is a Makefile that builds some executable
and runs it as part of the build process. With emmake,
the Makefile will generate llvm bitcode, so we can't
just execute it directly. This script will get that
code into a runnable form, and run it.
We cannot just use lli, since code built with debug
symbols will crash it due to
http://llvm.org/bugs/show_bug.cgi?id=6981
So we must get around that.
To use this, change the Makefile so that instead of
running
/bin/sh THE_FILE PARAMS
it runs
python $(EMSCRIPTEN_TOOLS)/exec_llvm.py THE_FILE PARAMS
An alternative solution to this problem is to compile
the .ll into native code, see nativize_llvm.py. That is
useful when this fails.
"""
import os
import sys
from subprocess import check_call
__rootpath__ = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(__rootpath__)
from tools.shared import LLVM_OPT, LLVM_INTERPRETER # noqa
check_call([LLVM_OPT, sys.argv[1], '-strip-debug', '-o', sys.argv[1] + '.clean.bc'])
# Execute with empty environment - just like the JS script will have
check_call([LLVM_INTERPRETER, sys.argv[1] + '.clean.bc'] + sys.argv[2:], env={'HOME': '.'})
# check_call([LLVM_COMPILER, '-march=c', sys.argv[1], '-o', sys.argv[1] + '.cbe.c'])
# check_call(['gcc', sys.argv[1]+'.cbe.c', '-lstdc++'])
# check_call(['./a.out'] + sys.argv[2:])
Morty Proxy This is a proxified and sanitized view of the page, visit original site.