aboutsummaryrefslogtreecommitdiff
path: root/repo/packages/s/sentry-native/patches/0.12.1/crashpad_static_libcxx.patch
diff options
context:
space:
mode:
Diffstat (limited to 'repo/packages/s/sentry-native/patches/0.12.1/crashpad_static_libcxx.patch')
-rw-r--r--repo/packages/s/sentry-native/patches/0.12.1/crashpad_static_libcxx.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/repo/packages/s/sentry-native/patches/0.12.1/crashpad_static_libcxx.patch b/repo/packages/s/sentry-native/patches/0.12.1/crashpad_static_libcxx.patch
new file mode 100644
index 000000000..2005ad4ec
--- /dev/null
+++ b/repo/packages/s/sentry-native/patches/0.12.1/crashpad_static_libcxx.patch
@@ -0,0 +1,24 @@
+--- a/external/crashpad/handler/CMakeLists.txt 2026-03-09 14:47:42.109197582 +0000
++++ b/external/crashpad/handler/CMakeLists.txt 2026-03-09 14:51:45.343538268 +0000
+@@ -120,6 +120,21 @@
+ endif()
+ endif()
+
++ if(LINUX)
++ # Statically link libc++ and libc++abi into crashpad_handler so it has
++ # no runtime dependency on libc++.so.1. This is needed when building with
++ # a toolchain that uses libc++ (e.g. UE clang) but deploys to systems
++ # where libc++.so.1 is not available.
++ # -nostdlib++ suppresses clang's automatic -lc++ addition (a linker flag,
++ # added at the end). The explicit -Bstatic libs are added via
++ # target_link_libraries so they appear after crashpad's static archives in
++ # the link order, letting the single-pass linker resolve all libc++ symbols.
++ target_link_options(crashpad_handler PRIVATE -nostdlib++)
++ target_link_libraries(crashpad_handler PRIVATE
++ -Wl,-Bstatic,-lc++,-lc++abi,-Bdynamic
++ )
++ endif()
++
+ set_property(TARGET crashpad_handler PROPERTY EXPORT_NAME crashpad_handler)
+ add_executable(crashpad::handler ALIAS crashpad_handler)
+