Skip to content

Commit 25d242e

Browse files
committed
Add a comment
1 parent d84e9b9 commit 25d242e

File tree

1 file changed

+14
-0
lines changed
  • src/native/libs/System.Security.Cryptography.Native.Android

1 file changed

+14
-0
lines changed

src/native/libs/System.Security.Cryptography.Native.Android/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ add_library(System.Security.Cryptography.Native.Android-Static
4242
${NATIVECRYPTO_SOURCES}
4343
)
4444

45+
#
46+
# This is necessary so that dynamic linking of the .NET for Android runtime
47+
# can hide all the other symbols in System.Security.Cryptography.Native.Android.
48+
#
49+
# .NET for Android dynamic runtime linking links all the relevant native BCL
50+
# libraries into a single .so, using the .a archives built here. clang allows
51+
# hiding all the symbols in the .a archive, but there's no (working) way to
52+
# exclude just select symbols from hiding.
53+
#
54+
# Java VM requires that all the functions implementing the `native` methods are
55+
# exported from the shared libraries they are implemented in. Therefore it is
56+
# necessary to put this symbol in a separate .a archive so that we can exclude it
57+
# from hiding described above.
58+
#
4559
add_library(System.Security.Cryptography.Native.Android-StaticJNIExport
4660
STATIC
4761
pal_trust_manager_jni_export.c

0 commit comments

Comments
 (0)