Summary: | games-util/mangohud-9999 - Fails to Compile Regardless of Compiler (LLVM Profile) | ||
---|---|---|---|
Product: | GURU | Reporter: | Neko-san <gentoo.qxrin> |
Component: | Package issues | Assignee: | Adel KARA SLIMANE <adel.ks> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | adel.ks, gentoo.qxrin, gonegrier.duarte |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 836220 | ||
Attachments: |
LLVM Build Log
GCC Build Log include fix patch Build log with -fPIC error message |
Description
Neko-san
2024-02-15 23:55:44 UTC
Created attachment 885089 [details]
LLVM Build Log
Created attachment 885090 [details]
GCC Build Log
@Neko-san That is a LD error in the linking stage, I don't know how to really solve it. Most probably is a bug upstream to solve I the full gcc toolchain, using ld.bfd instead of ld.lld. Bellow is my gcc-full.conf env, pls update for your make.conf settings: ``` COMMON_FLAGS="-march=native -O3 -pipe" CFLAGS="${COMMON_FLAGS}" CXXFLAGS="${COMMON_FLAGS}" LDFLAGS="-Wl,--as-needed" CC="gcc" CXX="g++" CPP="gcc -E" AR="ar" NM="nm" RANLIB="ranlib" LD=ld.bfd OBJCOPY="objcopy" ``` With some experimentation, it appears that `-fPIE` and `-pie` are the reason why with GCC. Not ideal, but removing those solves it. As for Clang, it's straight up a source code issue. Strange I don’t use that COMMON_FLAGS and still have problems linking using the llvm linker Using gcc as the compiler I just tested mangohud-9999 using gcc (Gentoo 13.2.1_p20240113-r1 p12) with COMMON_FLAGS="-O3 -march=native -pipe -fno-plt" And not other setting and I had no issue emerging and installing. I will try llvm now. Just tested with clang 17.0.6 (CC and CXX overrides), same flags as my previous message, no issues. I cannot build as soon as I use lld. This is most definitely an upstream issue. Are you using stdlibc++ or libc++? On LLVM profiles, this is a big difference and that reflects in the Clang build log (In reply to Neko-san from comment #9) > Are you using stdlibc++ or libc++? > On LLVM profiles, this is a big difference and that reflects in the Clang > build log Yes libc++ can get a big effect, for exemple even using the full gcc stack, obs-studio fail to compile in the LLVM profile (Bug 922163) Okay I tried to build directly from source and got the same errors, it's an upstream issue. I opened a bug report in Github [1] please chime in if you can help. [1] https://github.com/flightlessmango/MangoHud/issues/1240 That's not the same Clang error associated with this issue but it's good to know regardless. For now I did not even attempt using `libc++`, one thing at a time :P @adel.ks@zegrapher.com I can try the patch and see if works with libc++ That patch does not fix the build issue when using `libc++` unfortunately Okay thankfully that error with libc++ was simply an include omission (patch will be attached after this message). However, I git against this kind of error message ``` ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'vtable for std::__1::basic_filebuf<char, std::__1::char_traits<char>>'; recompile with -fPIC ``` Which I believe comes from the fact MangoHud tries to statically link the STL Created attachment 892487 [details, diff]
include fix patch
Created attachment 892488 [details]
Build log with -fPIC error message
|