From 8bf8de8531205c6fbacd1b62138dc676e256ade6 Mon Sep 17 00:00:00 2001 From: Rishav Kundu Date: Sun, 9 May 2021 05:36:48 +0530 Subject: [PATCH 1/2] bpo-43109: Use /usr/bin/ar on macOS for LTO builds --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 4fc269a73092994..5767aa38cbc386d 100644 --- a/configure.ac +++ b/configure.ac @@ -1392,6 +1392,11 @@ if test "$Py_LTO" = 'true' ; then LLVM_AR_FOUND=found AC_MSG_NOTICE([llvm-ar found via xcrun: ${LLVM_AR}]) fi + # /usr/bin/ar on macOS works fine in place of llvm-ar + # https://github.com/Homebrew/homebrew-core/pull/70177 + LLVM_AR='/usr/bin/ar' + LLVM_AR_FOUND=found + AC_MSG_NOTICE(["using /usr/bin/ar for llvm-ar"]) fi if test $LLVM_AR_FOUND = not-found then From aad92dfc14e9cd216bf19f3f33278ed0dbe54703 Mon Sep 17 00:00:00 2001 From: Rishav Kundu Date: Mon, 10 May 2021 09:15:36 +0530 Subject: [PATCH 2/2] Test for existence of of /usr/bin/ar --- configure.ac | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 5767aa38cbc386d..8065ec440b5ff36 100644 --- a/configure.ac +++ b/configure.ac @@ -1391,12 +1391,14 @@ if test "$Py_LTO" = 'true' ; then LLVM_AR='/usr/bin/xcrun llvm-ar' LLVM_AR_FOUND=found AC_MSG_NOTICE([llvm-ar found via xcrun: ${LLVM_AR}]) + elif test -x /usr/bin/ar + then + # /usr/bin/ar on macOS works fine in place of llvm-ar + # https://github.com/Homebrew/homebrew-core/pull/70177 + LLVM_AR='/usr/bin/ar' + LLVM_AR_FOUND=found + AC_MSG_NOTICE(["using /usr/bin/ar for llvm-ar"]) fi - # /usr/bin/ar on macOS works fine in place of llvm-ar - # https://github.com/Homebrew/homebrew-core/pull/70177 - LLVM_AR='/usr/bin/ar' - LLVM_AR_FOUND=found - AC_MSG_NOTICE(["using /usr/bin/ar for llvm-ar"]) fi if test $LLVM_AR_FOUND = not-found then