summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-05-25 04:21:28 (GMT)
committerGitHub <noreply@github.com>2021-05-25 04:21:28 (GMT)
commit3af61a7176a68bfeb349eeed314b9c3d7ebc3ad5 (patch)
tree7ee6c9087b10141fbcc0d3a1760aaa206130771a /configure
parentab4da079232356e781743b2782148bc7c03f1ee3 (diff)
downloadcpython-3af61a7176a68bfeb349eeed314b9c3d7ebc3ad5.zip
cpython-3af61a7176a68bfeb349eeed314b9c3d7ebc3ad5.tar.gz
cpython-3af61a7176a68bfeb349eeed314b9c3d7ebc3ad5.tar.bz2
bpo-43109: Fix --with-lto configure option on macOS (GH-26341) (GH-26343)
Allow --with-lto configure option to work with Apple-supplied Xcode or Command Line Tools which do not provide llvm-ar. (cherry picked from commit 59acfd4a09df1c141dac7845eed008af8970fce7) Co-authored-by: Ned Deily <nad@python.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure9
1 files changed, 6 insertions, 3 deletions
diff --git a/configure b/configure
index c584866..ffa61c1 100755
--- a/configure
+++ b/configure
@@ -6650,10 +6650,11 @@ fi
fi
if test "$ac_sys_system" = "Darwin" -a "${LLVM_AR_FOUND}" = "not-found"
then
- found_llvm_ar=`/usr/bin/xcrun -find llvm-ar 2>/dev/null`
+ # The Apple-supplied ar in Xcode or the Command Line Tools is apparently sufficient
+ found_llvm_ar=`/usr/bin/xcrun -find ar 2>/dev/null`
if test -n "${found_llvm_ar}"
then
- LLVM_AR='/usr/bin/xcrun llvm-ar'
+ LLVM_AR='/usr/bin/xcrun ar'
LLVM_AR_FOUND=found
{ $as_echo "$as_me:${as_lineno-$LINENO}: llvm-ar found via xcrun: ${LLVM_AR}" >&5
$as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;}
@@ -6671,6 +6672,7 @@ $as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;}
Darwin*)
# Any changes made here should be reflected in the GCC+Darwin case below
LTOFLAGS="-flto -Wl,-export_dynamic"
+ LTOCFLAGS="-flto"
;;
*)
LTOFLAGS="-flto"
@@ -6681,6 +6683,7 @@ $as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;}
case $ac_sys_system in
Darwin*)
LTOFLAGS="-flto -Wl,-export_dynamic"
+ LTOCFLAGS="-flto"
;;
*)
LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"
@@ -6696,7 +6699,7 @@ $as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;}
LTOFLAGS="$LTOFLAGS -g"
fi
- CFLAGS_NODIST="$CFLAGS_NODIST $LTOFLAGS"
+ CFLAGS_NODIST="$CFLAGS_NODIST ${LTOCFLAGS-$LTOFLAGS}"
LDFLAGS_NODIST="$LDFLAGS_NODIST $LTOFLAGS"
fi