-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Promote build_target linker to C++ if linking to C++ libraries #1653
Comments
…brary This exercises a regression where the C rather than C++ linker is chosen, resulting in symbol errors. Test for mesonbuild#1653
I've sent a pull request. Interestingly the test passes on 0.39.1, but not against master, so I think this is actually a regression. |
@nirbheek I bisected this down to this commit from you:
|
Right, I thought that might be responsible for this. We traded one regression for another regression. :) |
Sometimes you want to link to a C++ library that exports C API, which means the linker must link in the C++ stdlib, and we must use a C++ compiler for linking. The same is also applicable for objc/objc++ etc, so we can keep using clike_langs for the priority order. Closes mesonbuild#1653
To see the planning fallacy in action, see how often I add and then remove the "easy" tag on bugs. |
Since this is a regression this should get fixed before the next release, correct? |
…brary This exercises a regression where the C rather than C++ linker is chosen, resulting in symbol errors. Test for mesonbuild#1653
Sometimes you want to link to a C++ library that exports C API, which means the linker must link in the C++ stdlib, and we must use a C++ compiler for linking. The same is also applicable for objc/objc++ etc, so we can keep using clike_langs for the priority order. Closes mesonbuild#1653
Hmm true, I thought we released 0.39.1 with that regression, but it seems I broke it after the last release. So we should indeed fix this before release. |
…brary This exercises a regression where the C rather than C++ linker is chosen, resulting in symbol errors. Test for mesonbuild#1653
…brary This exercises a regression where the C rather than C++ linker is chosen, resulting in symbol errors. Test for mesonbuild#1653
Sometimes you want to link to a C++ library that exports C API, which means the linker must link in the C++ stdlib, and we must use a C++ compiler for linking. The same is also applicable for objc/objc++ etc, so we can keep using clike_langs for the priority order. Closes mesonbuild#1653
@nirbheek How do you detect if linking to a C++ lib? For example in VLC we have the following case: the vulkan module links with libplacebo, libplacebo itself is a C library and uses glslang which is a C++ library. This breaks with autotools when statically linked glslang + libplacebo is linked into the shared vulkan module. Can meson somehow detect this case? Or will I need the |
This only works with internal libraries, basically it says "liba was compiled and linked with c++, so libb which link_with's liba also needs to be c++". This internal logic is why I wan't to put the |
Any update on this? It's a problematic issue for my VLC port and so far I just use a dummy-meson.cpp which is very ugly. |
Sometimes people link to C++ libraries that export C APIs, but still link to libstdc++. For example: https://bugzilla.gnome.org/show_bug.cgi?id=781561
Need a test case from @dcbaker for this, and then it can be fixed by adding a special case in
build.py:BuildTarget.get_clike_dynamic_linker()
.The text was updated successfully, but these errors were encountered: