-
I tested the FFI examples with the dynamic library Q1) Q2) Q3) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The only difference between the staticlib and the cdylib is that one is for static linking and the other one is for dynamic linking. The cdylib has ABI stability, so you can swap in an ICU4X update in the future and callers should continue to work without having to be re-compiled. With the static lib, you need to re-compile the callers, but the advantage is that you only ship what you use. The way to get the smallest code sizes is to static-link ICU4X and run it through LTO. You should also build ICU4X with panic=abort for additional savings. See here for an example of the size-optimized ICU4X build over FFI: https://github.com/unicode-org/icu4x/tree/main/ffi/diplomat/c/examples/fixeddecimal_tiny It's also fine to ship a |
Beta Was this translation helpful? Give feedback.
The only difference between the staticlib and the cdylib is that one is for static linking and the other one is for dynamic linking. The cdylib has ABI stability, so you can swap in an ICU4X update in the future and callers should continue to work without having to be re-compiled. With the static lib, you need to re-compile the callers, but the advantage is that you only ship what you use.
The way to get the smallest code sizes is to static-link ICU4X and run it through LTO. You should also build ICU4X with panic=abort for additional savings. See here for an example of the size-optimized ICU4X build over FFI:
https://github.com/unicode-org/icu4x/tree/main/ffi/diplomat/c/examples/fixeddeci…