Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 942290 - games-util/mangohud fails to compile with libc++
Summary: games-util/mangohud fails to compile with libc++
Status: UNCONFIRMED
Alias: None
Product: GURU
Classification: Unclassified
Component: Package issues (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Adel KARA SLIMANE
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-26 14:43 UTC by muck-dart-strung
Modified: 2024-12-28 03:43 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,218.39 KB, text/x-log)
2024-10-26 14:43 UTC, muck-dart-strung
Details
emerge --info (emerge--info.txt,7.23 KB, text/plain)
2024-10-26 14:44 UTC, muck-dart-strung
Details
environment (environment,140.46 KB, text/plain)
2024-10-26 14:45 UTC, muck-dart-strung
Details
mangohud-9999 build log with clang (build.log,152.67 KB, text/x-log)
2024-10-26 15:58 UTC, muck-dart-strung
Details
emerge --info Duarte (emerge_info.txt,22.75 KB, text/plain)
2024-12-25 20:36 UTC, Gonçalo Negrier Duarte
Details
mangohud-build.log no lto (mangohud-build.log,162.87 KB, text/x-log)
2024-12-25 20:39 UTC, Gonçalo Negrier Duarte
Details

Note You need to log in before you can comment on or make changes to this bug.
Description muck-dart-strung 2024-10-26 14:43:14 UTC
Created attachment 906856 [details]
build.log

games-util/mangohud-0.7.2 (and 9999) fails to compile with undefined references to spdlog functions.

See the attachment for the build.log file output.
Comment 1 muck-dart-strung 2024-10-26 14:44:36 UTC
Created attachment 906857 [details]
emerge --info
Comment 2 muck-dart-strung 2024-10-26 14:45:04 UTC
Created attachment 906858 [details]
environment
Comment 3 Viorel Munteanu gentoo-dev 2024-10-26 15:41:13 UTC
Looks more like a problem on your side, can you try rebuilding spdlog with the same compiler?
Comment 4 muck-dart-strung 2024-10-26 15:58:42 UTC
Created attachment 906906 [details]
mangohud-9999 build log with clang

You're right. I had forgotten that I was building mangohud with gcc.
When compiling mangohud-0.7.2 with clang I get errors caused by it not finding std::map. This is a mangohud problem and has been fixed in feef6e3.
I tried using mangohud-9999 but I'm getting lld errors. I've attached the build log.
Comment 5 Adel KARA SLIMANE 2024-12-25 19:12:10 UTC
It's known that mangohud doesn't build with libc++ with LTO. I'll try to have a look if something can be done.
Comment 6 Gonçalo Negrier Duarte 2024-12-25 20:33:57 UTC
(In reply to Adel KARA SLIMANE from comment #5)
> It's known that mangohud doesn't build with libc++ with LTO. I'll try to
> have a look if something can be done.

I also give a check and 9999 dosent build on libc++ even without lto. 
About lto I think for now we can disable it at least for now! I not sure if also build fine on gcc systems.

I will provide the build.log without lto as well, just for record and see what I can do to solve the clang+libc++ problem.

Being frank I don't think there is a huge advantange in compiling mangohud with lto, now the libc++ problem need to be solve.
Comment 7 Gonçalo Negrier Duarte 2024-12-25 20:36:34 UTC
Created attachment 914867 [details]
emerge --info Duarte

Common Flags use to build Mangohud:
COMMON_FLAGS="-march=native -O3 -pipe -fdiagnostics-color=always -ftree-vectorize -fno-semantic-interposition"
Comment 8 Gonçalo Negrier Duarte 2024-12-25 20:39:09 UTC
Created attachment 914868 [details]
mangohud-build.log no lto
Comment 9 Adel KARA SLIMANE 2024-12-25 20:42:13 UTC
true that, it doesn't work with libc++ at all, there was a bug about this before and it got closed.

Still with this kind of errors
```
ld.lld: error: relocation R_X86_64_TPOFF32 against __cxxabiv1::(anonymous namespace)::__globals()::eh_globals cannot be used with -shared
```
Comment 10 Gonçalo Negrier Duarte 2024-12-25 21:29:08 UTC
(In reply to Adel KARA SLIMANE from comment #9)
> true that, it doesn't work with libc++ at all, there was a bug about this
> before and it got closed.
> 
> Still with this kind of errors
> ```
> ld.lld: error: relocation R_X86_64_TPOFF32 against __cxxabiv1::(anonymous
> namespace)::__globals()::eh_globals cannot be used with -shared
> ```

Maybe I close it by mistake don’t remeber but yes I being using gcc for a long time to compile it. Didn’t have time to look in to it, to be fair :(
Comment 11 Larry the Git Cow gentoo-dev 2024-12-26 15:36:03 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=46368c09827e0b556293650c447fdb9cc808ee57

commit 46368c09827e0b556293650c447fdb9cc808ee57
Author:     Gonçalo Negrier Duarte <gonegrier.duarte@gmail.com>
AuthorDate: 2024-12-25 20:53:15 +0000
Commit:     Gonçalo Negrier Duarte <gonegrier.duarte@gmail.com>
CommitDate: 2024-12-25 20:53:15 +0000

    games-util/mangohud: disable lto
    
    Bug: https://bugs.gentoo.org/942290
    Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte@gmail.com>

 games-util/mangohud/{mangohud-0.7.2.ebuild => mangohud-0.7.2-r1.ebuild} | 2 ++
 games-util/mangohud/mangohud-9999.ebuild                                | 2 ++
 2 files changed, 4 insertions(+)
Comment 12 Adel KARA SLIMANE 2024-12-28 03:43:08 UTC
parona took the matter at hand and got us a fix [1] :D

https://github.com/flightlessmango/MangoHud/pull/1513