Ticket #1241 (closed defect: fixed)

Opened 13 months ago

Last modified 9 months ago

ffmpeg build is trying to compile 'neon' although this instruction set is disabled @ ./configure ( '--disable-neon' )

Reported by: nadav Owned by:
Priority: normal Component: build system
Version: git-master Keywords: arm neon build
Cc: notzed Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Environment

OS Ubuntu 11.10
RELEASE 0.10.2.git
Platform Android
neon --disable-neon
optimizations --disable-optimizations

Problem

Problem ffmpeg build is trying to compile 'neon' although this instruction set is disabled @ ./configure ( '--disable-neon' )
Symptom libavcodec/libavcodec.so: undefined reference to `ff_pred16x16_vert_neon' ...
Analysis The problem is in affect ONLY when compiling with '--disable-optimizations', going though the code, at multiple places the line 'if (HAVE_NEON)' is used, my assumption is that when the optimizer is on, the 'if (HAVE_NEON)' phrases are omitted from compilation, and, when the optimization is disabled, they ( neon phrases ) are not, and thus, the import table for neon instructions @ 'if (false)' phrases is added the neon instructions ( although they are not used by the code ), and this, leads to the undefined reference linker error.

Attachments

patchneondsp.diff Download (2.4 KB) - added by cehoyos 13 months ago.
1241-new.diff Download (1.9 KB) - added by notzed 11 months ago.
similar patch against git head
patchneondsp2.diff Download (2.0 KB) - added by cehoyos 11 months ago.

Change History

comment:1 Changed 13 months ago by nadav

One additional comment, using '--disable-optimizations' with ffmpeg@Android is mandatory so I'll B able to step through ffmpeg code while debugging on the device.

comment:2 Changed 13 months ago by cehoyos

  • Keywords arm added
  • Component changed from avcodec to build system

Which compiler and version are you using?

The error message you provide does not match the configure options you mentioned.

Please provide your configure line and please run make, run make again, then run "make V=1" and post the complete output (please do not post the complete output of the first make run).

comment:3 Changed 13 months ago by nadav

compiler

The one provided with NDK7B ( arm-linux-androideabi-4.4.3 )

configure

../../Multimedia/ffmpeg/configure \
--logfile="configure.log" \
--cross-prefix=arm-linux-androideabi- \
--arch=arm \
--target-os=linux \
--disable-everything \
--disable-pthreads \
--disable-stripping \
--enable-debug=3 \
--enable-version3 \
--enable-libx264 \
--enable-demuxer=mov \
--enable-demuxer=rtsp \
--enable-muxer=asf \
--enable-muxer=asf_stream \
--enable-muxer=mov \
--enable-muxer=mp4 \
--enable-muxer=ffm \
--enable-encoder=h264 \
--enable-decoder=h264 \
--enable-demuxer=ffm \
--enable-parser=h264 \
--enable-protocol=file \
--enable-protocol=rtp \
--enable-nonfree \
--enable-gpl \
--enable-postproc \
--extra-cflags="-I/home/nadav/workspace/Android/x264 -I/home/nadav/workspace/Multimedia/x264 -gstabs+" \
--extra-ldflags="-L/home/nadav/workspace/Android/x264" \
--enable-static \
--enable-shared \
--disable-neon \
--disable-optimizations

make V=1

arm-linux-androideabi-gcc -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -L/home/nadav/workspace/Android/x264 -Wl,--as-needed -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil -o ffmpeg_g ffmpeg.o cmdutils.o -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswresample -lswscale -lavutil -lx264 -lm -lz

undefined reference

libavcodec/libavcodec.so: undefined reference to `ff_pred16x16_vert_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred8x8_l0t_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_biweight_h264_pixels_4_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred16x16_left_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_idct_add16_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_idct8_add4_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred8x8_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred8x8_0l0_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_v_loop_filter_luma_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred8x8_top_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_biweight_h264_pixels_16_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred8x8_0lt_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred8x8_hor_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred8x8_128_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred8x8_plane_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred16x16_hor_neon'
libavcodec/libavcodec.so: undefined reference to `ff_weight_h264_pixels_8_neon'
libavcodec/libavcodec.so: undefined reference to `ff_biweight_h264_pixels_8_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_v_loop_filter_chroma_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred16x16_top_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred16x16_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_weight_h264_pixels_4_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred8x8_left_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred16x16_128_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_h_loop_filter_luma_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred8x8_vert_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_idct_add8_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred8x8_l00_dc_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_idct8_add_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_idct_add16intra_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_idct_dc_add_neon'
libavcodec/libavcodec.so: undefined reference to `ff_pred16x16_plane_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_idct_add_neon'
libavcodec/libavcodec.so: undefined reference to `ff_weight_h264_pixels_16_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_h_loop_filter_chroma_neon'
libavcodec/libavcodec.so: undefined reference to `ff_h264_idct8_dc_add_neon'

Changed 13 months ago by cehoyos

comment:4 Changed 13 months ago by cehoyos

Could you test if attached patch makes any difference?

comment:5 Changed 13 months ago by nadav

~/workspace/Multimedia/ffmpeg$ patch -p1 -i patchneondsp.diff
patching file libavcodec/arm/h264dsp_init_arm.c
Hunk #1 succeeded at 68 (offset 1 line).
Hunk #2 FAILED at 96.
1 out of 2 hunks FAILED -- saving rejects to file libavcodec/arm/h264dsp_init_arm.c.rej
patching file libavcodec/arm/h264pred_init_arm.c
Hunk #1 succeeded at 43 (offset 1 line).
Hunk #2 FAILED at 74.
1 out of 2 hunks FAILED -- saving rejects to file libavcodec/arm/h264pred_init_arm.c.rej

Also, attached, 'h264dsp_init_arm.c.rej' and 'h264pred_init_arm.c.rej'

comment:6 Changed 13 months ago by cehoyos

Please test current git head with (and without) the patch.

comment:7 Changed 12 months ago by cehoyos

Could you test if this problem is still reproducible?
Build problems can be important, but this is unlikely to get fixed without some help (I don't have an arm environment).

Changed 11 months ago by notzed

similar patch against git head

comment:8 follow-up: ↓ 9 Changed 11 months ago by notzed

with this patch applied, --enable-optimize works, --enable-optimise --disable-neon also works.

This is the config line, which is about the simplest I could manage and have it build:

--prefix=/home/notzed/svn/ffmpeg-build/build/armeabi-v7a --cross-prefix=/usr/local/android-ndk-r7c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- --enable-cross-compile --target-os=linux --sysroot=/usr/local/android-ndk-r7c/platforms/android-8/arch-arm/ --arch=arm --disable-optimizations

(without the patch it fails similarly to original report)

Last edited 11 months ago by notzed (previous) (diff)

Changed 11 months ago by cehoyos

comment:9 in reply to: ↑ 8 Changed 11 months ago by cehoyos

  • Cc notzed added

Replying to notzed:

with this patch applied, --enable-optimize works, --enable-optimise --disable-neon also works.

--enable-optimize ?

Your patch adds an externally visible symbol, does my new patch work for you?

comment:10 Changed 11 months ago by notzed

Sure it does - it was copying the patch you provided:  https://ffmpeg.org/trac/ffmpeg/attachment/ticket/1241/patchneondsp.diff

The new patch also works.

comment:11 Changed 10 months ago by michael

Which patch fixes what ?
ive tested several patches and configurations on NDK and none fixed anything.

comment:12 Changed 10 months ago by michael

  • Summary changed from ffmpeg to ffmpeg build is trying to compile 'neon' although this instruction set is disabled @ ./configure ( '--disable-neon' )

update summary based on dscription of the original report

comment:13 follow-up: ↓ 14 Changed 10 months ago by notzed

Sorry I mean to update this a while ago but I couldn't find the bug number.

Without the patchneondsp2 diff, the command line i gave fails to build, with those neon_* symbols missing. With the patch it succeeds.

But I actually wanted neon turned on, so my case was slightly different, sorry if i just confused the matter by trying to help.

comment:14 in reply to: ↑ 13 Changed 9 months ago by michael

  • Keywords neon build added
  • Status changed from new to closed
  • Version changed from unspecified to git-master
  • Resolution set to fixed
  • Reproduced by developer set

Replying to notzed:

Without the patchneondsp2 diff, the command line i gave fails to build, with those neon_* symbols missing. With the patch it succeeds.

thanks, ive been able to reproduce and fix the issue

Note: See TracTickets for help on using tickets.