#2756: Compilation fails on ARMv7 with GCC 4.8.1 --------------------------------------+---------------------------------- Reporter: cooper | Type: defect Status: new | Priority: normal Component: build system | Version: 1.2.1 Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | --------------------------------------+---------------------------------- Summary of the bug: While compiling FFMpeg 1.2.1 (gentoo ebuild) using GCC 4.8.1 on my Odroid-U2 I get a compilation error. How to reproduce: I've set CFLAGS to "-O3 -pipe -march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard" and enabled NEON. I get the following error during compilation: {{{ armv7a-hardfloat-linux-gnueabi-gcc -I. -I/var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/ -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 -O3 -pipe -march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -O3 -pipe -march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -march=armv7-a -std=c99 -fomit-frame-pointer -marm -fPIC -pthread -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -D_REENTRANT -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -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 -O3 -pipe -march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -fno- math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit- function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -MMD -MF libavcodec/dct.d -MT libavcodec/dct.o -c -o libavcodec/dct.o /var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/libavcodec/dct.c /var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/libavcodec/dcaenc.c: In function 'encode_init': /var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/libavcodec/dcaenc.c:227:36: warning: iteration 256u invokes undefined behavior [-Waggressive-loop- optimizations] lfe_fir_64i[i] = lfe_fir_64[i] * (1 << 25); //float -> int32_t ^ /var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/libavcodec/dcaenc.c:226:5: note: containing loop for (i = 0; i < 512; i++) ^ armv7a-hardfloat-linux-gnueabi-gcc -I. -I/var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/ -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 -O3 -pipe -march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -O3 -pipe -march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -march=armv7-a -std=c99 -fomit-frame-pointer -marm -fPIC -pthread -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -D_REENTRANT -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -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 -O3 -pipe -march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -fno- math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit- function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -MMD -MF libavcodec/dct32_fixed.d -MT libavcodec/dct32_fixed.o -c -o libavcodec/dct32_fixed.o /var/tmp/portage /media-video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/libavcodec/dct32_fixed.c In file included from /var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/libavcodec/dcadec.c:51:0: /var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/libavcodec/dcadec.c: In function 'dca_xbr_parse_frame': /var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/libavcodec/arm/dca.h:37:5: error: can't find a register in class 'CORE_REGS' while reloading 'asm' __asm__ ("smmul %8, %14, %18 \n" ^ /var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/libavcodec/arm/dca.h:37:5: error: 'asm' operand has impossible constraints /var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1/libavcodec/dcadec.c:1891: confused by earlier errors, bailing out make: *** [libavcodec/dcadec.o] Error 1 make: *** Waiting for unfinished jobs.... * ERROR: media-video/ffmpeg-1.2.1 failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=media- video/ffmpeg-1.2.1'`, * the complete build log and the output of `emerge -pqv '=media- video/ffmpeg-1.2.1'`. * The complete build log is located at '/var/tmp/portage/media- video/ffmpeg-1.2.1/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/media- video/ffmpeg-1.2.1/temp/environment'. * Working directory: '/var/tmp/portage/media- video/ffmpeg-1.2.1/work/ffmpeg-1.2.1_build' * S: '/var/tmp/portage/media-video/ffmpeg-1.2.1/work/ffmpeg-1.2.1' }}} I've tried compiling without NEON support, making sure to specify -mfpu=vfpv3 in the CFLAGS, but that changed nothing (I did verify that FFMpeg configured itself with NEON support disabled). I also tried, because of the '-Waggressive-loop-optimizations' warning, to compile with '-fno-aggressive-loop-optimizations' but that didn't change anything either. What's interesting, though, is that when I enabled THUMB support (-mthumb) compilation completes without any issues and I get a perfectly functioning FFMpeg. FFMpeg compiles just fine, for all these CFLAGS variations, on GCC 4.7.3 as well as GCC 4.6.4. -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2756> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker