delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/10/29/07:28:02

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <4725D1BA.C2D2ED8A@dessent.net>
Date: Mon, 29 Oct 2007 05:27:38 -0700
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: llrint implementation in Cygwin
References: <fd68u2$geo$1 AT sea DOT gmane DOT org> <46F6C151 DOT 3070301 AT computer DOT org> <loom DOT 20071029T111515-144 AT post DOT gmane DOT org>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019