summaryrefslogtreecommitdiffstats
path: root/configure.ac
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.ac
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.ac')
-rw-r--r--configure.ac33
1 files changed, 30 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index bb9fec0..02e5d67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1863,10 +1863,10 @@ if test "$Py_LTO" = 'true' ; then
# 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
;;
@@ -1896,7 +1896,7 @@ if test "$Py_LTO" = 'true' ; then
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"
;;
*)
@@ -3053,6 +3053,33 @@ else
AC_MSG_RESULT(no)
fi
+# Check for --with-dsymutil
+AC_SUBST(DSYMUTIL)
+AC_SUBST(DSYMUTIL_PATH)
+DSYMUTIL=
+DSYMUTIL_PATH=
+AC_MSG_CHECKING(for --with-dsymutil)
+AC_ARG_WITH(dsymutil,
+ AS_HELP_STRING([--with-dsymutil], [link debug information into final executable with dsymutil in macOS (default is no)]),
+[
+if test "$withval" != no
+then
+ if test "$MACHDEP" != "darwin"; then
+ AC_MSG_ERROR([dsymutil debug linking is only available in macOS.])
+ fi
+ AC_MSG_RESULT(yes);
+ DSYMUTIL='true'
+else AC_MSG_RESULT(no); DSYMUTIL=
+fi],
+[AC_MSG_RESULT(no)])
+
+if test "$DSYMUTIL"; then
+ AC_PATH_PROG(DSYMUTIL_PATH, [dsymutil], [not found])
+ if test "$DSYMUTIL_PATH" = "not found"; then
+ AC_MSG_ERROR([dsymutil command not found on \$PATH])
+ fi
+fi
+
AC_MSG_CHECKING(for dyld)
case $ac_sys_system/$ac_sys_release in
Darwin/*)