|
28 | 28 | raise Exception('do not run this file directly; do something like: test/runner other')
|
29 | 29 |
|
30 | 30 | from tools.shared import config
|
31 |
| -from tools.shared import EMCC, EMXX, EMAR, EMRANLIB, FILE_PACKAGER, WINDOWS |
| 31 | +from tools.shared import EMCC, EMXX, EMAR, EMRANLIB, FILE_PACKAGER, WINDOWS, LLVM_NM |
32 | 32 | from tools.shared import CLANG_CC, CLANG_CXX, LLVM_AR, LLVM_DWARFDUMP, LLVM_DWP, EMCMAKE, EMCONFIGURE
|
33 | 33 | from common import RunnerCore, path_from_root, is_slow_test, ensure_dir, disabled, make_executable
|
34 | 34 | from common import env_modify, no_mac, no_windows, requires_native_clang, with_env_modify
|
@@ -149,7 +149,28 @@ def decorated(self, *args, **kwargs):
|
149 | 149 |
|
150 | 150 |
|
151 | 151 | def llvm_nm(file):
|
152 |
| - return building.llvm_nm_multiple([file])[0] |
| 152 | + output = shared.run_process([LLVM_NM, file], stdout=PIPE).stdout |
| 153 | + |
| 154 | + symbols = { |
| 155 | + 'defs': set(), |
| 156 | + 'undefs': set(), |
| 157 | + 'commons': set(), |
| 158 | + } |
| 159 | + |
| 160 | + for line in output.splitlines(): |
| 161 | + # Skip address, which is always fixed-length 8 chars (plus 2 |
| 162 | + # leading chars `: ` and one trailing space) |
| 163 | + status = line[9] |
| 164 | + symbol = line[11:] |
| 165 | + |
| 166 | + if status == 'U': |
| 167 | + symbols['undefs'].add(symbol) |
| 168 | + elif status == 'C': |
| 169 | + symbols['commons'].add(symbol) |
| 170 | + elif status == status.upper(): |
| 171 | + symbols['defs'].add(symbol) |
| 172 | + |
| 173 | + return symbols |
153 | 174 |
|
154 | 175 |
|
155 | 176 | class other(RunnerCore):
|
|
0 commit comments