Open AdelKS opened 6 months ago
Try just commenting out version-script
or maybe add -Wl,--undefined-version
[1]
Yeah both suggestions work ! Is there a way to make the symbols visible to the linker though ?
I see that hook_dlsym.cpp
is part of the input sources, and it should define the symbol :thinking: Or maybe I am misunderstanding everything here
mangohud_dlsym = shared_library(
'MangoHud_dlsym',
files(
'elfhacks.cpp',
'real_dlsym.cpp',
'hook_dlsym.cpp',
),
c_args : [
pre_args,
],
cpp_args : [
pre_args,
],
gnu_symbol_visibility : 'hidden',
dependencies : [dep_dl],
include_directories : [inc_common],
link_args : link_args,
link_with: mangohud_static_lib,
install_dir : libdir_mangohud,
install : true
)
Ah okay, I think I am on the right path, I should be able to figure it out
Okay, I am not acquainted enough with the code base to understand what's the intent behind the use of the version script and I've never heard of it before x)
This is something that fixes the build issue: basically not use the version script linker arguments for the shared libraries MangoHud
, MangoHud_opengl
and MangoHud_dlsym
diff --git a/src/meson.build b/src/meson.build
index c776ca3..d53c132 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -159,9 +159,9 @@ if is_unixy
endif
endif
-link_args = cc.get_supported_link_arguments(['-Wl,-Bsymbolic-functions', '-Wl,-z,relro', '-Wl,--exclude-libs,ALL', '-lGL', '-static-libstdc++'])
+base_link_args = cc.get_supported_link_arguments(['-Wl,-Bsymbolic-functions', '-Wl,-z,relro', '-Wl,--exclude-libs,ALL', '-lGL', '-static-libstdc++'])
# meson fails to check version-script so just force add
-link_args += '-Wl,--version-script,@0@'.format(join_paths(meson.current_source_dir(), 'mangohud.version'))
+link_args = base_link_args + '-Wl,--version-script,@0@'.format(join_paths(meson.current_source_dir(), 'mangohud.version'))
mangohud_static_lib = static_library(
'MangoHud',
@@ -203,7 +203,7 @@ mangohud_shared_lib = shared_library(
'MangoHud',
objects: mangohud_static_lib.extract_all_objects(),
link_with: mangohud_static_lib,
- link_args : link_args,
+ link_args : base_link_args,
install_dir : libdir_mangohud,
install: true
)
@@ -236,7 +236,7 @@ mangohud_opengl_shared_lib = shared_library(
json_dep,
implot_dep],
include_directories : [inc_common],
- link_args : link_args,
+ link_args : base_link_args,
link_with: mangohud_static_lib,
install_dir : libdir_mangohud,
install: true
@@ -259,7 +259,7 @@ if is_unixy
gnu_symbol_visibility : 'hidden',
dependencies : [dep_dl],
include_directories : [inc_common],
- link_args : link_args,
+ link_args : base_link_args,
link_with: mangohud_static_lib,
install_dir : libdir_mangohud,
install : true
Not sure what potential consequences this would have, does it build fine with gcc and mingw still?
does it build fine with gcc and mingw still
Not on LLVM toolchain systems (LLVM Gentoo; haven't tried mingw because I've never messed with it before but I have tried GCC) but I haven't tried this patch, either, for a similar reason as you. (Also haven't personally tried the patch because the Gentoo GURU/community ebuild for it busted anyway)
It builds fine with GCC yeah, Mingw never tried, but since it's GCC it should be fine.
Also haven't personally tried the patch because the Gentoo GURU/community ebuild for it busted anyway
@ThisNekoGuy I don't think it's busted, try again please.
(Also haven't personally tried the patch because the Gentoo GURU/community ebuild for it busted anyway)
Like I said, I would but can't because the only means of doing so for my distro right now is barely maintained.
Edit: Ignore that, that link was a case of user-error; recompiling yields these errors: emerge_mangohud-guru_LLVM-build.log
../mangohud-9999/src/hud_elements.h:147:14: error: no template named 'map' in namespace 'std'; did you mean 'max'?
@ThisNekoGuy something is definitely wrong with your build environment if STL classes cannot be found
Here's my build log without the patch
Here's the the log with the patch
@AdelKS Don't know how you can tell me its the build environment exactly if there's not much I can actually be doing to change how it behaves besides using Gentoo-provided toolchain USE
flags to cause that result. The only difference I can imagine that would be causing this is that you're using libstdc++
which on LLVM profiles I think is still the default(? for some reason on LLVM profiles) when actually going fully LLVM would mean using libc++
(the default-libcxx
use flag).
EDIT:
Actually, yes, that's exactly what the issue is; found this in your log: -static-libstdc++
Okay I understand better now, you are trying to build with libc++
, this bug report is specifically without using libc++
which is another beast. I tried building with libc++
and I get the same errors as you.
Hello,
When building with
clang
+lld
linking issues arisewe get these kind of linking errors
All these errors seem to come from mangohud.version
I will try to look into it more, the git blame seems to says that @jackun could be the right person to ask
I tried to bisect but I couldn't find a commit that builds without issues for the past several versions.