llrint implementation in Cygwin

Brian Dessent brian@dessent.net
Mon Oct 29 12:27:00 GMT 2007


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/



More information about the Cygwin mailing list