From 8ec874348226995c4101b2173a465ddc65cab591 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Thu, 12 Jan 2023 07:14:47 -0800 Subject: [PATCH] Use xcrun to invoke install_name_tool `/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 https://github.com/bazelbuild/bazel/pull/13462 Closes #16951. PiperOrigin-RevId: 501557408 Change-Id: Ibf0b90aaf18bd703079296248cd66dc6f86359f1 --- tools/cpp/osx_cc_wrapper.sh.tpl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/cpp/osx_cc_wrapper.sh.tpl b/tools/cpp/osx_cc_wrapper.sh.tpl index ab58d1f1df4fd5..8264090c29604d 100644 --- a/tools/cpp/osx_cc_wrapper.sh.tpl +++ b/tools/cpp/osx_cc_wrapper.sh.tpl @@ -27,8 +27,6 @@ # set -eu -INSTALL_NAME_TOOL="/usr/bin/install_name_tool" - LIBS= LIB_DIRS= RPATHS= @@ -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