You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Bill Janssen <ja...@parc.com> on 2010/10/07 18:41:07 UTC

packaging PyLucene with MinGW on Windows?

I've got 3.0.2 compiling OK --shared with the latest MinGW gcc (4.5.0).
However, when I bundle up the egg and transfer it to another Windows
machine and look at it with depends.exe, I see that the DLLs and .pyd
files produced aren't standalone -- there are dangling references to
various GCC libraries and to MSVCR90.DLL that depends.exe can't resolve:

LIBGCC_S_DW2-1.DLL
LIBSTDC++-6.DLL
MSVCR90.DLL

This seems a bit odd to me; I wonder if we have the right compile
switches for the MinGW case.  Presumably removing "--shared" would fix
this.  I'm going to pursue it further on the MinGW list, but I thought
I'd raise it here in case anyone on this list had some ideas.

Here's what the GCC 4.4 release notes have:

  - Dynamic linking with libgcc_s_dw2-1.dll

  Dynamic linking with libgcc_s_dw2-1.dll is necessary to throw
  exceptions between different modules, such as between two DLLs or a
  DLL and an EXE.  Consequently, it is the default for all languages
  other than C.  To disable this dynamic linking, use -static-libgcc.
  To enable this dynamic linking in C, use -shared-libgcc.

Bill

Re: unfinished work on implib in jcc/setup.py

Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:

> I integrated your change as suggested, but after fixing the bug with
> applying % to a list.

Ah, good catch.

> It'd be nice if you submitted functioning patches, especially for
> platforms I can't/won't test on. Checked into rev 1005687.

Yes, I agree.  And those should come through the issue tracker.  But
here I was thinking more of just finding out what was going on there --
it looked like you were in the middle of something and had stopped.

Bill

Re: unfinished work on implib in jcc/setup.py

Posted by Andi Vajda <va...@apache.org>.
On Thu, 7 Oct 2010, Bill Janssen wrote:

> I'm looking at the setup.py for jcc, and it seems that there is some
> unfinished work lurking in there:
>
> IMPLIB_LFLAGS = {
>    'win32': ["/IMPLIB:%s"],
>    'mingw32': ["-Wl,--out-implib,%s"]
> }

It's correct in python.py but something similar could also be done as you 
suggest in setup.py. Since I don't have a mingw setup, I can't test it.

> But later on we find code like this:
>
>        elif platform == 'win32':
>            jcclib = 'jcc%s.lib' %(debug and '_d' or '')
>            kwds["extra_link_args"] = \
>                lflags + ["/IMPLIB:%s" %(os.path.join('jcc', jcclib))]
>            package_data.append(jcclib)
>
> Looks like some work on casing this for mingw was started, but never
> finished.  Should this read:
>
>        elif platform in IMPLIB_LFLAGS:
>            jcclib = 'jcc%s.lib' %(debug and '_d' or '')
>            kwds["extra_link_args"] =
>                lflags + IMPLIB_LFLAGS[platform] %(os.path.join('jcc', jcclib))
>            package_data.append(jcclib)

I integrated your change as suggested, but after fixing the bug with 
applying % to a list.

It'd be nice if you submitted functioning patches, especially for platforms 
I can't/won't test on. Checked into rev 1005687.

Andi..

unfinished work on implib in jcc/setup.py

Posted by Bill Janssen <ja...@parc.com>.
I'm looking at the setup.py for jcc, and it seems that there is some
unfinished work lurking in there:

IMPLIB_LFLAGS = {
    'win32': ["/IMPLIB:%s"],
    'mingw32': ["-Wl,--out-implib,%s"]
}

But later on we find code like this:

        elif platform == 'win32':
            jcclib = 'jcc%s.lib' %(debug and '_d' or '')
            kwds["extra_link_args"] = \
                lflags + ["/IMPLIB:%s" %(os.path.join('jcc', jcclib))]
            package_data.append(jcclib)

Looks like some work on casing this for mingw was started, but never
finished.  Should this read:

        elif platform in IMPLIB_LFLAGS:
            jcclib = 'jcc%s.lib' %(debug and '_d' or '')
            kwds["extra_link_args"] = 
                lflags + IMPLIB_LFLAGS[platform] %(os.path.join('jcc', jcclib))
            package_data.append(jcclib)

Bill