Compiling x264 for arm926ej-s in the LG NAS

Trying to compile the x264 library (x264-snapshot-20120805-2245-stable)  for the ARM926 in my LG NAS. Running ./configure seems to give a binary which won’t link with ffmpeg. Config.log in ffmpeg gives the following errors:

/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d26′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d22′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d2′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d20′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d24′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `d0′
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../libx264.so: undefined reference to `q1′
collect2: ld returned 1 exit status
ERROR: libx264 not found

Here’s some random notes I used to make it work:

The .configure for x264 seems to default to cortex9 w/ Neon FPU… not present in my LGNAS. Run configure with the following options:

./configure –disable-neon –enable-gpl  –prefix=/usr –enable-static –enable-shared  –disable-asm 

As a result I hand edited the config.mak as follows:

ARCH=ARM
MYCPU=arm926ej-s
SYS=LINUX
CC=gcc
CFLAGS=-Wshadow -O3 -fno-fast-math -Wall -I. -I$(SRCPATH) -std=gnu99 -mcpu=${MYCPU} -mtune=${MYCPU} -fPIC -fomit-frame-pointer -fno-tree-vectorize

Where did I get arm926ej-s ? cat /proc/cpuinfo
According to this post; the LGNAS CPU (Marvell “Kirkwood”) does not have VFP support (would be listed as vfp under “Features” in cpuinfo) therefore do not specify a -mfpu= in the CFLAGS.

Do ‘make'; do ‘make install-lib-shared’.

In ffmpeg; pass the following configure command:

./configure –enable-gpl –enable-libx264 –enable-libfaac –enable-nonfree –enable-libxvid –prefix=/usr –disable-stripping –disable-armv6 –disable-altivec –disable-vis –enable-shared –disable-static

Did the same edit to ffmpeg’s config.mak as done in x264 config.mak.

This entry was posted in Linux, N2B1, NAS. Bookmark the permalink.

Leave a Reply

Please Note: Each comment is screened by a human before posting - SPAM not wanted.

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>