File ringrtc-rust-hidden-visibility.patch of Package nodejs-signal-ringrtc
Do not export internal FFI glue symbols from the final library, while making them still unmangled for the linker. See https://github.com/rust-lang/rust/issues/73958
This is likely not upstreamable due to depending on the details of the rustc linux port.
--- ringrtc-2.26.4/ringrtc/rust/src/webrtc/sdp_observer.rs.old 2023-05-04 16:59:55.000000000 +0000
+++ ringrtc-2.26.4/ringrtc/rust/src/webrtc/sdp_observer.rs 2023-05-11 16:58:02.388642500 +0000
@@ -445,6 +445,7 @@ impl CreateSessionDescriptionObserver {
/// CreateSessionDescription observer OnSuccess() callback.
#[no_mangle]
+#[rustc_std_internal_symbol]
#[allow(non_snake_case)]
extern "C" fn csd_observer_OnSuccess(
csd_observer: webrtc::ptr::Borrowed<CreateSessionDescriptionObserver>,
@@ -463,6 +464,7 @@ extern "C" fn csd_observer_OnSuccess(
/// CreateSessionDescription observer OnFailure() callback.
#[no_mangle]
+#[rustc_std_internal_symbol]
#[allow(non_snake_case)]
extern "C" fn csd_observer_OnFailure(
csd_observer: webrtc::ptr::Borrowed<CreateSessionDescriptionObserver>,
@@ -627,6 +629,7 @@ impl SetSessionDescriptionObserver {
/// SetSessionDescription observer OnSuccess() callback.
#[no_mangle]
+#[rustc_std_internal_symbol]
#[allow(non_snake_case)]
extern "C" fn ssd_observer_OnSuccess(
ssd_observer: webrtc::ptr::Borrowed<SetSessionDescriptionObserver>,
@@ -643,6 +646,7 @@ extern "C" fn ssd_observer_OnSuccess(
/// SetSessionDescription observer OnFailure() callback.
#[no_mangle]
+#[rustc_std_internal_symbol]
#[allow(non_snake_case)]
extern "C" fn ssd_observer_OnFailure(
ssd_observer: webrtc::ptr::Borrowed<SetSessionDescriptionObserver>,
--- ringrtc-2.26.4/ringrtc/rust/src/webrtc/stats_observer.rs.old 2023-05-04 16:59:55.000000000 +0000
+++ ringrtc-2.26.4/ringrtc/rust/src/webrtc/stats_observer.rs 2023-05-11 16:58:33.076220700 +0000
@@ -539,6 +539,7 @@ pub struct MediaStatistics {
/// StatsObserver OnStatsComplete() callback.
#[no_mangle]
+#[rustc_std_internal_symbol]
#[allow(non_snake_case)]
extern "C" fn stats_observer_OnStatsComplete(
stats_observer: webrtc::ptr::Borrowed<StatsObserver>,
--- ringrtc-2.26.4/ringrtc/rust/src/lib.rs.old 2023-05-04 16:59:55.000000000 +0000
+++ ringrtc-2.26.4/ringrtc/rust/src/lib.rs 2023-05-11 17:19:27.495828400 +0000
@@ -1,3 +1,4 @@
+#![feature(rustc_attrs)]
//
// Copyright 2019-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only