delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/09/29/17:51:58

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <46FEC886.7020007@cwilson.fastmail.fm>
Date: Sat, 29 Sep 2007 17:49:58 -0400
From: Charles Wilson <cygwin AT cwilson DOT fastmail DOT fm>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
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> <fdif1q$efv$1 AT sea DOT gmane DOT org> <Pine DOT GSO DOT 4 DOT 63 DOT 0709280802020 DOT 16275 AT access1 DOT cims DOT nyu DOT edu> <fdm873$2oj$1 AT sea DOT gmane DOT org> <Pine DOT GSO DOT 4 DOT 63 DOT 0709291533000 DOT 27776 AT access1 DOT cims DOT nyu DOT edu> <fdmc2b$con$1 AT sea DOT gmane DOT org>
In-Reply-To: <fdmc2b$con$1@sea.gmane.org>
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

Diego Biurrun wrote:

> llrint is required, so I guess Cygwin compilation will indeed be broken 
> for a while.  We don't add OS-specific workarounds to FFmpeg.

I call shenanigans.  The libavcodec directory has entirely separate 
subdirs for different processors -- platform specificity is BUILT IN to 
the ffmpeg source tree.  Second, common.h contains compiler-specific 
workarounds:

#ifndef av_always_inline
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && 
__GNUC_MINOR__ > 0)
#    define av_always_inline __attribute__((always_inline)) inline
#else
#    define av_always_inline inline
#endif
#endif

to account for gcc-specific behavior. That file ALSO contains a 
half-dozen implementations of read_time depending on which 
microprocessor architecture is in use.

internal.h has this:

// Use rip-relative addressing if compiling PIC code on x86-64.
#if defined(__MINGW32__) || defined(__CYGWIN__) || \
     defined(__OS2__) || (defined (__OpenBSD__) && !defined(__ELF__))
#    if defined(ARCH_X86_64) && defined(PIC)
#        define MANGLE(a) "_" #a"(%%rip)"
#    else
#        define MANGLE(a) "_" #a
#    endif
#else
#    if defined(ARCH_X86_64) && defined(PIC)
#        define MANGLE(a) #a"(%%rip)"
#    elif defined(__APPLE__)
#        define MANGLE(a) "_" #a
#    else
#        define MANGLE(a) #a
#    endif
#endif

which looks pretty darn OS-specific to me.  (__CYGWIN__? __MINGW32__? 
__OS2__?)

Oh, and lookee here, in the same file:

#ifndef HAVE_LRINTF
/* XXX: add ISOC specific test to avoid specific BSD testing. */
/* better than nothing implementation. */
/* btw, rintf() is existing on fbsd too -- alex */
static av_always_inline long int lrintf(float x)
{
     return (int)(rint(x));
}
#endif /* HAVE_LRINTF */

a replacement function lrintf() that is activated only when a configure 
test determines that lrintf doesn't exist and therefore neglects to 
define HAVE_LRINTF....

So, we have:
   architecture-specific workarounds
   compiler-specific workarounds
   OS-specific workarounds
   AND capability-specific (!HAVE_FOO) workarounds

All god's chillins gots workaround code. "We don't add OS-specific 
workarounds", indeed...

--
Chuck

--
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