Skip to content

Commit

Permalink
Use xcrun to invoke install_name_tool
Browse files Browse the repository at this point in the history
`/usr/bin/install_name_tool` is a shim; it invokes install_name_tool in the current active Xcode.

This allows using this template file to configure toolchain on non-macOS. This doesn't change the behavior as both will end up invoking the same tool.

replaces bazelbuild#13462

Closes bazelbuild#16951.

PiperOrigin-RevId: 501557408
Change-Id: Ibf0b90aaf18bd703079296248cd66dc6f86359f1
  • Loading branch information
keith authored and copybara-github committed Jan 12, 2023
1 parent e8182ce commit 8ec8743
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tools/cpp/osx_cc_wrapper.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#
set -eu

INSTALL_NAME_TOOL="/usr/bin/install_name_tool"

LIBS=
LIB_DIRS=
RPATHS=
Expand Down Expand Up @@ -110,7 +108,7 @@ for rpath in ${RPATHS}; do
if [[ -n "${libname-}" ]]; then
libpath=$(get_library_path ${lib})
if [ -n "${libpath}" ]; then
${INSTALL_NAME_TOOL} -change $(get_otool_path "${libpath}") \
/usr/bin/xcrun install_name_tool -change $(get_otool_path "${libpath}") \
"@loader_path/${rpath}/${libname}" "${OUTPUT}"
fi
fi
Expand Down

0 comments on commit 8ec8743

Please sign in to comment.