serenity/Userland
Timothy Flynn 3fd53baa25 LibUnicode: Dynamically load the generated UnicodeData symbols
The generated data for libunicodedata.so is quite large, and loading it
is a price paid by nearly every application by way of depending on
LibRegex. In order to defer this cost until an application actually uses
one of the surrounding APIs, dynamically load the generated symbols.

To be able to load the symbols dynamically, the generated methods must
have demangled names. Typically, this is accomplished with `extern "C"`
blocks. The clang toolchain complains about this here because the types
returned from the generators are strictly C++ types. So to demangle the
names, we use the asm() compiler directive to manually define a symbol
name; the caveat is that we *must* be sure the symbols are unique. As an
extra precaution, we prefix each symbol name with "unicode_". For more
details, see: https://gcc.gnu.org/onlinedocs/gcc/Asm-Labels.html

This symbol loader used in this implementation provides the additional
benefit of removing many [[maybe_unused]] attributes from the LibUnicode
methods. Internally, if ENABLE_UNICODE_DATABASE_DOWNLOAD is OFF, the
loader is able to stub out the function pointers it returns.

Note that as of this commit, LibUnicode is still directly linked against
LibUnicodeData. This commit is just a first step towards removing that.
2021-12-21 13:09:49 -08:00
..
Applets ClipboardHistory: Convert to try_create_default_icon 2021-12-18 23:36:59 +01:00
Applications Userland: Add unveil/pledge requisites for dynamic Unicode data loading 2021-12-21 13:09:49 -08:00
Demos WidgetGallery: Convert to try_create_default_icon 2021-12-18 23:36:59 +01:00
DevTools Profiler: Display tooltip when hovering over flamegraph bars 2021-12-20 11:31:47 +01:00
DynamicLoader
Games Solitaire: Convert to try_create_default_icon 2021-12-18 23:36:59 +01:00
Libraries LibUnicode: Dynamically load the generated UnicodeData symbols 2021-12-21 13:09:49 -08:00
Services Userland: Add unveil/pledge requisites for dynamic Unicode data loading 2021-12-21 13:09:49 -08:00
Shell Shell: Don't skip over the first brace expansion entry if it's empty 2021-12-16 03:26:59 +03:30
Utilities Userland: Add unveil/pledge requisites for dynamic Unicode data loading 2021-12-21 13:09:49 -08:00
CMakeLists.txt