From 528ceeb49b95b0797979c85b959fa543253fa0b3 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sat, 18 Apr 2026 02:27:20 +0200 Subject: [PATCH] rusticl: link the C++ runtime statically Apparently some applications don't have their C++ situation under control. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/14090 Part-of: --- docs/relnotes/new_features.txt | 1 + src/gallium/targets/rusticl/meson.build | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index be49dc47efb..284487bea3a 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -7,3 +7,4 @@ protectedMemory support on RADV/GFX10+ and VEGA10 VK_KHR_performance_query on RADV/GFX11 VK_EXT_conservative_rasterization on panvk shaderImageGatherExtended on pvr +static C++ stdlib required on rusticl to workaround applications using their own C++ stdlib diff --git a/src/gallium/targets/rusticl/meson.build b/src/gallium/targets/rusticl/meson.build index 2b214adbbf5..d4a24fd8585 100644 --- a/src/gallium/targets/rusticl/meson.build +++ b/src/gallium/targets/rusticl/meson.build @@ -52,6 +52,12 @@ librusticl = shared_library( ld_args_gc_sections, ld_args_bsymbolic, rusticl_ld_args, + # Seems like some proprietary apps ship libraries exporting C++ STL symbols. + # So let's just link statically against the standard C++ library then in order to prevent data + # layout mismatches and the likes. + cc.get_supported_link_arguments( + '-static-libstdc++', + ), ], link_depends : rusticl_ld_depends, version : '@0@.0.0'.format(opencl_version),