mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-15 04:29:42 +00:00
[compiler-rt] Allow nm program to be over-ridden for global symbol detection
Summary: While cross-compiling, a custom nm program may be required. This will also allow for the use of llvm-nm if desired. Reviewers: samsonov, beanz, compnerd, eugenis Subscribers: kubabrecka, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D23278 llvm-svn: 278187
This commit is contained in:
parent
021eba31dd
commit
81378e46bb
@ -42,11 +42,12 @@ versioned_functions = set(['memcpy', 'pthread_attr_getaffinity_np',
|
||||
|
||||
def get_global_functions(library):
|
||||
functions = []
|
||||
nm_proc = subprocess.Popen(['nm', library], stdout=subprocess.PIPE,
|
||||
nm = os.environ.get('NM', 'nm')
|
||||
nm_proc = subprocess.Popen([nm, library], stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
nm_out = nm_proc.communicate()[0].decode().split('\n')
|
||||
if nm_proc.returncode != 0:
|
||||
raise subprocess.CalledProcessError(nm_proc.returncode, 'nm')
|
||||
raise subprocess.CalledProcessError(nm_proc.returncode, nm)
|
||||
func_symbols = ['T', 'W']
|
||||
# On PowerPC, nm prints function descriptors from .data section.
|
||||
if os.uname()[4] in ["powerpc", "ppc64"]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user