# HG changeset patch # User Tom Ritter # Date 1524842735 18000 # Node ID f4a56903882a4b6a9c8fa96b80228573cc2a67ab # Parent 9be1bcc4ef0ed00ec234cb3203fe5c9c596041df Bug 1457483 Retrieve nm from environment for check_vanilla_allocations.py r=glandium MozReview-Commit-ID: HIZpMk4Ierb diff --git a/config/check_vanilla_allocations.py b/config/check_vanilla_allocations.py --- a/config/check_vanilla_allocations.py +++ b/config/check_vanilla_allocations.py @@ -37,16 +37,17 @@ #---------------------------------------------------------------------------- from __future__ import print_function import argparse import re import subprocess import sys +import buildconfig # The obvious way to implement this script is to search for occurrences of # malloc et al, succeed if none are found, and fail is some are found. # However, "none are found" does not necessarily mean "none are present" -- # this script could be buggy. (Or the output format of |nm| might change in # the future.) # # So jsutil.cpp deliberately contains a (never-called) function that contains a @@ -71,17 +72,18 @@ def main(): parser.add_argument('file', type=str, help='name of the file to check') args = parser.parse_args() # Run |nm|. Options: # -u: show only undefined symbols # -C: demangle symbol names # -A: show an object filename for each undefined symbol - cmd = ['nm', '-u', '-C', '-A', args.file] + nm = buildconfig.substs.get('NM') or 'nm' + cmd = [nm, '-u', '-C', '-A', args.file] lines = subprocess.check_output(cmd, universal_newlines=True, stderr=subprocess.PIPE).split('\n') # alloc_fns contains all the vanilla allocation/free functions that we look # for. Regexp chars are escaped appropriately. alloc_fns = [ # Matches |operator new(unsigned T)|, where |T| is |int| or |long|. diff --git a/js/src/old-configure.in b/js/src/old-configure.in --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -1638,16 +1638,17 @@ dnl = dnl = Maintainer debug option (no --enable equivalent) dnl = dnl ======================================================== AC_SUBST(AR) AC_SUBST(AR_FLAGS) AC_SUBST(AR_EXTRACT) AC_SUBST(AS) +AC_SUBST(NM) AC_SUBST_LIST(ASFLAGS) AC_SUBST(AS_DASH_C_FLAG) AC_SUBST(RC) AC_SUBST(RCFLAGS) AC_SUBST(WINDRES) AC_SUBST(IMPLIB) AC_SUBST(FILTER) AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS) diff --git a/old-configure.in b/old-configure.in --- a/old-configure.in +++ b/old-configure.in @@ -3727,16 +3727,17 @@ dnl = dnl = Maintainer debug option (no --enable equivalent) dnl = dnl ======================================================== AC_SUBST(AR) AC_SUBST(AR_FLAGS) AC_SUBST(AR_EXTRACT) AC_SUBST(AS) +AC_SUBST(NM) AC_SUBST_LIST(ASFLAGS) AC_SUBST(AS_DASH_C_FLAG) AC_SUBST(RC) AC_SUBST(RCFLAGS) AC_SUBST(WINDRES) AC_SUBST(IMPLIB) AC_SUBST(FILTER) AC_SUBST(MOZ_AUTH_EXTENSION)