- 
                Notifications
    You must be signed in to change notification settings 
- Fork 361
Fix build issues for LLVM based toolchains. #1513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| 
 | 
| if is_libcxx | ||
| message('Detected libcxx, not appending -static-libstc++ to linker arguments') | ||
| else | ||
| link_args+=['-static-libstdc++'] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flightlessmango can't this be left for packagers / users to add with meson with -D cpp_link_args when/if needed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a case where its enabled by default and you have to disable it yourself for the cases where its not desirable (libcxx / no static libstdc++ available).
        
          
                src/meson.build
              
                Outdated
          
        
      | objects: mangohud_static_lib.extract_all_objects(), | ||
| link_with: mangohud_static_lib, | ||
| link_args : link_args, | ||
| link_args : [link_args, '-Wl,--version-script,@0@'.format(join_paths(meson.current_source_dir(), 'mangohud.version'))], | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a lot of duplication, should probably be a variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about how to do that nicer, I have unique files for all libs and mangohub_opengl uses a different directory as its generated at build time.
Could also break it into several lines like in the example given in this meson issue about improving mesons handling for these.
ae83e08    to
    6c6f4ea      
    Compare
  
    6c6f4ea    to
    c768be5      
    Compare
  
    LLD is stricter with version scripts and will complain about nonexisting symbols in version files. Bump meson reguirement due to use of compiler_args in preprocess. Signed-off-by: Alfred Wingate <parona@protonmail.com>
Clang has a long standing bug where it will try to mix c++ libraries instead of erroring out early or transparently linking against libcxx statically instead. Signed-off-by: Alfred Wingate <parona@protonmail.com>
LLVM alternative C++ standard library is happier if it can hide its own
symbols first without preprocessor macros complicating things.
FAILED: amdgpu.p/tests_test_amdgpu.cpp.o
clang++ -Iamdgpu.p -I. -I.. -I../include -I../subprojects/spdlog-1.14.1/include -Isubprojects/implot-0.16 -I../subprojects/implot-0.16 -Isubprojects/imgui-1.89.9 -I../subprojects/imgui-1.89.9 -I../subprojects/imgui-1.89.9/backends -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++14 -O3 -Werror=missing-declarations -Werror=return-type -Wno-unused-parameter -Qunused-arguments -fno-math-errno -fno-trapping-math -Wno-non-virtual-dtor -Wno-missing-field-initializers -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="v0.7.2"' -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG -D_GNU_SOURCE -DHAVE_PTHREAD -DUSE_GCC_ATOMIC_BUILTINS -DHAVE_TIMESPEC_GET -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -O2 -pipe '-DIMGUI_API=__attribute__((visibility("default")))' -pthread -DSPDLOG_COMPILED_LIB -DTEST_ONLY -MD -MQ amdgpu.p/tests_test_amdgpu.cpp.o -MF amdgpu.p/tests_test_amdgpu.cpp.o.d -o amdgpu.p/tests_test_amdgpu.cpp.o -c ../tests/test_amdgpu.cpp
In file included from ../tests/test_amdgpu.cpp:9:
In file included from ../tests/../src/amdgpu.h:6:
In file included from ../tests/../src/overlay_params.h:6:
In file included from /usr/include/c++/v1/vector:3023:
In file included from /usr/include/c++/v1/locale:212:
/usr/include/c++/v1/ios:343:30: error: expected parameter declarator
  343 |   _LIBCPP_HIDE_FROM_ABI bool fail() const;
      |                              ^
/usr/include/cmocka.h:1616:22: note: expanded from macro 'fail'
 1616 | #define fail() _fail(__FILE__, __LINE__)
      |                      ^
<scratch space>:2:1: note: expanded from here
    2 | "/usr/include/c++/v1/ios"
Signed-off-by: Alfred Wingate <parona@protonmail.com>
    Signed-off-by: Alfred Wingate <parona@protonmail.com>
This means you don't have to use explicit compiler_args for cpp.preprocess which then means the meson requirement can be lowered. Signed-off-by: Alfred Wingate <parona@protonmail.com>
c768be5    to
    0a23a14      
    Compare
  
    | Used the c preprocessor to preprocess the version file instead. Hopefully that is more appealing. | 
| @parona-source there is any change that needs to be done (besides the conflicts), because I been using this patch (with the following use flags (X dbus mangoapp mangohudctl wayland), without any problems. The verion I using is this one:  @AdelKS, might be a good ideia to solve the conflicts any apply this patch to mangohud ebuilds? Edit: Here is a rebased patch if anyone needs: rebased-1513-24d88a.patch | 
Keeping it a draft as this would in its current state break builds for Windows. I'm unsure what is the intent with mangohud_opengl and what symbols should be visible in it for Windows.With LLVM toolchain I mean clang as the compiler, lld is the linker and libcxx as the c++ stdlib.
I didn't touch mangohud_shim, but its visible symbols are shown as well. It could also be explicitly specified like mangohud_opengl.
Current HEAD built with GCC/ld.bfd