]> granicus.if.org Git - python/commitdiff
Issue #12641: Avoid passing "-mno-cygwin" to the mingw32 compiler, except when necessary.
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 30 Sep 2013 20:29:48 +0000 (22:29 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 30 Sep 2013 20:29:48 +0000 (22:29 +0200)
Patch by Oscar Benjamin.

1  2 
Lib/distutils/cygwinccompiler.py
Misc/ACKS
Misc/NEWS

index 0c23ab1b7feb1f56f7929851de94e6888bfe98c9,e0074a18f300231bacbe9ac0019d5b3443858aa0..d28b1b368adc2dde459c1334f540e51ff73f61de
@@@ -54,7 -54,7 +54,8 @@@ import r
  from distutils.ccompiler import gen_preprocess_options, gen_lib_options
  from distutils.unixccompiler import UnixCCompiler
  from distutils.file_util import write_file
--from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
++from distutils.errors import (DistutilsExecError, CCompilerError,
++        CompileError, UnknownFileError)
  from distutils import log
  from distutils.version import LooseVersion
  from distutils.spawn import find_executable
@@@ -294,13 -294,18 +295,17 @@@ class Mingw32CCompiler(CygwinCCompiler)
          else:
              entry_point = ''
  
-         self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
-                              compiler_so='gcc -mno-cygwin -mdll -O -Wall',
-                              compiler_cxx='g++ -mno-cygwin -O -Wall',
-                              linker_exe='gcc -mno-cygwin',
-                              linker_so='%s -mno-cygwin %s %s'
 -        if self.gcc_version < '4' or is_cygwingcc():
 -            no_cygwin = ' -mno-cygwin'
 -        else:
 -            no_cygwin = ''
 -
 -        self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
 -                             compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
 -                             compiler_cxx='g++%s -O -Wall' % no_cygwin,
 -                             linker_exe='gcc%s' % no_cygwin,
 -                             linker_so='%s%s %s %s'
 -                                    % (self.linker_dll, no_cygwin,
 -                                       shared_option, entry_point))
++        if is_cygwingcc():
++            raise CCompilerError(
++                'Cygwin gcc cannot be used with --compiler=mingw32')
++
++        self.set_executables(compiler='gcc -O -Wall',
++                             compiler_so='gcc -mdll -O -Wall',
++                             compiler_cxx='g++ -O -Wall',
++                             linker_exe='gcc',
++                             linker_so='%s %s %s'
 +                                        % (self.linker_dll, shared_option,
 +                                           entry_point))
          # Maybe we should also append -mthreads, but then the finished
          # dlls need another dll (mingwm10.dll see Mingw32 docs)
          # (-mthreads: Support thread-safe exception handling on `Mingw32')
diff --cc Misc/ACKS
Simple merge
diff --cc Misc/NEWS
index a5548377baa649f180cb419b84b1e4e438099959,c787537857ada29baf04c0fb02eea24af77406d9..fa5d85a408e40f63bcc43217fa6b9c48b7df06e8
+++ b/Misc/NEWS
@@@ -10,40 -12,61 +10,43 @@@ Projected release date: 2013-10-2
  Core and Builtins
  -----------------
  
 -- Issue #19098: Prevent overflow in the compiler when the recursion limit is set
 -  absurdly high.
 -
 -- Issue #18942: sys._debugmallocstats() output was damaged on Windows.
 -
 -- Issue #18667: Add missing "HAVE_FCHOWNAT" symbol to posix._have_functions.
 -
 -- Issue #18368: PyOS_StdioReadline() no longer leaks memory when realloc()
 -  fails.
 -
 -- Issue #16741: Fix an error reporting in int().
 -
 -- Issue #17899: Fix rare file descriptor leak in os.listdir().
 -
 -- Issue #18552: Check return value of PyArena_AddPyObject() in
 -  obj2ast_object().
 +Library
 +-------
  
 -- Issue #18560: Fix potential NULL pointer dereference in sum().
++- Issue #12641: Avoid passing "-mno-cygwin" to the mingw32 compiler, except
++  when necessary.  Patch by Oscar Benjamin.
 -- Issue #15905: Fix theoretical buffer overflow in handling of sys.argv[0],
 -  prefix and exec_prefix if the operation system does not obey MAXPATHLEN.
 +- Issue #5845: In site.py, only load readline history from ~/.python_history
 +  if no history has been read already.  This avoids double writes to the
 +  history file at shutdown.
  
 -- Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all().
 +- Properly initialize all fields of a SSL object after allocation.
  
 -- Issue #17872: Fix a segfault in marshal.load() when input stream returns
 -  more bytes than requested.
 +- Issue #19095: SSLSocket.getpeercert() now raises ValueError when the
 +  SSL handshake hasn't been done.
  
 -- Issue #18426: Fix NULL pointer dereference in C extension import when
 -  PyModule_GetDef() returns an error.
 +- Issue #4366: Fix building extensions on all platforms when --enable-shared
 +  is used.
  
 -- Issue #18328: Reorder ops in PyThreadState_Delete*() functions. Now the
 -  tstate is first removed from TLS and then deallocated.
 +Build
 +-----
  
 -- Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
 -  OverflowError when an argument of %c format is out of range.
 +- Issue #19130: Correct PCbuild/readme.txt, Python 3.3 and 3.4 require VS 2010.
  
 -- Issue #18137: Detect integer overflow on precision in float.__format__()
 -  and complex.__format__().
  
 -- Issue #18183: Fix various unicode operations on strings with large unicode
 -  codepoints.
 +What's New in Python 3.4.0 Alpha 3?
 +===================================
  
 -- Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
 +Release date: 2013-09-29
  
 -- Issue #18038: SyntaxError raised during compilation sources with illegal
 -  encoding now always contains an encoding name.
  
 -- Issue #17644: Fix a crash in str.format when curly braces are used in square
 -  brackets.
 +Core and Builtins
 +-----------------
  
 -- Issue #17983: Raise a SyntaxError for a ``global __class__`` statement in a
 -  class body.
 +- Issue #18818: The "encodingname" part of PYTHONIOENCODING is now optional.
  
 -- Issue #17927: Frame objects kept arguments alive if they had been copied into
 -  a cell, even if the cell was cleared.
 +- Issue #19098: Prevent overflow in the compiler when the recursion limit is set
 +  absurdly high.
  
  Library
  -------