[x264-devel] libx264: Illegal instruction on ARMv5 (Thecus N2100)

Tobias Frost tobi at frost.de
Sun Dec 26 12:04:23 CET 2010


Hallo debian-multimedia list,
Hallo x264 development list, 

Note: I'm not on the list! Please do not forget to CC me. 

When coding videos the codec fails immediatly with an illegal
instruction.
After browsing the code a bit, I think upstream did expect an
ARM V6 or better, my Thecus has:

$ uname -a 
Linux thecus 2.6.32-bpo.5-iop32x #1 Sun Sep 19 16:59:11 UTC 2010
armv5tel GNU/Linux

How to reproduce:
==================

apt-get install x264
wget http://samples.mplayerhq.hu/yuv4mpeg2/example.y4m.bz2
bunzip example.y4m.bz2
x264 -o example.mkv example.y4m
Illegal instruction

Update: Also:
tobi at thecus:~$ x264
Illegal instruction


Obervations when compiling:
==============================

ccache cc -Wshadow -O1 -g -g -O2 -Wall -I. -g -O2 -std=gnu99
-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp    -fno-tree-vectorize
-c -o common/mc.o common/mc.c

I'm not sure if the -mcpu and -mfpu are right. The Thecus has
an Intel XScale 255. This one has no NEON extension, nor it is a cortex
A8.
A brief check of the configure scripts seems to show that this
is hardcoded as soon as ARM is set as ARCH, and it is only checked
if the assembler supports the instruction, not if the hardware really
does (would be hard for cross-compiling, I know...)


How to fix?
===========
A temporary fix is be to add "--disable-asm" to the
configure script (via debian rules) if building for 
debian ARM. This is how I rebuild the packages to 
get a working solution.

I assume that this should be really fixed on debian 
side, but currently debian cannot differenciate 
different CPU capabilites, ASFAIK.

But a runtime-detection might work as well ?
(Is a bad-instruction trapable?)

--
coldtobi




More information about the x264-devel mailing list