Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
[compiler-rt] Allow nm program to be over-ridden for global symbol de…
Browse files Browse the repository at this point in the history
…tection

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278187 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
fjricci committed Aug 10, 2016
1 parent 9893535 commit d5bca33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/sanitizer_common/scripts/gen_dynamic_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@

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"]:
Expand Down

0 comments on commit d5bca33

Please sign in to comment.