[Patches] [ python-Patches-709178 ] remove -static option from cygwinccompiler

SourceForge.net noreply@sourceforge.net
Fri, 28 Mar 2003 15:31:11 -0800


Patches item #709178, was opened at 2003-03-24 21:55
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=709178&group_id=5470

Category: Distutils and setup.py
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: John Kabir Luebs (jkluebs)
Assigned to: Jason Tishler (jlt63)
Summary: remove -static option from cygwinccompiler

Initial Comment:
Currently, the cygwinccompiler.py compiler handling in
distutils is invoking the cygwin and mingw compilers
with the -static option. 

Logically, this means that the linker should choose to
link to static libraries instead of shared/dynamically
linked libraries.

Current win32 binutils expect import libraries to have
a .dll.a suffix and static libraries to have .a suffix.
If -static is passed, it will skip the .dll.a
libraries. This is pain if one has a tree with both
static and dynamic libraries using this naming
convention, and wish to use the dynamic libraries.

The -static option being passed in distutils is to get
around a bug in old versions of binutils where it would
get confused when it found the DLLs themselves.

The decision to use static or shared libraries is site
or package specific, and should be left to the setup
script or to command line options.

----------------------------------------------------------------------

>Comment By: John Kabir Luebs (jkluebs)
Date: 2003-03-28 18:31

Message:
Logged In: YES 
user_id=87160

I can help with testing. I have access to W2K and Win98
(ugh) boxen. I don't mind installing a few older toolchains
if you think that's necessary.

I think any C/C++ python extension using plain distutils (no
fancy hacks added on) and has one or more DLL dependencies
is a good test case.


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-03-28 17:15

Message:
Logged In: YES 
user_id=21627

I'm in favour of applying this patch, and also of patches
that mandate recent Cygwin releases; if such patches are
implemented, the minimum required Cygwin version should be
stated somewhere.

----------------------------------------------------------------------

Comment By: Jason Tishler (jlt63)
Date: 2003-03-28 16:16

Message:
Logged In: YES 
user_id=86216

John, would you be willing to help test or supply me with
test cases? I have built exactly one Win32 extension.

----------------------------------------------------------------------

Comment By: John Kabir Luebs (jkluebs)
Date: 2003-03-28 15:56

Message:
Logged In: YES 
user_id=87160

The -mdll --entry DllMain@12  option is guarded for an old
version of gcc that did not have the correct specs to accept
-shared.
I didn't touch it, even though it's crazy if anyone is using
such an old and buggy toolchain.

--shared and --dll are equivalent as far as ld is concerned. 

----------------------------------------------------------------------

Comment By: Jason Tishler (jlt63)
Date: 2003-03-28 13:41

Message:
Logged In: YES 
user_id=86216

Note that I only have minimal experience building
Win32 extensions modules...

This patch works "fine" with my *very* limited testing.
Specifically, I successfully rebuilt the Win32 readline
module with it applied.

BTW, this area of Distutils probably should be revisited
to bring it up to date. For example, the "-mdll --entry
_DllMain@12" options could be replaced by "-shared".

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-03-27 19:03

Message:
Logged In: YES 
user_id=21627

Jason, can you take a look? If not, please unassign it.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=709178&group_id=5470