diff --git a/build/autoconf/toolchain.m4 b/build/autoconf/toolchain.m4 index 4a2dfcf669e..e6f24937dd9 100644 --- a/build/autoconf/toolchain.m4 +++ b/build/autoconf/toolchain.m4 @@ -161,6 +161,7 @@ MOZ_PATH_PROGS(AS, "${target_alias}-as" "${target}-as", :) AC_CHECK_PROGS(LD, "${target_alias}-ld" "${target}-ld", :) AC_CHECK_PROGS(STRIP, "${target_alias}-strip" "${target}-strip", :) AC_CHECK_PROGS(WINDRES, "${target_alias}-windres" "${target}-windres", :) +AC_CHECK_PROGS(OTOOL, "${target_alias}-otool" "${target}-otool", :) AC_DEFINE(CROSS_COMPILE) CROSS_COMPILE=1 diff --git a/build/macosx/universal/mozconfig.common b/build/macosx/universal/mozconfig.common index c351b304cc6..518274b51bc 100644 --- a/build/macosx/universal/mozconfig.common +++ b/build/macosx/universal/mozconfig.common @@ -42,12 +42,13 @@ if test "$MOZ_BUILD_APP" = "i386" -o "$MOZ_BUILD_APP" = "x86_64"; then AS=$CC LD=ld STRIP="strip" + OTOOL="otool" # Each per-CPU build should be entirely oblivious to the fact that a # universal binary will be produced. The exception is packager.mk, which # needs to know to look for universal bits when building the .dmg. UNIVERSAL_BINARY=1 - export CC CXX HOST_CC HOST_CXX RANLIB AR AS LD STRIP + export CC CXX HOST_CC HOST_CXX RANLIB AR AS LD STRIP OTOOL fi fi diff --git a/build/unix/rewrite_asan_dylib.py b/build/unix/rewrite_asan_dylib.py index 869c46e2957..6e30374b724 100644 --- a/build/unix/rewrite_asan_dylib.py +++ b/build/unix/rewrite_asan_dylib.py @@ -6,6 +6,7 @@ import sys import os import subprocess import shutil +from buildconfig import substs ''' Scans the given directories for binaries referencing the AddressSanitizer @@ -28,7 +29,7 @@ def scan_directory(path): continue try: - otoolOut = subprocess.check_output(['otool', '-L', filename]) + otoolOut = subprocess.check_output([substs['OTOOL'], '-L', filename]) except: # Errors are expected on non-mach executables, ignore them and continue continue diff --git a/configure.in b/configure.in index 1aae34cf00f..4f5126533b4 100644 --- a/configure.in +++ b/configure.in @@ -370,6 +370,7 @@ else AC_CHECK_PROGS(LD, ld, :) AC_CHECK_PROGS(STRIP, strip, :) AC_CHECK_PROGS(WINDRES, windres, :) + AC_CHECK_PROGS(OTOOL, otool, :) if test -z "$HOST_CC"; then HOST_CC="$CC" fi @@ -7173,12 +7174,12 @@ elif test -n "$MOZ_REPLACE_MALLOC"; then dnl - classic info only (for OSX < 10.6) dnl - dyld info only dnl - both - if otool -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO_ONLY" > /dev/null; then + if "$OTOOL" -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO_ONLY" > /dev/null; then _CLASSIC_INFO= else _CLASSIC_INFO=1 fi - if otool -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO" > /dev/null; then + if "$OTOOL" -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO" > /dev/null; then _DYLD_INFO=1 else _DYLD_INFO= diff --git a/toolkit/library/dependentlibs.py b/toolkit/library/dependentlibs.py index 43433a1b0d8..f4e249021b1 100644 --- a/toolkit/library/dependentlibs.py +++ b/toolkit/library/dependentlibs.py @@ -17,6 +17,7 @@ from mozpack.executables import ( ELF, MACHO, ) +from buildconfig import substs TOOLCHAIN_PREFIX = '' @@ -71,7 +72,7 @@ def dependentlibs_readelf(lib): def dependentlibs_otool(lib): '''Returns the list of dependencies declared in the given MACH-O dylib''' - proc = subprocess.Popen(['otool', '-l', lib], stdout = subprocess.PIPE) + proc = subprocess.Popen([substs['OTOOL'], '-l', lib], stdout = subprocess.PIPE) deps= [] cmd = None for line in proc.stdout: