Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update patch for media-libs/x264-0.0.20190903-r1 #635

Closed
wants to merge 2 commits into from

Conversation

iphands
Copy link

@iphands iphands commented Nov 2, 2020

Title: media-libs/x264: lto.patch fails to apply to >= 20190903-r1

Simple fixing patch that applies -shared to CC when doing an endianess check

@iphands
Copy link
Author

iphands commented Nov 3, 2020

This also works for 0.0.20190214

@telans
Copy link
Contributor

telans commented Nov 7, 2020

You should mirror this to the x264-encoder patch as well

@iphands
Copy link
Author

iphands commented Nov 11, 2020

@telans hey I was playing around with this some...
I ended up realizing I goofed a bit and put the patch in for x264-encoder in the first place.

In addition to that though... while testing I dont thing adding -shared to the conftest fixes this for me on my box.
Im curious... the endianness check... is there any real reason to use $CFLAGS there?

I am (naively) wondering if this is still as good as checking local endianess but gets tripped up by cflags less:

-    $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
+    $CC -O0 conftest.c -c -o conftest.o -shared 2>/dev/null || die "endian test failed ONE"

Wondering if there are any gotchas there at all?

@iphands
Copy link
Author

iphands commented Nov 11, 2020

FWIW this is what works for me:
master...iphands:tmp_O0_patch

Can push up here, but lemme know if this is cool or not cool as a solution.

@telans
Copy link
Contributor

telans commented Nov 26, 2020

Sorry for the delay. I would change the patch to:

--- a/configure	2020-11-11 12:42:21.977274237 -0500
+++ b/configure	2020-11-11 12:55:30.545286800 -0500
@@ -994,7 +994,7 @@
 CPU_ENDIAN="little-endian"
 if [ $compiler = GNU ]; then
     echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c
-    $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
+    $CC -O0 conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
     if (${STRINGS} -a conftest.o | grep -q BIGE) && (${STRINGS} -a conftest.o | grep -q FPendian) ; then
         define WORDS_BIGENDIAN
         CPU_ENDIAN="big-endian"

This requires the gentoo patches to be applied first, so this PR would depend on #653 . I believe this is a better way of applying patches (on top of whatever the gentoo tree does), but if you just want this merged without waiting for that PR the patch as you have it here is good:

FWIW this is what works for me:
master...iphands:tmp_O0_patch

@InBetweenNames
Copy link
Owner

InBetweenNames commented Jan 3, 2021

Fixed via 911a0a1 -- thanks for this though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants