1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-22 18:55:29 +03:00
aports/community/olm/0001-only-export-olm-functions-to-avoid-colliding-with-ot.patch
Bobby The Builder 43199c290f community/olm: avoid function collisions
until a new tag/version is created upstream:
   https://github.com/matrix-org/olm/issues/47
2021-07-29 18:03:31 +00:00

40 lines
1.1 KiB
Diff

From 4b26af508480bc21222c7fa45dc557258fccfb29 Mon Sep 17 00:00:00 2001
From: Hubert Chathi <hubertc@matrix.org>
Date: Wed, 16 Jun 2021 15:05:19 -0400
Subject: [PATCH 1/2] only export olm functions to avoid colliding with other
libraries
---
CMakeLists.txt | 4 ++++
libolm.version | 4 ++++
2 files changed, 8 insertions(+)
create mode 100644 libolm.version
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dbe3b6a..0bd5ec8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,6 +48,10 @@ add_library(olm
lib/curve25519-donna/curve25519-donna.c)
add_library(Olm::Olm ALIAS olm)
+# restrict the exported symbols
+set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libolm.version)
+set_target_properties(olm PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libolm.version)
+
target_include_directories(olm
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
diff --git a/libolm.version b/libolm.version
new file mode 100644
index 0000000..f93b6f2
--- /dev/null
+++ b/libolm.version
@@ -0,0 +1,4 @@
+{
+ global: olm*; _olm*; megolm*; _ZN3olm*;
+ local: *;
+};
--
2.31.1