uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
|
||||
index c3682b4..16826c6 100644
|
||||
--- a/Modules/posixmodule.c
|
||||
+++ b/Modules/posixmodule.c
|
||||
@@ -5880,15 +5880,13 @@ error:
|
||||
#if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) || defined(HAVE_DEV_PTMX)
|
||||
#ifdef HAVE_PTY_H
|
||||
#include <pty.h>
|
||||
-#else
|
||||
+#endif
|
||||
#ifdef HAVE_LIBUTIL_H
|
||||
#include <libutil.h>
|
||||
-#else
|
||||
+#endif
|
||||
#ifdef HAVE_UTIL_H
|
||||
#include <util.h>
|
||||
-#endif /* HAVE_UTIL_H */
|
||||
-#endif /* HAVE_LIBUTIL_H */
|
||||
-#endif /* HAVE_PTY_H */
|
||||
+#endif
|
||||
#ifdef HAVE_STROPTS_H
|
||||
#include <stropts.h>
|
||||
#endif
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
From debccd4be0a8d619770f63622d9de1b451dd02ac Mon Sep 17 00:00:00 2001
|
||||
From: Ben Wolsieffer <benwolsieffer@gmail.com>
|
||||
Date: Fri, 25 Sep 2020 16:49:16 -0400
|
||||
Subject: [PATCH] Fix finding headers when cross compiling
|
||||
|
||||
When cross-compiling third-party extensions, get_python_inc() may be called to
|
||||
return the path to Python's headers. However, it uses the sys.prefix or
|
||||
sys.exec_prefix of the build Python, which returns incorrect paths when
|
||||
cross-compiling (paths pointing to build system headers).
|
||||
|
||||
To fix this, we use the INCLUDEPY and CONFINCLUDEPY conf variables, which can
|
||||
be configured to point at host Python by setting _PYTHON_SYSCONFIGDATA_NAME.
|
||||
The existing behavior is maintained on non-POSIX platforms or if a prefix is
|
||||
manually specified.
|
||||
---
|
||||
Lib/distutils/sysconfig.py | 14 ++++++++++----
|
||||
1 file changed, 10 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
|
||||
index 37feae5df7..6d4ad06696 100644
|
||||
--- a/Lib/distutils/sysconfig.py
|
||||
+++ b/Lib/distutils/sysconfig.py
|
||||
@@ -95,8 +95,6 @@ def get_python_inc(plat_specific=0, prefix=None):
|
||||
If 'prefix' is supplied, use it instead of sys.base_prefix or
|
||||
sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
|
||||
"""
|
||||
- if prefix is None:
|
||||
- prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
|
||||
if os.name == "posix":
|
||||
if python_build:
|
||||
# Assume the executable is in the build directory. The
|
||||
@@ -109,9 +107,17 @@ def get_python_inc(plat_specific=0, prefix=None):
|
||||
else:
|
||||
incdir = os.path.join(get_config_var('srcdir'), 'Include')
|
||||
return os.path.normpath(incdir)
|
||||
- python_dir = 'python' + get_python_version() + build_flags
|
||||
- return os.path.join(prefix, "include", python_dir)
|
||||
+ if prefix is None:
|
||||
+ if plat_specific:
|
||||
+ return get_config_var('CONFINCLUDEPY')
|
||||
+ else:
|
||||
+ return get_config_var('INCLUDEPY')
|
||||
+ else:
|
||||
+ python_dir = 'python' + get_python_version() + build_flags
|
||||
+ return os.path.join(prefix, "include", python_dir)
|
||||
elif os.name == "nt":
|
||||
+ if prefix is None:
|
||||
+ prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
|
||||
if python_build:
|
||||
# Include both the include and PC dir to ensure we can find
|
||||
# pyconfig.h
|
||||
--
|
||||
2.28.0
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
From a612c481f6116955d420db5ae1fe4c1eb93eb2f2 Mon Sep 17 00:00:00 2001
|
||||
From: Marcin Niemira <marcin.niemira@gmail.com>
|
||||
Date: Sun, 9 Jun 2019 07:05:06 +1000
|
||||
Subject: [PATCH] bpo-11122: fix hardcoded path checking for rpmbuild in
|
||||
bdist_rpm.py (GH-10594) (cherry picked from commit
|
||||
45a14942c969ed508b35abd5e116cb18f84ce5b4)
|
||||
|
||||
Co-authored-by: Marcin Niemira <marcin.niemira@gmail.com>
|
||||
---
|
||||
Lib/distutils/command/bdist_rpm.py | 5 +----
|
||||
.../next/Library/2018-11-12-19-08-50.bpo-11122.Gj7BQn.rst | 1 +
|
||||
2 files changed, 2 insertions(+), 4 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Library/2018-11-12-19-08-50.bpo-11122.Gj7BQn.rst
|
||||
|
||||
diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py
|
||||
index 20ca7ac6dcffa..74381cc69a6ce 100644
|
||||
--- a/Lib/distutils/command/bdist_rpm.py
|
||||
+++ b/Lib/distutils/command/bdist_rpm.py
|
||||
@@ -309,10 +309,7 @@ def run(self):
|
||||
|
||||
# build package
|
||||
log.info("building RPMs")
|
||||
- rpm_cmd = ['rpm']
|
||||
- if os.path.exists('/usr/bin/rpmbuild') or \
|
||||
- os.path.exists('/bin/rpmbuild'):
|
||||
- rpm_cmd = ['rpmbuild']
|
||||
+ rpm_cmd = ['rpmbuild']
|
||||
|
||||
if self.source_only: # what kind of RPMs?
|
||||
rpm_cmd.append('-bs')
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
From ba458f33f335b217d078fdce56e9c6f9f93adb49 Mon Sep 17 00:00:00 2001
|
||||
From: Frederik Rietdijk <fridh@fridh.nl>
|
||||
Date: Mon, 28 Aug 2017 09:24:06 +0200
|
||||
Subject: [PATCH] Don't use ldconfig
|
||||
|
||||
---
|
||||
Lib/ctypes/util.py | 78 ++--------------------------------------------
|
||||
1 file changed, 2 insertions(+), 76 deletions(-)
|
||||
|
||||
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
|
||||
index 0c2510e..79635a8 100644
|
||||
--- a/Lib/ctypes/util.py
|
||||
+++ b/Lib/ctypes/util.py
|
||||
@@ -100,54 +100,7 @@ elif os.name == "posix":
|
||||
return thefile.read(4) == elf_header
|
||||
|
||||
def _findLib_gcc(name):
|
||||
- # Run GCC's linker with the -t (aka --trace) option and examine the
|
||||
- # library name it prints out. The GCC command will fail because we
|
||||
- # haven't supplied a proper program with main(), but that does not
|
||||
- # matter.
|
||||
- expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name))
|
||||
-
|
||||
- c_compiler = shutil.which('gcc')
|
||||
- if not c_compiler:
|
||||
- c_compiler = shutil.which('cc')
|
||||
- if not c_compiler:
|
||||
- # No C compiler available, give up
|
||||
- return None
|
||||
-
|
||||
- temp = tempfile.NamedTemporaryFile()
|
||||
- try:
|
||||
- args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name]
|
||||
-
|
||||
- env = dict(os.environ)
|
||||
- env['LC_ALL'] = 'C'
|
||||
- env['LANG'] = 'C'
|
||||
- try:
|
||||
- proc = subprocess.Popen(args,
|
||||
- stdout=subprocess.PIPE,
|
||||
- stderr=subprocess.STDOUT,
|
||||
- env=env)
|
||||
- except OSError: # E.g. bad executable
|
||||
- return None
|
||||
- with proc:
|
||||
- trace = proc.stdout.read()
|
||||
- finally:
|
||||
- try:
|
||||
- temp.close()
|
||||
- except FileNotFoundError:
|
||||
- # Raised if the file was already removed, which is the normal
|
||||
- # behaviour of GCC if linking fails
|
||||
- pass
|
||||
- res = re.findall(expr, trace)
|
||||
- if not res:
|
||||
- return None
|
||||
-
|
||||
- for file in res:
|
||||
- # Check if the given file is an elf file: gcc can report
|
||||
- # some files that are linker scripts and not actual
|
||||
- # shared objects. See bpo-41976 for more details
|
||||
- if not _is_elf(file):
|
||||
- continue
|
||||
- return os.fsdecode(file)
|
||||
-
|
||||
+ return None
|
||||
|
||||
if sys.platform == "sunos5":
|
||||
# use /usr/ccs/bin/dump on solaris
|
||||
@@ -268,34 +221,7 @@ elif os.name == "posix":
|
||||
else:
|
||||
|
||||
def _findSoname_ldconfig(name):
|
||||
- import struct
|
||||
- if struct.calcsize('l') == 4:
|
||||
- machine = os.uname().machine + '-32'
|
||||
- else:
|
||||
- machine = os.uname().machine + '-64'
|
||||
- mach_map = {
|
||||
- 'x86_64-64': 'libc6,x86-64',
|
||||
- 'ppc64-64': 'libc6,64bit',
|
||||
- 'sparc64-64': 'libc6,64bit',
|
||||
- 's390x-64': 'libc6,64bit',
|
||||
- 'ia64-64': 'libc6,IA-64',
|
||||
- }
|
||||
- abi_type = mach_map.get(machine, 'libc6')
|
||||
-
|
||||
- # XXX assuming GLIBC's ldconfig (with option -p)
|
||||
- regex = r'\s+(lib%s\.[^\s]+)\s+\(%s'
|
||||
- regex = os.fsencode(regex % (re.escape(name), abi_type))
|
||||
- try:
|
||||
- with subprocess.Popen(['/sbin/ldconfig', '-p'],
|
||||
- stdin=subprocess.DEVNULL,
|
||||
- stderr=subprocess.DEVNULL,
|
||||
- stdout=subprocess.PIPE,
|
||||
- env={'LC_ALL': 'C', 'LANG': 'C'}) as p:
|
||||
- res = re.search(regex, p.stdout.read())
|
||||
- if res:
|
||||
- return os.fsdecode(res.group(1))
|
||||
- except OSError:
|
||||
- pass
|
||||
+ return None
|
||||
|
||||
def _findLib_ld(name):
|
||||
# See issue #9998 for why this is needed
|
||||
--
|
||||
2.30.0
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
From e6b247c8e524dbe5fc03b3492f628d0d5348bc49 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Stinner <vstinner@redhat.com>
|
||||
Date: Tue, 18 Dec 2018 14:47:21 +0100
|
||||
Subject: [PATCH] bpo-35523: Remove ctypes callback workaround (GH-11211)
|
||||
|
||||
Remove ctypes callback workaround: no longer create a callback at startup.
|
||||
Avoid SELinux alert on "import ctypes" and "import uuid".
|
||||
---
|
||||
Lib/ctypes/__init__.py | 5 -----
|
||||
.../next/Library/2018-12-18-13-52-13.bpo-35523.SkoMno.rst | 2 ++
|
||||
2 files changed, 2 insertions(+), 5 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Library/2018-12-18-13-52-13.bpo-35523.SkoMno.rst
|
||||
|
||||
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
|
||||
index 6146773988648..5f78beda5866e 100644
|
||||
--- a/Lib/ctypes/__init__.py
|
||||
+++ b/Lib/ctypes/__init__.py
|
||||
@@ -266,11 +266,6 @@ def _reset_cache():
|
||||
# _SimpleCData.c_char_p_from_param
|
||||
POINTER(c_char).from_param = c_char_p.from_param
|
||||
_pointer_type_cache[None] = c_void_p
|
||||
- # XXX for whatever reasons, creating the first instance of a callback
|
||||
- # function is needed for the unittests on Win64 to succeed. This MAY
|
||||
- # be a compiler bug, since the problem occurs only when _ctypes is
|
||||
- # compiled with the MS SDK compiler. Or an uninitialized variable?
|
||||
- CFUNCTYPE(c_int)(lambda: None)
|
||||
|
||||
def create_unicode_buffer(init, size=None):
|
||||
"""create_unicode_buffer(aString) -> character array
|
||||
diff --git a/Misc/NEWS.d/next/Library/2018-12-18-13-52-13.bpo-35523.SkoMno.rst b/Misc/NEWS.d/next/Library/2018-12-18-13-52-13.bpo-35523.SkoMno.rst
|
||||
new file mode 100644
|
||||
index 0000000000000..94a9fd257383e
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Library/2018-12-18-13-52-13.bpo-35523.SkoMno.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Remove :mod:`ctypes` callback workaround: no longer create a callback at
|
||||
+startup. Avoid SELinux alert on ``import ctypes`` and ``import uuid``.
|
||||
|
|
@ -0,0 +1,248 @@
|
|||
--- a/Lib/_osx_support.py
|
||||
+++ b/Lib/_osx_support.py
|
||||
@@ -14,13 +14,13 @@ __all__ = [
|
||||
# configuration variables that may contain universal build flags,
|
||||
# like "-arch" or "-isdkroot", that may need customization for
|
||||
# the user environment
|
||||
-_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS',
|
||||
- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX',
|
||||
- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
|
||||
- 'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS')
|
||||
+_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS',
|
||||
+ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED',
|
||||
+ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS',
|
||||
+ 'PY_CPPFLAGS', 'PY_CORE_LDFLAGS', 'PY_CORE_CFLAGS')
|
||||
|
||||
# configuration variables that may contain compiler calls
|
||||
-_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX')
|
||||
+_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX')
|
||||
|
||||
# prefix added to original configuration variable names
|
||||
_INITPRE = '_OSX_SUPPORT_INITIAL_'
|
||||
--- a/Lib/distutils/cygwinccompiler.py
|
||||
+++ b/Lib/distutils/cygwinccompiler.py
|
||||
@@ -125,8 +125,10 @@ class CygwinCCompiler(UnixCCompiler):
|
||||
# dllwrap 2.10.90 is buggy
|
||||
if self.ld_version >= "2.10.90":
|
||||
self.linker_dll = "gcc"
|
||||
+ self.linker_dll_cxx = "g++"
|
||||
else:
|
||||
self.linker_dll = "dllwrap"
|
||||
+ self.linker_dll_cxx = "dllwrap"
|
||||
|
||||
# ld_version >= "2.13" support -shared so use it instead of
|
||||
# -mdll -static
|
||||
@@ -140,9 +142,13 @@ class CygwinCCompiler(UnixCCompiler):
|
||||
self.set_executables(compiler='gcc -mcygwin -O -Wall',
|
||||
compiler_so='gcc -mcygwin -mdll -O -Wall',
|
||||
compiler_cxx='g++ -mcygwin -O -Wall',
|
||||
+ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall',
|
||||
linker_exe='gcc -mcygwin',
|
||||
linker_so=('%s -mcygwin %s' %
|
||||
- (self.linker_dll, shared_option)))
|
||||
+ (self.linker_dll, shared_option)),
|
||||
+ linker_exe_cxx='g++ -mcygwin',
|
||||
+ linker_so_cxx=('%s -mcygwin %s' %
|
||||
+ (self.linker_dll_cxx, shared_option)))
|
||||
|
||||
# cygwin and mingw32 need different sets of libraries
|
||||
if self.gcc_version == "2.91.57":
|
||||
@@ -166,8 +172,12 @@ class CygwinCCompiler(UnixCCompiler):
|
||||
raise CompileError(msg)
|
||||
else: # for other files use the C-compiler
|
||||
try:
|
||||
- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||
- extra_postargs)
|
||||
+ if self.detect_language(src) == 'c++':
|
||||
+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
+ else:
|
||||
+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
except DistutilsExecError as msg:
|
||||
raise CompileError(msg)
|
||||
|
||||
@@ -302,9 +312,14 @@ class Mingw32CCompiler(CygwinCCompiler):
|
||||
self.set_executables(compiler='gcc -O -Wall',
|
||||
compiler_so='gcc -mdll -O -Wall',
|
||||
compiler_cxx='g++ -O -Wall',
|
||||
+ compiler_so_cxx='g++ -mdll -O -Wall',
|
||||
linker_exe='gcc',
|
||||
linker_so='%s %s %s'
|
||||
% (self.linker_dll, shared_option,
|
||||
+ entry_point),
|
||||
+ linker_exe_cxx='g++',
|
||||
+ linker_so_cxx='%s %s %s'
|
||||
+ % (self.linker_dll_cxx, shared_option,
|
||||
entry_point))
|
||||
# Maybe we should also append -mthreads, but then the finished
|
||||
# dlls need another dll (mingwm10.dll see Mingw32 docs)
|
||||
--- a/Lib/distutils/sysconfig.py
|
||||
+++ b/Lib/distutils/sysconfig.py
|
||||
@@ -170,9 +170,11 @@ def customize_compiler(compiler):
|
||||
_osx_support.customize_compiler(_config_vars)
|
||||
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
|
||||
|
||||
- (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
|
||||
- get_config_vars('CC', 'CXX', 'CFLAGS',
|
||||
- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
|
||||
+ (cc, cxx, cflags, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \
|
||||
+ get_config_vars('CC', 'CXX', 'CFLAGS', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED',
|
||||
+ 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
|
||||
+
|
||||
+ cxxflags = cflags
|
||||
|
||||
if 'CC' in os.environ:
|
||||
newcc = os.environ['CC']
|
||||
@@ -187,19 +189,27 @@ def customize_compiler(compiler):
|
||||
cxx = os.environ['CXX']
|
||||
if 'LDSHARED' in os.environ:
|
||||
ldshared = os.environ['LDSHARED']
|
||||
+ if 'LDCXXSHARED' in os.environ:
|
||||
+ ldcxxshared = os.environ['LDCXXSHARED']
|
||||
if 'CPP' in os.environ:
|
||||
cpp = os.environ['CPP']
|
||||
else:
|
||||
cpp = cc + " -E" # not always
|
||||
if 'LDFLAGS' in os.environ:
|
||||
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
|
||||
if 'CFLAGS' in os.environ:
|
||||
- cflags = cflags + ' ' + os.environ['CFLAGS']
|
||||
+ cflags = os.environ['CFLAGS']
|
||||
ldshared = ldshared + ' ' + os.environ['CFLAGS']
|
||||
+ if 'CXXFLAGS' in os.environ:
|
||||
+ cxxflags = os.environ['CXXFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
|
||||
if 'CPPFLAGS' in os.environ:
|
||||
cpp = cpp + ' ' + os.environ['CPPFLAGS']
|
||||
cflags = cflags + ' ' + os.environ['CPPFLAGS']
|
||||
+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
|
||||
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
|
||||
if 'AR' in os.environ:
|
||||
ar = os.environ['AR']
|
||||
if 'ARFLAGS' in os.environ:
|
||||
@@ -208,13 +218,17 @@ def customize_compiler(compiler):
|
||||
archiver = ar + ' ' + ar_flags
|
||||
|
||||
cc_cmd = cc + ' ' + cflags
|
||||
+ cxx_cmd = cxx + ' ' + cxxflags
|
||||
compiler.set_executables(
|
||||
preprocessor=cpp,
|
||||
compiler=cc_cmd,
|
||||
compiler_so=cc_cmd + ' ' + ccshared,
|
||||
- compiler_cxx=cxx,
|
||||
+ compiler_cxx=cxx_cmd,
|
||||
+ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
|
||||
linker_so=ldshared,
|
||||
linker_exe=cc,
|
||||
+ linker_so_cxx=ldcxxshared,
|
||||
+ linker_exe_cxx=cxx,
|
||||
archiver=archiver)
|
||||
|
||||
compiler.shared_lib_extension = shlib_suffix
|
||||
--- a/Lib/distutils/unixccompiler.py
|
||||
+++ b/Lib/distutils/unixccompiler.py
|
||||
@@ -52,14 +52,17 @@ class UnixCCompiler(CCompiler):
|
||||
# are pretty generic; they will probably have to be set by an outsider
|
||||
# (eg. using information discovered by the sysconfig about building
|
||||
# Python extensions).
|
||||
- executables = {'preprocessor' : None,
|
||||
- 'compiler' : ["cc"],
|
||||
- 'compiler_so' : ["cc"],
|
||||
- 'compiler_cxx' : ["cc"],
|
||||
- 'linker_so' : ["cc", "-shared"],
|
||||
- 'linker_exe' : ["cc"],
|
||||
- 'archiver' : ["ar", "-cr"],
|
||||
- 'ranlib' : None,
|
||||
+ executables = {'preprocessor' : None,
|
||||
+ 'compiler' : ["cc"],
|
||||
+ 'compiler_so' : ["cc"],
|
||||
+ 'compiler_cxx' : ["c++"],
|
||||
+ 'compiler_so_cxx' : ["c++"],
|
||||
+ 'linker_so' : ["cc", "-shared"],
|
||||
+ 'linker_exe' : ["cc"],
|
||||
+ 'linker_so_cxx' : ["c++", "-shared"],
|
||||
+ 'linker_exe_cxx' : ["c++"],
|
||||
+ 'archiver' : ["ar", "-cr"],
|
||||
+ 'ranlib' : None,
|
||||
}
|
||||
|
||||
if sys.platform[:6] == "darwin":
|
||||
@@ -110,12 +113,19 @@ class UnixCCompiler(CCompiler):
|
||||
|
||||
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
|
||||
compiler_so = self.compiler_so
|
||||
+ compiler_so_cxx = self.compiler_so_cxx
|
||||
if sys.platform == 'darwin':
|
||||
compiler_so = _osx_support.compiler_fixup(compiler_so,
|
||||
cc_args + extra_postargs)
|
||||
+ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx,
|
||||
+ cc_args + extra_postargs)
|
||||
try:
|
||||
- self.spawn(compiler_so + cc_args + [src, '-o', obj] +
|
||||
- extra_postargs)
|
||||
+ if self.detect_language(src) == 'c++':
|
||||
+ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
+ else:
|
||||
+ self.spawn(compiler_so + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
except DistutilsExecError as msg:
|
||||
raise CompileError(msg)
|
||||
|
||||
@@ -173,30 +183,16 @@ class UnixCCompiler(CCompiler):
|
||||
ld_args.extend(extra_postargs)
|
||||
self.mkpath(os.path.dirname(output_filename))
|
||||
try:
|
||||
- if target_desc == CCompiler.EXECUTABLE:
|
||||
- linker = self.linker_exe[:]
|
||||
+ if target_lang == "c++":
|
||||
+ if target_desc == CCompiler.EXECUTABLE:
|
||||
+ linker = self.linker_exe_cxx[:]
|
||||
+ else:
|
||||
+ linker = self.linker_so_cxx[:]
|
||||
else:
|
||||
- linker = self.linker_so[:]
|
||||
- if target_lang == "c++" and self.compiler_cxx:
|
||||
- # skip over environment variable settings if /usr/bin/env
|
||||
- # is used to set up the linker's environment.
|
||||
- # This is needed on OSX. Note: this assumes that the
|
||||
- # normal and C++ compiler have the same environment
|
||||
- # settings.
|
||||
- i = 0
|
||||
- if os.path.basename(linker[0]) == "env":
|
||||
- i = 1
|
||||
- while '=' in linker[i]:
|
||||
- i += 1
|
||||
-
|
||||
- if os.path.basename(linker[i]) == 'ld_so_aix':
|
||||
- # AIX platforms prefix the compiler with the ld_so_aix
|
||||
- # script, so we need to adjust our linker index
|
||||
- offset = 1
|
||||
+ if target_desc == CCompiler.EXECUTABLE:
|
||||
+ linker = self.linker_exe[:]
|
||||
else:
|
||||
- offset = 0
|
||||
-
|
||||
- linker[i+offset] = self.compiler_cxx[i]
|
||||
+ linker = self.linker_so[:]
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
linker = _osx_support.compiler_fixup(linker, ld_args)
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -584,10 +584,10 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
|
||||
*\ -s*|s*) quiet="-q";; \
|
||||
*) quiet="";; \
|
||||
esac; \
|
||||
- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
|
||||
+ echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' CFLAGS='$(PY_CFLAGS)' \
|
||||
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
|
||||
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
|
||||
- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
|
||||
+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' CFLAGS='$(PY_CFLAGS)' \
|
||||
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
|
||||
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue