Skip to content

Commit b811b47

Browse files
committed
Check for invalid symbol names in llvm-nm output.
See #12551 and: #17826 Older versions of llvm didn't used to mangle these __invoke symbols.
1 parent c7416fd commit b811b47

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/building.py

+3
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,9 @@ def parse_llvm_nm_symbols(output):
575575
filename_pos = entry_pos
576576

577577
filename = line[:filename_pos]
578+
if entry_pos + 14 >= len(line):
579+
exit_with_error('error parsing output of llvm-nm: `%s`\nIf the symbol name here contains a colon, and starts with __invoke_, then the object file was likely built with and old version of llvm.' % line)
580+
578581
status = line[entry_pos + 11] # Skip address, which is always fixed-length 8 chars.
579582
symbol = line[entry_pos + 13:]
580583

0 commit comments

Comments
 (0)