Re: --out-implib when linking shared libraries

2009-05-16 Thread Neil Mitchell
 I've just built a Haskell dll on Windows. As part of the process it
 generated an 14Mb foo.dll, and a 40Mb foo.dll.a. Looking at the flags
 passed to ld I see --out-implib=foo.dll.a. What is the purpose of the
 .a file? What might it be needed for? Is it possible to suppress it?

 It looks like what you're getting is an import lib that also contains a
 full copy of all the code.

Yes, that seems likely. My guess is it's just a cat of the .o's, with
header tables etc.

 I think it's possible to have minimal .lib files that do not contain any
 code and only refer to the corresponding dll. Further, I think recent
 gnu ld versions can link directly against dlls without using an import
 lib (though you may still need the import lib if you want to use MSVC to
 link to your dll).

I don't, although having that option wouldn't be a bad thing - having
a minimal .lib is perfectly reasonable as a default. Having a massive
.lib seems crazy. (The fact that .lib is named .dll.a isn't too much
of an issue)

 So my suggestion is remove it, if you're linking using gcc it should
 work.

I'm not linking the .dll at all, only using dynamic linking, which
works without the .lib. But I don't really want to start removing
files - doing that in a build system seems like a bad idea.

Thanks

Neil
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: --out-implib when linking shared libraries

2009-05-16 Thread Duncan Coutts
On Sat, 2009-05-16 at 11:07 +0100, Neil Mitchell wrote:

 I don't, although having that option wouldn't be a bad thing - having
 a minimal .lib is perfectly reasonable as a default. Having a massive
 .lib seems crazy. (The fact that .lib is named .dll.a isn't too much
 of an issue)

It's possible to create a minimal import lib via a .def file (which
lists the exports). I think the dlltool helps with that.

  So my suggestion is remove it, if you're linking using gcc it should
  work.
 
 I'm not linking the .dll at all, only using dynamic linking, which
 works without the .lib. But I don't really want to start removing
 files - doing that in a build system seems like a bad idea.

Sure, so at least you don't have to install them.

Duncan

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: --out-implib when linking shared libraries

2009-05-16 Thread Krasimir Angelov
I remember that the .dll.a libraries that GCC produces are not always
compatible with MSVC. Sometimes it works if you rename them to .lib
but sometimes it doesn't. It is much more realiable to create .lib
from .def file via some of the MS tools. If GCC can link dynamic
libraries without using the static library then it might be good idea
not to build the import libraries at all.

Regards,
  Krasimir


On Sat, May 16, 2009 at 1:26 PM, Duncan Coutts
duncan.cou...@worc.ox.ac.uk wrote:
 On Sat, 2009-05-16 at 11:07 +0100, Neil Mitchell wrote:

 I don't, although having that option wouldn't be a bad thing - having
 a minimal .lib is perfectly reasonable as a default. Having a massive
 .lib seems crazy. (The fact that .lib is named .dll.a isn't too much
 of an issue)

 It's possible to create a minimal import lib via a .def file (which
 lists the exports). I think the dlltool helps with that.

  So my suggestion is remove it, if you're linking using gcc it should
  work.

 I'm not linking the .dll at all, only using dynamic linking, which
 works without the .lib. But I don't really want to start removing
 files - doing that in a build system seems like a bad idea.

 Sure, so at least you don't have to install them.

 Duncan

 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


possible alternative to libFFI

2009-05-16 Thread Bulat Ziganshin
Hello glasgow-haskell-users,

http://www.nongnu.org/cinvoke/faq.html

-- 
Best regards,
 Bulat  mailto:bulat.zigans...@gmail.com

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: possible alternative to libFFI

2009-05-16 Thread Duncan Coutts
On Sat, 2009-05-16 at 22:31 +0400, Bulat Ziganshin wrote:
 Hello glasgow-haskell-users,
 
 http://www.nongnu.org/cinvoke/faq.html

From the page:

How does C/Invoke compare to libFFI?

At the C API level they're pretty similar, aside from some minor
quibbles. libFFI has been around longer and is much more
portable, but the last release was in 1998.

Note that there are separate libffi releases again:

http://sourceware.org/libffi/

libffi-3.0.8 was released on December 19, 2008. You can ftp it
from ftp://sourceware.org/pub/libffi/libffi-3.0.8.tar.gz


Duncan

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users