M
M
Max2015-05-09 13:45:30
Android
Max, 2015-05-09 13:45:30

ffmpeg compilation error with lame. Where to dig?

Comrades, I'm trying to build an ffmpeg-a binary with MP3 encoder-a support for Android OS. I took the ffmpeg-a sources here , the lame sources there .
Accordingly, I made changes to a couple of sh files and created a separate one for configuring the lame assembly.
Here's what happened:
android_build.sh

#!/bin/bash

. settings.sh

BASEDIR=$(pwd)
TOOLCHAIN_PREFIX=${BASEDIR}/toolchain-android

for i in "${SUPPORTED_ARCHITECTURES[@]}"
do
  rm -rf ${TOOLCHAIN_PREFIX}
  ./x264_build.sh $i $BASEDIR 0 || exit 1
  ./lame_build.sh $i $BASEDIR 0 || exit 1 # Добавил эту строчку
  ./ffmpeg_build.sh $i $BASEDIR 0 || exit 1
done

rm -rf ${TOOLCHAIN_PREFIX}

lame_build.sh
#!/bin/bash

. abi_settings.sh $1 $2 $3

pushd lame

make clean

case $1 in
  armeabi-v7a | armeabi-v7a-neon)
    HOST=arm-linux
  ;;
  x86)
    HOST=i686-linux
  ;;
esac

echo $CFLAGS

./configure \
  --with-pic \
  --host="$HOST" \
  --enable-static \
  --disable-shared \
  --prefix="${TOOLCHAIN_PREFIX}" || exit 1

make -j${NUMBER_OF_CORES} install || exit 1

popd

ffmpeg_build.sh
#!/bin/bash
. abi_settings.sh $1 $2 $3

pushd ffmpeg

case $1 in
  armeabi-v7a | armeabi-v7a-neon)
    CPU='cortex-a8'
  ;;
  x86)
    CPU='i686'
  ;;
esac

make clean

./configure \
--target-os="$TARGET_OS" \
--cross-prefix="$CROSS_PREFIX" \
--arch="$NDK_ABI" \
--cpu="$CPU" \
--enable-runtime-cpudetect \
--sysroot="$NDK_SYSROOT" \
--enable-pic \
--enable-libx264 \
--enable-libmp3lame \ # Добавил эту строчку
--enable-pthreads \
--disable-debug \
--disable-ffserver \
--enable-version3 \
--enable-hardcoded-tables \
--disable-ffplay \
--disable-ffprobe \
--enable-gpl \
--enable-yasm \
--disable-doc \
--disable-shared \
--enable-static \
--pkg-config="${2}/ffmpeg-pkg-config" \
--prefix="${2}/build/${1}" \
--extra-cflags="-I${TOOLCHAIN_PREFIX} -I${MP3LAME}/include $CFLAGS" \ # небольшая вставка тут 
--extra-ldflags="-L${TOOLCHAIN_PREFIX} -L${MP3LAME}/lib $LDFLAGS" \   # и тут
--extra-libs="-lm" \
--extra-cxxflags="$CXX_FLAGS" || exit 1

make -j${NUMBER_OF_CORES} && make install || exit 1

popd

When I try to execute ./android_build.sh I get:
/bin/sh ../libtool --tag=CC   --mode=link gcc  -O3  -ffast-math             -funroll-loops -Wall  -fno-common      -static  -o lame lame_main.o main.o brhist.o console.o get_audio.o lametime.o parse.o timestatus.o ../libmp3lame/libmp3lame.la -lncurses  -liconv -lm 
libtool: link: gcc -O3 -ffast-math -funroll-loops -Wall -fno-common -o lame lame_main.o main.o brhist.o console.o get_audio.o lametime.o parse.o timestatus.o  ../libmp3lame/.libs/libmp3lame.a -lncurses -liconv -lm
Undefined symbols for architecture x86_64:
  "_init_xrpow_core_sse", referenced from:
      _init_xrpow_core_init in libmp3lame.a(quantize.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [lame] Error 1
make: *** [install-recursive] Error 1

I collect under Mac OS if it matters.
I would be very grateful if you tell me where to dig.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Max, 2015-06-01
@mbelskiy

As a result, I started my old "tractor" with x86 architecture and compiled these sources.

T
Timur Sergeevich, 2015-05-31
@MyAlesya

Well, how? Happened?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question