From ab486e0b09a26a9f11e502cf3c86eccc75006a0b 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: (cherry picked from commit 528ceeb49b95b0797979c85b959fa543253fa0b3) --- .pick_status.json | 2 +- docs/relnotes/new_features.txt | 1 + src/gallium/targets/rusticl/meson.build | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index ba248dd653f..78403192db1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3204,7 +3204,7 @@ "description": "rusticl: link the C++ runtime statically", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index 4e4cda7ad09..f046e5c7196 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -52,3 +52,4 @@ multiDrawIndirect on pvr depthBiasClamp on pvr wideLines on pvr VK_EXT_rgba10x6_formats on panvk +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),