public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Problem with Python programs with binary components, who to blame?
@ 2016-09-04 14:34 Patrick Pief
  2016-09-04 14:43 ` Marco Atzeri
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Patrick Pief @ 2016-09-04 14:34 UTC (permalink / raw)
  To: cygwin

Hi, 

Before writing any formal bug report I thought I might ask first whether the 
problem I am seeing is something that can be even fixed from Cygwin's side. 

The issue has to do with the compilation of Python binary packages for Python 
inside Cygwin (Python installed as a Cygwin package as opposed to Python for 
Windows).  
The problem starts to show as gcc warnings: "[…] redeclared without dllimport 
attribute: previous dllimport ignored", and ends with linkers errors such as: 
"relocation truncated to fit [...] against undefined symbol".

I am guessing the problem might actually lie within the Python sources itself 
but I am not entirely sure.

So is this some issue that is even worth further research and filing a bug 
report here?



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem with Python programs with binary components, who to blame?
  2016-09-04 14:34 Problem with Python programs with binary components, who to blame? Patrick Pief
@ 2016-09-04 14:43 ` Marco Atzeri
  2016-09-04 19:43   ` Eliot Moss
  2016-09-04 20:34 ` Brian Inglis
  2016-09-05  4:50 ` Doug Henderson
  2 siblings, 1 reply; 5+ messages in thread
From: Marco Atzeri @ 2016-09-04 14:43 UTC (permalink / raw)
  To: cygwin

On 04/09/2016 16:34, Patrick Pief wrote:
> Hi,
>
> Before writing any formal bug report I thought I might ask first whether the
> problem I am seeing is something that can be even fixed from Cygwin's side.
>
> The issue has to do with the compilation of Python binary packages for Python
> inside Cygwin (Python installed as a Cygwin package as opposed to Python for
> Windows).
> The problem starts to show as gcc warnings: "[…] redeclared without dllimport
> attribute: previous dllimport ignored", and ends with linkers errors such as:
> "relocation truncated to fit [...] against undefined symbol".
>
> I am guessing the problem might actually lie within the Python sources itself
> but I am not entirely sure.
>
> So is this some issue that is even worth further research and filing a bug
> report here?


On windows all symbols must be available at linking time.
Cygwin programs/libraries have the same constrain.

Can you report the full command that produce :
""relocation truncated to fit [...] against undefined symbol"." ?

Are you building a specific program or it is your own development ?

Regards
Marco





--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem with Python programs with binary components, who to blame?
  2016-09-04 14:43 ` Marco Atzeri
@ 2016-09-04 19:43   ` Eliot Moss
  0 siblings, 0 replies; 5+ messages in thread
From: Eliot Moss @ 2016-09-04 19:43 UTC (permalink / raw)
  To: cygwin

On 9/4/2016 10:43 AM, Marco Atzeri wrote:
> On 04/09/2016 16:34, Patrick Pief wrote:
>> Hi,
>>
>> Before writing any formal bug report I thought I might ask first whether the
>> problem I am seeing is something that can be even fixed from Cygwin's side.
>>
>> The issue has to do with the compilation of Python binary packages for Python
>> inside Cygwin (Python installed as a Cygwin package as opposed to Python for
>> Windows).
>> The problem starts to show as gcc warnings: "[…] redeclared without dllimport
>> attribute: previous dllimport ignored", and ends with linkers errors such as:
>> "relocation truncated to fit [...] against undefined symbol".
>>
>> I am guessing the problem might actually lie within the Python sources itself
>> but I am not entirely sure.
>>
>> So is this some issue that is even worth further research and filing a bug
>> report here?
>
>
> On windows all symbols must be available at linking time.
> Cygwin programs/libraries have the same constrain.
>
> Can you report the full command that produce :
> ""relocation truncated to fit [...] against undefined symbol"." ?
>
> Are you building a specific program or it is your own development ?

I also wonder about:

- 32-bit versus 64-bit Cygwin, whether it may be an issue
- Such a build would need to be treated as a Posix build,
   not a Windows build, and probably should not be trying to
   access Windows libraries (as opposed to Cygwin libraries)

dllimport is meaningful for Windows, not for Posix, I believe.
So I wonder if you're actually running Cygwin's gcc ...

Anyway, some things to check into ...

Eliot Moss

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem with Python programs with binary components, who to blame?
  2016-09-04 14:34 Problem with Python programs with binary components, who to blame? Patrick Pief
  2016-09-04 14:43 ` Marco Atzeri
@ 2016-09-04 20:34 ` Brian Inglis
  2016-09-05  4:50 ` Doug Henderson
  2 siblings, 0 replies; 5+ messages in thread
From: Brian Inglis @ 2016-09-04 20:34 UTC (permalink / raw)
  To: cygwin

On 2016-09-04 08:34, Patrick Pief wrote:
> Before writing any formal bug report I thought I might ask first whether the
> problem I am seeing is something that can be even fixed from Cygwin's side.
> The issue has to do with the compilation of Python binary packages for Python
> inside Cygwin (Python installed as a Cygwin package as opposed to Python for
> Windows).
> The problem starts to show as gcc warnings: "[…] redeclared without dllimport
> attribute: previous dllimport ignored", and ends with linkers errors such as:
> "relocation truncated to fit [...] against undefined symbol".
> I am guessing the problem might actually lie within the Python sources itself
> but I am not entirely sure.
> So is this some issue that is even worth further research and filing a bug
> report here?

Hi Patrick,
Read about cygwin dll exports and imports at

https://cygwin.com/cygwin-ug-net/dll.html

You may want to find a similar Cygwin Python module and look at the source
package (something called python-...-v.n-p-src) to see how it is built using
cygport, which takes care of some Cygwin specific differences in builds.

If you still have issues, please provide all the information requested by:

https://cygwin.com/problems.html

which includes attaching cygcheck and build output logs.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem with Python programs with binary components, who to blame?
  2016-09-04 14:34 Problem with Python programs with binary components, who to blame? Patrick Pief
  2016-09-04 14:43 ` Marco Atzeri
  2016-09-04 20:34 ` Brian Inglis
@ 2016-09-05  4:50 ` Doug Henderson
  2 siblings, 0 replies; 5+ messages in thread
From: Doug Henderson @ 2016-09-05  4:50 UTC (permalink / raw)
  To: cygwin

On 4 September 2016 at 08:34, Patrick Pief  wrote:
> Hi,
>
> Before writing any formal bug report I thought I might ask first whether the
> problem I am seeing is something that can be even fixed from Cygwin's side.
>
> The issue has to do with the compilation of Python binary packages for Python
> inside Cygwin (Python installed as a Cygwin package as opposed to Python for
> Windows).
> The problem starts to show as gcc warnings: "[…] redeclared without dllimport
> attribute: previous dllimport ignored", and ends with linkers errors such as:
> "relocation truncated to fit [...] against undefined symbol".
>
> I am guessing the problem might actually lie within the Python sources itself
> but I am not entirely sure.
>
> So is this some issue that is even worth further research and filing a bug
> report here?

Often the setup.py for the package will use windows build commands
when trying to build an extension for a python that runs under cygwin.
The setup.py needs to be changed so it uses the build instructions for
a *nix or Posix system to build the extension under cygwin. Typically
these kind of extensions may need to import cygwin DLLs that are
installed by another package. The change may be as simple as adding a
relation to an existing if statement to recognize cygwin as distinct
from windows.

If you have an extension that also needs to load windows DLL files,
you may need to add a section to the setup.py to support that kind of
hybrid situation. An example of this is cx_Oracle, which must use
windows DLL(s) supplied by Oracle. This is often easier t do with the
cooperation of the extension developer.

HTH
Doug

-- 
Doug Henderson, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-05  4:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-04 14:34 Problem with Python programs with binary components, who to blame? Patrick Pief
2016-09-04 14:43 ` Marco Atzeri
2016-09-04 19:43   ` Eliot Moss
2016-09-04 20:34 ` Brian Inglis
2016-09-05  4:50 ` Doug Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).