[mythtv-users] Compile error on Via c3-2. was: frontend has gone dark

Wookey wookey at wookware.org
Tue Nov 25 03:26:32 UTC 2008


On 2008-11-24 13:33 -0500, Michael T. Dean wrote:
> On 11/24/2008 01:14 PM, Wookey wrote:
> >  I apt-got sources
> > (0.21-cvs20080706 IIRC)., changes the cpue and tune options in the
> > rules configure script (to i686) and rebuilt everything.
> 
> You really shouldn't specify any cpu/tune/march/... options to 
> configure.  Only the --enable-proc-opt should be specified and configure 
> will do the right thing.  The other options are meant only for packagers 
> (i.e. people who build Myth using a specific computer but try to do so 
> in a way that it works on a bunch of other different types of 
> computers).  I highly recommend a recompile with only --enable-proc-opt .

OK. Fair point. If I remove the arch/cpu/tune specifiers and add
--enable-proc-opt I find that my cpu (Via nenmiah) is correctly
identified, and as a result libavcodec does not build:

ccache gcc-4.3 -c -pipe -g -march=c3-2 -fomit-frame-pointer -DNDEBUG
-g -DPIC -fPIC -pthread -g -Wall -Wno-switch -Wdisabled-optimization
-Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Os -w
-fomit-frame-pointer -D_REENTRANT  -Di386 -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -DHAVE_AV_CONFIG_H -D_LARGEFILE_SOURCE
-DHAVE_XVMC -DHAVE_XVMC_VLD -DQT_THREAD_SUPPORT -DQT_SHARED
-DQT_TABLET_SUPPORT -DQT_NO_DEBUG -I/usr/share/qt3/mkspecs/default -I.
-I. -I.. -I../.. -I../libavutil -I../libswscale -I/usr/include/qt3 -o
motion_est.o motion_est.c
motion_est_template.c: In function ‘qpel_motion_search’:
motion_est_template.c:412: error: can't find a register in class
 ‘GENERAL_REGS’ while reloading ‘asm’
motion_est_template.c:412: error: ‘asm’ operand has impossible constraints

It does build if I remove -fPIC (Clue from this thread:
http://gcc.gnu.org/ml/gcc-help/2007-04/msg00205.html

however I suspect -fPIC is important so this code may need changing.

There is a fix suggested in this thread, which appearsto ammount to
including --enable-small:
http://minimyth.org/forum/viewtopic.php?t=1739&sid=df718de1433deb42ab73f524dfb952c8

That appears to be already the case in the ./configure (and hence -Os
in above line). It actually also ends up with -O2 in there too, but
removing makes no difference.

Do we believe this problem has been fixed in a more recent version or
should I look into it a bit harder (not that I am any kind of x86
assembler person which I suspect is what is needed).

The code that causes the error is:
409 for(i=0; i<subpel_quality; i++){
410    nx= best_pos[i][0];
411    ny= best_pos[i][1];
412    CHECK_QUARTER_MV(nx&3, ny&3, nx>>2, ny>>2)
413 }

And CHECK_QUARTER_MV is:

#define CHECK_QUARTER_MV(dx, dy, x, y)\
{\
    const int hx= 4*(x)+(dx);\
    const int hy= 4*(y)+(dy);\
    d= cmp(s, x, y, dx, dy, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags$
    d += (mv_penalty[hx - pred_x] + mv_penalty[hy - pred_y])*penalty_factor;\
    COPY3_IF_LT(dmin, d, bx, hx, by, hy)\
}

COPY3_IF_LT (from libs/libavutil/internal.h) is:
#define COPY3_IF_LT(x,y,a,b,c,d)\
asm volatile (\
    "cmpl %0, %3        \n\t"\
    "cmovl %3, %0       \n\t"\
    "cmovl %4, %1       \n\t"\
    "cmovl %5, %2       \n\t"\
    : "+&r" (x), "+&r" (a), "+r" (c)\
    : "r" (y), "r" (b), "r" (d)\
);

I guess this is where it runs out of registers - it looks like it
needs 6 plus two more for fPIC and frame pointer(?)

Wookey
-- 
Principal hats:  Balloonz - Toby Churchill - Aleph One - Debian
http://wookware.org/


More information about the mythtv-users mailing list