Opened 4 years ago

Closed 4 years ago

#1479 closed defect (fixed)

--disable-optimisations causes build to fail against android ndk

Reported by: notzed Owned by:
Priority: normal Component: build system
Version: 0.11.1 Keywords: arm
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When compiling with the android ndk, using --disable-optimizations causes the build to fail immediately:

/usr/local/android-ndk-r7c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -I. -I/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DHAVE_AV_CONFIG_H -I/usr/local/android-ndk-r7c/platforms/android-8/arch-armusr/include -mfloat-abi=softfp -mfpu=neon -marm -march=armv7-a --sysroot=/usr/local/android-ndk-r7c/platforms/android-8/arch-arm/ -std=c99 -fPIC -marm -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -MMD -MF libavformat/4xm.d -MT libavformat/4xm.o -c -o libavformat/4xm.o /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavformat/4xm.c
In file included from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/intmath.h:36,

from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/common.h:102,
from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/avutil.h:327,
from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/samplefmt.h:22,
from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavcodec/avcodec.h:30,
from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavformat/avformat.h:197,
from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavformat/4xm.c:32:

/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/arm/intmath.h: In function 'av_clip_uintp2_arm':
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/arm/intmath.h:82: warning: asm operand 2 probably doesn't match constraints
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/arm/intmath.h:82: error: impossible constraint in 'asm'
make[1]: * [libavformat/4xm.o] Error 1

This is caused by this instruction/function:

#define av_clip_uintp2 av_clip_uintp2_arm
static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p)
{

unsigned x;
asm ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
return x;

}

usat's second argument must be an immediate value, so unless this function is inlined it cannot work.

Adding --enable-small allows the build to continue further as it forces inlining (rather counter-intuitively), but it then fails at:

/usr/local/android-ndk-r7c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -I. -I/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DHAVE_AV_CONFIG_H -I/usr/local/android-ndk-r7c/platforms/android-8/arch-armusr/include -mfloat-abi=softfp -mfpu=neon -marm -march=armv7-a --sysroot=/usr/local/android-ndk-r7c/platforms/android-8/arch-arm/ -std=c99 -fPIC -marm -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Os -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -MMD -MF libswscale/output.d -MT libswscale/output.o -c -o libswscale/output.o /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libswscale/output.c
In file included from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/intmath.h:36,

from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/common.h:102,
from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/avutil.h:327,
from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libswscale/output.c:27:

/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/arm/intmath.h: In function 'yuv2plane1_10_c_template':
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/arm/intmath.h:82: warning: asm operand 2 probably doesn't match constraints
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/arm/intmath.h:82: warning: asm operand 2 probably doesn't match constraints
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/arm/intmath.h:82: error: impossible constraint in 'asm'
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/arm/intmath.h:82: error: impossible constraint in 'asm'
In file included from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/intmath.h:36,

from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/common.h:102,
from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/avutil.h:327,
from /home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libswscale/output.c:27:

/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/arm/intmath.h: In function 'yuv2planeX_10_c_template':
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/arm/intmath.h:82: warning: asm operand 2 probably doesn't match constraints
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libavutil/arm/intmath.h:82: warning: asm operand 2 probably doesn't match constraints
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libswscale/output.c: In function 'yuv2rgb_X_c_template':
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libswscale/output.c:994: warning: 'A2' may be used uninitialized in this function
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libswscale/output.c:994: warning: 'A1' may be used uninitialized in this function
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libswscale/output.c: In function 'yuv2rgb_full_X_c_template':
/home/notzed/svn/jjmpeg-0.11/jjmpeg-core/jni/ffmpeg-0.11/libswscale/output.c:1227: warning: 'A' may be used uninitialized in this function
make[1]: * [libswscale/output.o] Error 1


gcc is version 4.4.3 from the android ndk v7c.
FFmpeg version 0.11.1 (I will try against the git's head once it's finished checking out)

configuration, with --enable small on:

FFMPEG_CONFIGURATION "--prefix=/home/notzed/svn/jjmpeg-0.11/jjmpeg-android/jni/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 --extra-cflags='-I/usr/local/android-ndk-r7c/platforms/android-8/arch-armusr/include -mfloat-abi=softfp -mfpu=neon -marm -march=armv7-a --sysroot=/usr/local/android-ndk-r7c/platforms/android-8/arch-arm/' --extra-ldflags='-L/usr/local/android-ndk-r7c/platforms/android-8/arch-armusr/lib --sysroot=/usr/local/android-ndk-r7c/platforms/android-8/arch-arm/' --arch=arm --disable-stripping --enable-debug --disable-optimizations --enable-small --disable-shared --enable-static --disable-symver --enable-pthreads --enable-gpl --enable-version3 --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-avfilter --disable-postproc"

Attachments (1)

1479-small.diff (6.5 KB) - added by notzed 4 years ago.
This patch allows the build to finish if --disable-optimizations --enable-small is turned on.

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by notzed

This patch allows the build to finish if --disable-optimizations --enable-small is turned on.

comment:1 Changed 4 years ago by notzed

Ok so finally git head checked out.

--disable-optimizations on it's own fails in a similar way.

But if i also add --enable-small it builds completely, so I suppose that patch is pointless.

comment:2 Changed 4 years ago by michael

  • Keywords arm added
  • Resolution set to fixed
  • Status changed from new to closed

As this works with git head, closing.
If you want me to backport some fix to the release branches, iam happy to do that if someone tells me which need to be backported

Note: See TracTickets for help on using tickets.