mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-45743: -Wl,-search_paths_first is no longer needed (GH-29464)
This commit is contained in:
parent
cfc9154121
commit
8fefaad242
4 changed files with 5 additions and 80 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
On macOS, the build system no longer passes ``search_paths_first`` to the
|
||||||
|
linker. The flag has been the default since Xcode 4 / macOS 10.6.
|
16
configure
vendored
16
configure
vendored
|
@ -12886,15 +12886,6 @@ $as_echo "#define HAVE_LCHFLAGS 1" >>confdefs.h
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for compression libraries
|
# Check for compression libraries
|
||||||
case $ac_sys_system/$ac_sys_release in
|
|
||||||
Darwin/*)
|
|
||||||
_CUR_CFLAGS="${CFLAGS}"
|
|
||||||
_CUR_LDFLAGS="${LDFLAGS}"
|
|
||||||
CFLAGS="${CFLAGS} -Wl,-search_paths_first"
|
|
||||||
LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5
|
||||||
$as_echo_n "checking for inflateCopy in -lz... " >&6; }
|
$as_echo_n "checking for inflateCopy in -lz... " >&6; }
|
||||||
if ${ac_cv_lib_z_inflateCopy+:} false; then :
|
if ${ac_cv_lib_z_inflateCopy+:} false; then :
|
||||||
|
@ -12938,13 +12929,6 @@ $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
case $ac_sys_system/$ac_sys_release in
|
|
||||||
Darwin/*)
|
|
||||||
CFLAGS="${_CUR_CFLAGS}"
|
|
||||||
LDFLAGS="${_CUR_LDFLAGS}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hstrerror" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hstrerror" >&5
|
||||||
|
|
26
configure.ac
26
configure.ac
|
@ -3833,34 +3833,8 @@ fi
|
||||||
|
|
||||||
# Check for compression libraries
|
# Check for compression libraries
|
||||||
dnl Check if system zlib has *Copy() functions
|
dnl Check if system zlib has *Copy() functions
|
||||||
dnl
|
|
||||||
dnl On MacOSX the linker will search for dylibs on the entire linker path
|
|
||||||
dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first
|
|
||||||
dnl to revert to a more traditional unix behaviour and make it possible to
|
|
||||||
dnl override the system libz with a local static library of libz. Temporarily
|
|
||||||
dnl add that flag to our CFLAGS as well to ensure that we check the version
|
|
||||||
dnl of libz that will be used by setup.py.
|
|
||||||
dnl The -L/usr/local/lib is needed as wel to get the same compilation
|
|
||||||
dnl environment as setup.py (and leaving it out can cause configure to use the
|
|
||||||
dnl wrong version of the library)
|
|
||||||
case $ac_sys_system/$ac_sys_release in
|
|
||||||
Darwin/*)
|
|
||||||
_CUR_CFLAGS="${CFLAGS}"
|
|
||||||
_CUR_LDFLAGS="${LDFLAGS}"
|
|
||||||
CFLAGS="${CFLAGS} -Wl,-search_paths_first"
|
|
||||||
LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, [Define if the zlib library has inflateCopy]))
|
AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, [Define if the zlib library has inflateCopy]))
|
||||||
|
|
||||||
case $ac_sys_system/$ac_sys_release in
|
|
||||||
Darwin/*)
|
|
||||||
CFLAGS="${_CUR_CFLAGS}"
|
|
||||||
LDFLAGS="${_CUR_LDFLAGS}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
PY_CHECK_FUNC([hstrerror], [#include <netdb.h>])
|
PY_CHECK_FUNC([hstrerror], [#include <netdb.h>])
|
||||||
|
|
||||||
PY_CHECK_FUNC([inet_aton], [
|
PY_CHECK_FUNC([inet_aton], [
|
||||||
|
|
41
setup.py
41
setup.py
|
@ -1118,16 +1118,6 @@ class PyBuildExt(build_ext):
|
||||||
if find_file('readline/rlconf.h', self.inc_dirs, []) is None:
|
if find_file('readline/rlconf.h', self.inc_dirs, []) is None:
|
||||||
do_readline = False
|
do_readline = False
|
||||||
if do_readline:
|
if do_readline:
|
||||||
if MACOS and os_release < 9:
|
|
||||||
# In every directory on the search path search for a dynamic
|
|
||||||
# library and then a static library, instead of first looking
|
|
||||||
# for dynamic libraries on the entire path.
|
|
||||||
# This way a statically linked custom readline gets picked up
|
|
||||||
# before the (possibly broken) dynamic library in /usr/lib.
|
|
||||||
readline_extra_link_args = ('-Wl,-search_paths_first',)
|
|
||||||
else:
|
|
||||||
readline_extra_link_args = ()
|
|
||||||
|
|
||||||
readline_libs = [readline_lib]
|
readline_libs = [readline_lib]
|
||||||
if readline_termcap_library:
|
if readline_termcap_library:
|
||||||
pass # Issue 7384: Already linked against curses or tinfo.
|
pass # Issue 7384: Already linked against curses or tinfo.
|
||||||
|
@ -1139,7 +1129,6 @@ class PyBuildExt(build_ext):
|
||||||
readline_libs.append('termcap')
|
readline_libs.append('termcap')
|
||||||
self.add(Extension('readline', ['readline.c'],
|
self.add(Extension('readline', ['readline.c'],
|
||||||
library_dirs=['/usr/lib/termcap'],
|
library_dirs=['/usr/lib/termcap'],
|
||||||
extra_link_args=readline_extra_link_args,
|
|
||||||
libraries=readline_libs))
|
libraries=readline_libs))
|
||||||
else:
|
else:
|
||||||
self.missing.append('readline')
|
self.missing.append('readline')
|
||||||
|
@ -1603,16 +1592,6 @@ class PyBuildExt(build_ext):
|
||||||
):
|
):
|
||||||
raise DistutilsError("System version of SQLite does not support loadable extensions")
|
raise DistutilsError("System version of SQLite does not support loadable extensions")
|
||||||
|
|
||||||
if MACOS:
|
|
||||||
# In every directory on the search path search for a dynamic
|
|
||||||
# library and then a static library, instead of first looking
|
|
||||||
# for dynamic libraries on the entire path.
|
|
||||||
# This way a statically linked custom sqlite gets picked up
|
|
||||||
# before the dynamic library in /usr/lib.
|
|
||||||
sqlite_extra_link_args = ('-Wl,-search_paths_first',)
|
|
||||||
else:
|
|
||||||
sqlite_extra_link_args = ()
|
|
||||||
|
|
||||||
include_dirs = ["Modules/_sqlite"]
|
include_dirs = ["Modules/_sqlite"]
|
||||||
# Only include the directory where sqlite was found if it does
|
# Only include the directory where sqlite was found if it does
|
||||||
# not already exist in set include directories, otherwise you
|
# not already exist in set include directories, otherwise you
|
||||||
|
@ -1626,7 +1605,6 @@ class PyBuildExt(build_ext):
|
||||||
define_macros=sqlite_defines,
|
define_macros=sqlite_defines,
|
||||||
include_dirs=include_dirs,
|
include_dirs=include_dirs,
|
||||||
library_dirs=sqlite_libdir,
|
library_dirs=sqlite_libdir,
|
||||||
extra_link_args=sqlite_extra_link_args,
|
|
||||||
libraries=["sqlite3",]))
|
libraries=["sqlite3",]))
|
||||||
else:
|
else:
|
||||||
self.missing.append('_sqlite3')
|
self.missing.append('_sqlite3')
|
||||||
|
@ -1685,13 +1663,8 @@ class PyBuildExt(build_ext):
|
||||||
break
|
break
|
||||||
if version >= version_req:
|
if version >= version_req:
|
||||||
if (self.compiler.find_library_file(self.lib_dirs, 'z')):
|
if (self.compiler.find_library_file(self.lib_dirs, 'z')):
|
||||||
if MACOS:
|
|
||||||
zlib_extra_link_args = ('-Wl,-search_paths_first',)
|
|
||||||
else:
|
|
||||||
zlib_extra_link_args = ()
|
|
||||||
self.add(Extension('zlib', ['zlibmodule.c'],
|
self.add(Extension('zlib', ['zlibmodule.c'],
|
||||||
libraries=['z'],
|
libraries=['z']))
|
||||||
extra_link_args=zlib_extra_link_args))
|
|
||||||
have_zlib = True
|
have_zlib = True
|
||||||
else:
|
else:
|
||||||
self.missing.append('zlib')
|
self.missing.append('zlib')
|
||||||
|
@ -1706,24 +1679,16 @@ class PyBuildExt(build_ext):
|
||||||
if have_zlib:
|
if have_zlib:
|
||||||
extra_compile_args.append('-DUSE_ZLIB_CRC32')
|
extra_compile_args.append('-DUSE_ZLIB_CRC32')
|
||||||
libraries = ['z']
|
libraries = ['z']
|
||||||
extra_link_args = zlib_extra_link_args
|
|
||||||
else:
|
else:
|
||||||
libraries = []
|
libraries = []
|
||||||
extra_link_args = []
|
|
||||||
self.add(Extension('binascii', ['binascii.c'],
|
self.add(Extension('binascii', ['binascii.c'],
|
||||||
extra_compile_args=extra_compile_args,
|
extra_compile_args=extra_compile_args,
|
||||||
libraries=libraries,
|
libraries=libraries))
|
||||||
extra_link_args=extra_link_args))
|
|
||||||
|
|
||||||
# Gustavo Niemeyer's bz2 module.
|
# Gustavo Niemeyer's bz2 module.
|
||||||
if (self.compiler.find_library_file(self.lib_dirs, 'bz2')):
|
if (self.compiler.find_library_file(self.lib_dirs, 'bz2')):
|
||||||
if MACOS:
|
|
||||||
bz2_extra_link_args = ('-Wl,-search_paths_first',)
|
|
||||||
else:
|
|
||||||
bz2_extra_link_args = ()
|
|
||||||
self.add(Extension('_bz2', ['_bz2module.c'],
|
self.add(Extension('_bz2', ['_bz2module.c'],
|
||||||
libraries=['bz2'],
|
libraries=['bz2']))
|
||||||
extra_link_args=bz2_extra_link_args))
|
|
||||||
else:
|
else:
|
||||||
self.missing.append('_bz2')
|
self.missing.append('_bz2')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue