Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 392451 - media-video/ffmpeg disables some optimizations on arm (build fails with CFLAGS='-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard')
Summary: media-video/ffmpeg disables some optimizations on arm (build fails with CFLAG...
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: ARM Linux
: Normal major (vote)
Assignee: media-video herd
URL:
Whiteboard:
Keywords:
Depends on: 394493
Blocks:
  Show dependency tree
 
Reported: 2011-11-29 18:36 UTC by Luke-Jr
Modified: 2011-12-16 02:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
media-video/ffmpeg-0.7.8 build log (build.log,95.61 KB, text/plain)
2011-11-29 18:36 UTC, Luke-Jr
Details
emerge --info (emerge--info,15.16 KB, text/plain)
2011-11-29 18:37 UTC, Luke-Jr
Details
0.8.7 config.log (config.log,244.69 KB, text/plain)
2011-12-14 16:10 UTC, Luke-Jr
Details
build.log with ASFLAGS (build.log,118.44 KB, text/plain)
2011-12-14 19:04 UTC, Luke-Jr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke-Jr 2011-11-29 18:36:50 UTC
Created attachment 294223 [details]
media-video/ffmpeg-0.7.8 build log

At least media-video/ffmpeg 0.7.7, 0.7.8, and 0.8.7 all fail to build on armv7a-hardfloat-linux-gnueabi
Comment 1 Luke-Jr 2011-11-29 18:37:19 UTC
Created attachment 294225 [details]
emerge --info
Comment 2 Luke-Jr 2011-12-12 18:56:37 UTC
By adding the configure argument --extra-cflags='-mfpu=vfp -mfloat-abi=hard' and applying this patch at http://repository.timesys.com/buildsources/f/ffmpeg/ffmpeg-0.8.7/ffmpeg-0.8.7-no-av_clip_uintp2_arm.patch , ffmpeg-0.8.7 seems to build, but still fails to link... I also tried to use -mfpu=neon (in my normal CFLAGS), but that failed to assemble.
Comment 3 Luke-Jr 2011-12-12 23:12:56 UTC
For 9999, removing --disable-optimizations (a flag that upstream doesn't support, and tells me is known to break things even on x86) from the configure flags allows it to build. Even with USE=neon, NEON support is still not enabled; adding --extra-cflags='-mfpu=neon -mfloat-abi=hard' fixes that (and builds fine!)
Comment 4 Luke-Jr 2011-12-12 23:37:51 UTC
Same changes fix 0.8.7 as well.
Comment 5 Alexis Ballier gentoo-dev 2011-12-14 13:08:54 UTC
the patch is a no go because it simply disables some optimized function, at best there should be a configure check for it.

please attach config.log to see why it fails to detect neon and why it enables vfp when it shouldnt.

does it also fail with -9999 ?
Comment 6 Luke-Jr 2011-12-14 15:48:02 UTC
(In reply to comment #5)
> the patch is a no go because it simply disables some optimized function, at
> best there should be a configure check for it.

It didn't help much anyway.

> please attach config.log to see why it fails to detect neon and why it enables
> vfp when it shouldnt.

It fails to detect NEON because it ignores CFLAGS, and doesn't add -mfpu=neon itself. Upstream developers are using --extra-cflags to add this flag. Why shouldn't it enable VFP?

> does it also fail with -9999 ?

Every single ffmpeg ebuild in-tree fails as-is; both 0.8.7 and 9999 work fine if I remove --disable-optimizations
Comment 7 Luke-Jr 2011-12-14 16:10:57 UTC
Created attachment 295819 [details]
0.8.7 config.log
Comment 8 Alexis Ballier gentoo-dev 2011-12-14 17:26:04 UTC
(In reply to comment #7)
> Created attachment 295819 [details]
> 0.8.7 config.log

(see other bug)
this config.log shows that you're lacking ASFLAGS settings for -mfpu and -mfloat-abi
Comment 9 Alexis Ballier gentoo-dev 2011-12-14 17:31:18 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Created attachment 295819 [details]
> > 0.8.7 config.log
> 
> (see other bug)
> this config.log shows that you're lacking ASFLAGS settings for -mfpu and
> -mfloat-abi

Actually, in case of ffmpeg, this would make sense doing ASFLAGS=$CFLAGS before configure. Could you please check it helps ?
Comment 10 Luke-Jr 2011-12-14 19:04:14 UTC
Created attachment 295841 [details]
build.log with ASFLAGS

ASFLAGS does get ffmpeg to enable NEON support, but build still fails.
Comment 11 Alexis Ballier gentoo-dev 2011-12-15 11:16:00 UTC
this should be fixed in 9999, please test
(or 0.9 that ill commit soon)
Comment 12 Luke-Jr 2011-12-16 01:11:28 UTC
9999 compiled OK, will VERIFY bug when 0.9 finishes successfully...
Comment 13 Luke-Jr 2011-12-16 01:46:06 UTC
0.9 built successful as well, thanks
Comment 14 Luke-Jr 2011-12-16 02:12:18 UTC
Actually, you should probably add ~arm to media-video/ffmpeg-0.9 now ;)