Gentoolto: media-libs/x264-9999: endian test failed

Created on 20 Dec 2020  路  10Comments  路  Source: InBetweenNames/gentooLTO

In this commit "-c" is (re-)intoduced to the conftest compilation. This breaks the endian test for my environment. Dropping "-c" again fixes the issue:

x264-fix-endian-test.zip
or
https://github.com/InBetweenNames/gentooLTO/pull/672

"-c" jas been introduced here: https://github.com/InBetweenNames/gentooLTO/commit/e96d39e31b5f2b2996c570f39c4638cc6c0a45da

The same for x264-encoder - patch updated.

Most helpful comment

Code blocks added, sorry, my bad.
I think the third "it" is refering to the script. I wonder about the "it" in "make sure it stays the same": what should be checked to stay the same?
BTW: I did some more checks, I'm pretty sure lto doesn't play nice with suspressed linking. So we need to drop "-c" and add "-shared". If this is done via patch or via sed shouldn't effect the outcome.

All 10 comments

Just a quick test:

adler tmp # echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c
adler tmp # x86_64-pc-linux-gnu-gcc conftest.c -march=bdver1 -mtune=bdver1 -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=8 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wall -I. -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -march=bdver1 -c -shared -o conftest-with_-c.o
adler tmp # x86_64-pc-linux-gnu-gcc conftest.c -march=bdver1 -mtune=bdver1 -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=8 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wall -I. -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -march=bdver1 -shared -o conftest-without_-c.o
adler tmp # strings conftest-with_-c.o |grep -e EGIB -e naidnePF -e BIGE -e FPendian
adler tmp # strings conftest-without_-c.o |grep -e EGIB -e naidnePF -e BIGE -e FPendian
EGIB
naidnePF
adler tmp #

I think it would be best to create a new shell script in bashrc.d/ and use regex to make sure it stays the same. Would it add noticeable overhead to the ebuild process to have the script check for the package being media-libs/x264 every time?

I don't even understand what the second "it" is refering to. As long as your script works, I'm the last insisting on removing -c from the patch.

Second it is referring to adding an additional script to bashrc.d/. And yes, I agree your patch works. Please use code blocks when pasting output.

adler tmp # echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c
adler tmp # x86_64-pc-linux-gnu-gcc conftest.c -march=bdver1 -mtune=bdver1 -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=8 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wall -I. -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -march=bdver1 -c -shared -o conftest-with_-c.o
adler tmp # x86_64-pc-linux-gnu-gcc conftest.c -march=bdver1 -mtune=bdver1 -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=8 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wall -I. -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -march=bdver1 -shared -o conftest-without_-c.o
adler tmp # strings conftest-with_-c.o |grep -e EGIB -e naidnePF -e BIGE -e FPendian
adler tmp # strings conftest-without_-c.o |grep -e EGIB -e naidnePF -e BIGE -e FPendian
EGIB
naidnePF
adler tmp #

Code blocks added, sorry, my bad.
I think the third "it" is refering to the script. I wonder about the "it" in "make sure it stays the same": what should be checked to stay the same?
BTW: I did some more checks, I'm pretty sure lto doesn't play nice with suspressed linking. So we need to drop "-c" and add "-shared". If this is done via patch or via sed shouldn't effect the outcome.

I've came to the same issue while rebuilding world.
I ended up disabling LTO to this package in package.cflags with something like media-libs/x264 *FLAGS-="${FLTO}"
Then it passes endianess test.

I've no preference regarding patch or sed, but I dislike disabling lto just to make the configure script happy, though the package builds perfectly with lto. I strongly opt for dropping "-c" one way or another.

I've came to the same issue while rebuilding world.
I ended up disabling LTO to this package in package.cflags with something like media-libs/x264 *FLAGS-="${FLTO}"
Then it passes endianess test.

Adding -ffat-lto-objects also works

https://github.com/InBetweenNames/gentooLTO/issues/602#issuecomment-691730294

@nvertigo

I've no preference regarding patch or sed, but I dislike disabling lto just to make the configure script happy, though the package builds perfectly with lto.

This days no-one even try to figure out how to make LTO "happy", in any unusual case they just PR "fix" with -ffat-lto-objects or *FLAGS-="${FLTO}. That's why I have my own configuration file and avoid disabling lto if possible.

$ grep -E '^[^#].*\-="\-flto' /etc/portage/package.cflags/* | wc -l`
10

Original patch, BTW:
https://github.com/InBetweenNames/gentooLTO/pull/55/files#diff-66ee44970c5a708ec867ab37b73c7b2fdc73984ba39f3a8a92b050c46b41d8fb

I have no idea why they added -c back.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nivedita76 picture nivedita76  路  17Comments

Althorion picture Althorion  路  10Comments

javashin picture javashin  路  4Comments

KlausMeier picture KlausMeier  路  13Comments

wolfwood picture wolfwood  路  14Comments