Subject: Re: multimedia/xine-lib fails mysteriously to build
To: None <pkgsrc-users@NetBSD.org>
From: Rhialto <rhialto@falu.nl>
List: pkgsrc-users
Date: 05/07/2007 21:45:44
On Mon 07 May 2007 at 20:58:12 +0200, Rhialto wrote:
> I've been rebuilding my packages on amd64/3.0 for pkgsrc-2007Q1, and
> multimedia/xine-lib fails mysteriously to build. Apparently there is
> some fault in a libtool sub-command, one that has its error output
> redirected to /dev/null.

I found that there is some conditionally-compiled assembly in a header
file.  I can avoid the problem if I simply disable it when !PIC &&
ARCH_X86_64.  That doesn't seem to be the best solution, since a nearby
test for ARCH_X86_64 seems to suggest the assembly is supposed to work
for it too.

    #define LOW          "0"
    #define RANGE        "4"
    #ifdef ARCH_X86_64
    #define BYTESTART   "16"
    #define BYTE        "24"
    #define BYTEEND     "32"
    #else
    #define BYTESTART   "12"
    #define BYTE        "16"
    #define BYTEEND     "20"
    #endif
    #if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__))

Here is an extra patch file:

--- src/libffmpeg/libavcodec/cabac.h.dist	2007-01-28 19:38:33.000000000 +0100
+++ src/libffmpeg/libavcodec/cabac.h	2007-05-07 21:03:25.000000000 +0200
@@ -376,7 +376,7 @@
 #define BYTE        "16"
 #define BYTEEND     "20"
 #endif
-#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__))
+#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) && !defined(ARCH_X86_64)
     int bit;
 
 #ifndef BRANCHLESS_CABAC_DECODER
@@ -680,7 +680,7 @@
 
 //FIXME the x86 code from this file should be moved into i386/h264 or cabac something.c/h (note ill kill you if you move my code away from under my fingers before iam finished with it!)
 //FIXME use some macros to avoid duplicatin get_cabac (cant be done yet as that would make optimization work hard)
-#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__))
+#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) && !defined(ARCH_X86_64)
 static int decode_significance_x86(CABACContext *c, int max_coeff, uint8_t *significant_coeff_ctx_base, int *index){
     void *end= significant_coeff_ctx_base + max_coeff - 1;
     int minusstart= -(int)significant_coeff_ctx_base;

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert      -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl        -- Cetero censeo "authored" delendum esse.