You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`libSystem.Security.Cryptography.Native.Android.a` contains the `JNI_OnLoad` function
4
+
which initializes the whole crypto support library, but we can't use it as it would
5
+
conflict with our own. Potential solution is to modify the above library's source code
6
+
to add an init function that we will call from our own `JNI_OnLoad` and make the library's
7
+
init function do the same. The `JNI_OnLoad` object file would have to be omitted from the
8
+
library's `.a`
9
+
*`p/invoke usage`.
10
+
Currently, all the BCL archives (with exception of the above crypto one) are
11
+
linked into the unified runtime using `--whole-archive` - that is, they become part of the
12
+
runtime in their entirety. This is wasteful, but necessary, so that `p/invokes` into those
13
+
libraries work correctly. Instead, we should scan the application DLLs for p/invokes from
14
+
those libraries and generate code to reference the required functions, so that the linker
15
+
can do its job and remove code not used by the application. Likely needed is a linker step.
16
+
*`p/invoke` handling mechanism. Right now, we `dlopen` the relevant `.so` library and look
17
+
up the required symbol in there. With the unified runtime the `.so` disappears, so we either
18
+
need to look it up in our own library or, better, call the function directly. The latter is
19
+
a bit more complicated to implement but would give us much faster code, thus it's the preferred
20
+
solution.
21
+
22
+
# Ideas
23
+
24
+
* Use [mold](https://github.com/rui314/mold) which has recently been re-licensed under `MIT/X11`
25
+
(and contains components licensed under a mixture of `BSD*` and `Apache 2.0` licenses), so we
26
+
can easily redistribute it instead of the LLVM's `lld`. The advantage is `mold`'s [speed](https://github.com/rui314/mold?tab=readme-ov-file#mold-a-modern-linker)
0 commit comments