summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2022-08-27 00:49:41 (GMT)
committerGitHub <noreply@github.com>2022-08-27 00:49:41 (GMT)
commit5b070c0d40b0c7dd83b8c4eaa44812e9d2af14f9 (patch)
treed0ef44366854d96a0b3a7d30ed530a471cda48f9 /configure
parent43a6deadbb40bc93e0eaebb3c56c34f8a3502132 (diff)
downloadcpython-5b070c0d40b0c7dd83b8c4eaa44812e9d2af14f9.zip
cpython-5b070c0d40b0c7dd83b8c4eaa44812e9d2af14f9.tar.gz
cpython-5b070c0d40b0c7dd83b8c4eaa44812e9d2af14f9.tar.bz2
gh-95973: Add a new --with-dsymutil option to link debug information in macOS (GH-95974)
Automerge-Triggered-By: GH:pablogsal
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure86
1 files changed, 83 insertions, 3 deletions
diff --git a/configure b/configure
index 1801f80..ee2eabb 100755
--- a/configure
+++ b/configure
@@ -869,6 +869,8 @@ BLDSHARED
LDCXXSHARED
LDSHARED
SHLIB_SUFFIX
+DSYMUTIL_PATH
+DSYMUTIL
LIBTOOL_CRUFT
OTHER_LIBTOOL_OPT
UNIVERSAL_ARCH_FLAGS
@@ -1053,6 +1055,7 @@ with_assertions
enable_optimizations
with_lto
enable_bolt
+with_dsymutil
with_address_sanitizer
with_memory_sanitizer
with_undefined_behavior_sanitizer
@@ -1824,6 +1827,8 @@ Optional Packages:
--with-lto=[full|thin|no|yes]
enable Link-Time-Optimization in any build (default
is no)
+ --with-dsymutil link debug information into final executable with
+ dsymutil in macOS (default is no)
--with-address-sanitizer
enable AddressSanitizer memory error detector,
'asan' (default is no)
@@ -7831,10 +7836,10 @@ $as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;}
# Any changes made here should be reflected in the GCC+Darwin case below
if test $Py_LTO_POLICY = default
then
- LTOFLAGS="-flto -Wl,-export_dynamic"
+ LTOFLAGS="-flto -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
LTOCFLAGS="-flto"
else
- LTOFLAGS="-flto=${Py_LTO_POLICY} -Wl,-export_dynamic"
+ LTOFLAGS="-flto=${Py_LTO_POLICY} -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
LTOCFLAGS="-flto=${Py_LTO_POLICY}"
fi
;;
@@ -7863,7 +7868,7 @@ $as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;}
LDFLAGS_NOLTO="-fno-lto"
case $ac_sys_system in
Darwin*)
- LTOFLAGS="-flto -Wl,-export_dynamic"
+ LTOFLAGS="-flto -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
LTOCFLAGS="-flto"
;;
*)
@@ -10974,6 +10979,81 @@ else
$as_echo "no" >&6; }
fi
+# Check for --with-dsymutil
+
+
+DSYMUTIL=
+DSYMUTIL_PATH=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dsymutil" >&5
+$as_echo_n "checking for --with-dsymutil... " >&6; }
+
+# Check whether --with-dsymutil was given.
+if test "${with_dsymutil+set}" = set; then :
+ withval=$with_dsymutil;
+if test "$withval" != no
+then
+ if test "$MACHDEP" != "darwin"; then
+ as_fn_error $? "dsymutil debug linking is only available in macOS." "$LINENO" 5
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };
+ DSYMUTIL='true'
+else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; DSYMUTIL=
+fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test "$DSYMUTIL"; then
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_DSYMUTIL_PATH+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $DSYMUTIL_PATH in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_DSYMUTIL_PATH="$DSYMUTIL_PATH" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_DSYMUTIL_PATH="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_DSYMUTIL_PATH" && ac_cv_path_DSYMUTIL_PATH="not found"
+ ;;
+esac
+fi
+DSYMUTIL_PATH=$ac_cv_path_DSYMUTIL_PATH
+if test -n "$DSYMUTIL_PATH"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL_PATH" >&5
+$as_echo "$DSYMUTIL_PATH" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "$DSYMUTIL_PATH" = "not found"; then
+ as_fn_error $? "dsymutil command not found on \$PATH" "$LINENO" 5
+ fi
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dyld" >&5
$as_echo_n "checking for dyld... " >&6; }
case $ac_sys_system/$ac_sys_release in