media-libs/openh264 fails to compile: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC Multiple lines similar to ld.lld: error: relocation R_386_32 cannot be used against local symbol; recompile with -fPIC >>> defined in codec/common/x86/mc_luma.o >>> referenced by codec/common/x86/mc_luma.asm >>> codec/common/x86/mc_luma.o:(.text+0x1F) Reproducible: Sometimes I initially thought this was a clang / clang-16 specific issue, but this does not seem to be the case. I have a feeling it's due to USE=-static-libs. I can succesfully compile it with the provided fix-recompile-with-pic.patch, but I am not sure if checking for USE=-static-libs is correct. Intuitively I'm guessing that's why, and it seems to be the case... but I'd like confirmation if USE=-static-libs requires -fPIC in general.
Created attachment 866057 [details] build.log
Created attachment 866058 [details] environment
Created attachment 866059 [details] emerge --info media-libs/openh264
Created attachment 866060 [details, diff] Suggested patch
What happens if you just do ENABLEPIC=Yes?
That works for me, but I don't believe it should be necessary for everyone, as I know it compiles for most people without it. I don't know what side effects PIC can cause.
(In reply to Mazunki Hoksaas from comment #6) > That works for me, but I don't believe it should be necessary for everyone, > as I know it compiles for most people without it. I don't know what side > effects PIC can cause. We generally want PIC unconditionally nowadays.
I see. Then we should do what you suggested. I can PR it to ::gentoo tomorrow. Some packages have USE=-pic (like the linked bug) by default. Maybe profile should handle that?
It's on by default in hardened right now, but not in general.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb90f46ed25e16e5fdc697977f1e05241c2e7968 commit bb90f46ed25e16e5fdc697977f1e05241c2e7968 Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2023-07-27 07:40:11 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2023-07-27 07:40:11 +0000 media-libs/openh264: add missing -fPIC to flags to fix textrels Closes: https://bugs.gentoo.org/911141 Closes: https://github.com/gentoo/gentoo/pull/32033 Signed-off-by: Joonas Niilola <juippis@gentoo.org> media-libs/openh264/openh264-2.3.1-r2.ebuild | 134 +++++++++++++++++++++++++++ 1 file changed, 134 insertions(+)