Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 265398 - media-video/ffmpeg: adjust ebuild to allow mmx/sse optimizations when PIC is enabled using >gcc4
Summary: media-video/ffmpeg: adjust ebuild to allow mmx/sse optimizations when PIC is ...
Status: RESOLVED DUPLICATE of bug 179872
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High enhancement (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-08 04:25 UTC by Danoz
Modified: 2009-07-09 16:15 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danoz 2009-04-08 04:25:13 UTC
from the ebuild i noticed that any mmx/sse optimizations are disabled when PIC is enabled. from what I know in the past this did not work with gcc3. I believe any gcc4+ is capable of generating PIC asm. 

So my suggestion is to adjust the ebuild to check if using gcc4 first. I've tested compiling ffmpeg with this check and it builds correctly on an amd64 hardened system with mmx, mmxest, sse and ssse3 options enabled.


    # disable mmx accelerated code if PIC is required
    # as the provided asm decidedly is not PIC.
    if [ "$(gcc-major-version)" != "4" ]; then
        if gcc-specs-pie ; then
            myconf="${myconf} --disable-mmx --disable-mmx2"
        fi
    fi

* sorry, not sure how to write a proper patch for this
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-04-08 18:16:58 UTC
(In reply to comment #0)
> * sorry, not sure how to write a proper patch for this

You don't have to "write" a patch. Simply use diff for creating the patch:

  diff -u original_file modified_file > file.patch
Comment 2 Danoz 2009-04-08 22:37:26 UTC
--- /usr/portage/media-video/ffmpeg/ffmpeg-0.5-r1.ebuild	2009-04-09 08:35:59.214576211 +1000
+++ /usr/local/portage/overlay/media-video/ffmpeg/ffmpeg-0.5-r2.ebuild	2009-04-09 08:36:24.487596728 +1000
@@ -122,8 +122,10 @@
 	use 3dnowext || myconf="${myconf} --disable-amd3dnowext"
 	# disable mmx accelerated code if PIC is required
 	# as the provided asm decidedly is not PIC.
-	if gcc-specs-pie ; then
-		myconf="${myconf} --disable-mmx --disable-mmx2"
+ 	if [ "$(gcc-major-version)" != "4" ]; then
+ 		if gcc-specs-pie ; then
+ 			myconf="${myconf} --disable-mmx --disable-mmx2"
+ 		fi
 	fi
 
 	# Try to get cpu type based on CFLAGS.
Comment 3 Alexis Ballier gentoo-dev 2009-04-09 07:12:00 UTC
I believe the asm routines of ffmpeg are still not pic/pie (bug #179872); anyway its up to the hardened team to decide how to handle this.
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2009-07-09 16:15:40 UTC

*** This bug has been marked as a duplicate of bug 179872 ***