This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: llrint implementation in Cygwin
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Mon, 29 Oct 2007 05:27:38 -0700
- Subject: Re: llrint implementation in Cygwin
- References: <fd68u2$geo$1@sea.gmane.org> <46F6C151.3070301@computer.org> <loom.20071029T111515-144@post.gmane.org>
- Reply-to: cygwin at cygwin dot com
Victor Paesa wrote:
> I found another way: leverage the llrint() implementation in MinGW.
>
> a) We need first to download the mingw-runtime Cygwin package.
>
> b) Then we create a small library:
>
> ar x /usr/lib/mingw/libmingwex.a llrint.o
> ar cq /usr/local/lib/libllrint.a llrint.o
>
> c) And finally, we use that library in FFmpeg configure line:
>
> --extra-ldflags='-L /usr/local/lib' --extra-libs='-l llrint'
>
> It might not be the most elegant solution, but it is strightforward, and
> it works.
This is a very, very bad idea. MinGW uses a completely different and
incompatible C runtime (MSVCRT) and so any MinGW object that calls into
the runtime (e.g. malloc(), open(), printf(), etc) will crash and burn
hard when linked to the Cygwin runtime. It is simple blind luck that
llrint() is apparently a self-contained function that has no calls to
any C runtime support functions, but this is not a practical technique
in general.
If you want to re-use the MinGW implementation, do it by compiling the
source with Cygwin's gcc, not by extracting an object from a library.
Brian
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/