From 86ec753e258edb7755be7cb827e09b7fb9763827 Mon Sep 17 00:00:00 2001 From: Ned Deily Date: Tue, 6 Sep 2016 15:09:20 -0700 Subject: [PATCH 02/16] Issue #21122: Fix LTO builds on OS X. Patch by Brett Cannon. --- configure | 13 ++++++++++--- configure.ac | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 5640c2dc12..191425c1b8 100755 --- a/configure +++ b/configure @@ -6582,13 +6582,20 @@ fi if test "$Py_LTO" = 'true' ; then case $CC in *clang*) - # Any changes made here should be reflected in the GCC+Darwin case below - LTOFLAGS="-flto" + case $ac_sys_system in + Darwin*) + # Any changes made here should be reflected in the GCC+Darwin case below + LTOFLAGS="-flto -Wl,-export_dynamic" + ;; + *) + LTOFLAGS="-flto" + ;; + esac ;; *gcc*) case $ac_sys_system in Darwin*) - LTOFLAGS="-flto" + LTOFLAGS="-flto -Wl,-export_dynamic" ;; *) LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none" diff --git a/configure.ac b/configure.ac index c9b755f0f4..4d7ed101a2 100644 --- a/configure.ac +++ b/configure.ac @@ -1268,13 +1268,20 @@ fi], if test "$Py_LTO" = 'true' ; then case $CC in *clang*) - # Any changes made here should be reflected in the GCC+Darwin case below - LTOFLAGS="-flto" + case $ac_sys_system in + Darwin*) + # Any changes made here should be reflected in the GCC+Darwin case below + LTOFLAGS="-flto -Wl,-export_dynamic" + ;; + *) + LTOFLAGS="-flto" + ;; + esac ;; *gcc*) case $ac_sys_system in Darwin*) - LTOFLAGS="-flto" + LTOFLAGS="-flto -Wl,-export_dynamic" ;; *) LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none" -- 2.14.3 (Apple Git-98)