Skip to content

Commit

Permalink
Bug 1067893 - Detect OTOOL in configure. r=glandium
Browse files Browse the repository at this point in the history
  • Loading branch information
gk-tpo committed Nov 25, 2014
1 parent eadbf23 commit b01d03f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions build/autoconf/toolchain.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion build/macosx/universal/mozconfig.common
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion build/unix/rewrite_asan_dylib.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import subprocess
import shutil
from buildconfig import substs

'''
Scans the given directories for binaries referencing the AddressSanitizer
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=
Expand Down
3 changes: 2 additions & 1 deletion toolkit/library/dependentlibs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
ELF,
MACHO,
)
from buildconfig import substs

TOOLCHAIN_PREFIX = ''

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b01d03f

Please sign in to comment.