ladybird/Meta
Daniel Bertalan c0cf6e3744 CMake: Set -fvisibility-inlines-hidden on ELF platforms
The C++ semantics of `inline` dictate that such functions might be
defined in multiple translation units. As with all other functions, they
must have the same address in all TUs. Because of this, the compiler
emits `inline` functions as weak symbols, which the dynamic linker can
then resolve to the same address everywhere.

This rule is responsible for a significant overhead at startup, as such
lookups happen by name. Namely, 86'000 of the 114'000 by-name symbol
lookups when loading LibWeb can be attributed to this. Most of these
are only ever defined in a single object, making this even more
pointless.

As nothing in our code relies on either ELF symbol interposition rules
or function address equality, we can use the -fvisibility-inlines-hidden
escape hatch, which causes this rule to be disregarded. As the symbols
are now hidden, no load-time symbol lookup is needed. This flag is used
without issues in other large C++ codebases like Chromium and LLVM.

Some relevant light reading, suggested by Nico:
- https://ridiculousfish.com/blog/posts/i-didnt-order-that-so-why-is-it-on-my-bill-episode-1.html
- https://www.cs.dartmouth.edu/~sergey/cs258/ABI/UlrichDrepper-How-To-Write-Shared-Libraries.pdf
- https://blog.llvm.org/2018/11/30-faster-windows-builds-with-clang-cl_14.html
- https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-fvisibility-inlines-hidden
2023-08-12 05:14:20 +02:00
..
Azure Meta: Promote SERENITY_CACHE_DIR to a real option 2023-08-10 20:10:05 -06:00
CMake CMake: Set -fvisibility-inlines-hidden on ELF platforms 2023-08-12 05:14:20 +02:00
gn Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
HeaderCheck HeaderCheck: Also check AK for broken headers 2022-09-18 13:27:24 -04:00
Lagom Meta+Userland: Allow generating C++ initializer code from GML 2023-08-11 21:33:48 +02:00
Screenshots README+Meta: Update the screenshot :^) 2023-07-14 23:40:58 +02:00
ShellCompletions/zsh Meta/ShellCompletions: Use standard Serenity comment style 2023-05-17 12:55:15 +02:00
Websites Everywhere: Use title case for man section titles 2022-02-25 12:06:31 -05:00
analyze-qemu-coverage.sh Meta: Use absolute paths in Meta/analyze-qemu-coverage.sh 2022-12-10 11:51:16 +00:00
bochsrc Meta: Add SSE3, SMAP and SMEP to our bochsrc 2021-12-28 11:51:50 +01:00
build-image-extlinux.sh Meta: Pass -- to sudo instead of '$SHELL -c' in build scripts 2023-07-16 16:28:18 +01:00
build-image-grub.sh Meta: Pass -- to sudo instead of '$SHELL -c' in build scripts 2023-07-16 16:28:18 +01:00
build-image-limine.sh Meta: Pass -- to sudo instead of '$SHELL -c' in build scripts 2023-07-16 16:28:18 +01:00
build-image-qemu.sh Meta: Pass -- to sudo instead of '$SHELL -c' in build scripts 2023-07-16 16:28:18 +01:00
build-manpages-website.sh Meta/build-manpages-website: Copy all manpage PNGs 2023-01-08 13:35:29 +01:00
build-native-partition.sh Meta: Pass -- to sudo instead of '$SHELL -c' in build scripts 2023-07-16 16:28:18 +01:00
build-root-filesystem.sh Utilities: Add basic Package manager skeleton utility 2023-08-07 13:24:25 -06:00
check-ak-test-files.sh Meta: Fix check for AK test inclusion 2022-09-13 08:29:09 +00:00
check-debug-flags.sh Meta: Remove unused debug flags, add missing GENERATE_DEBUG 2023-05-14 16:01:57 -06:00
check-emoji.py Meta: Disallow emoji images with invalid code points in their file name 2022-10-26 18:40:20 +01:00
check-markdown.sh markdown-check: Allow generating a manpage link graph 2023-07-05 16:15:42 +01:00
check-newlines-at-eof.py Meta: Don't check for newlines at EOF in Tests/LibWeb/Layout/ 2023-03-11 13:05:35 +01:00
check-png-sizes.sh Meta: Add a PNG size check to CI and pre-commit checks 2022-06-18 21:58:43 +04:30
check-style.py Everywhere: Remove exceptions for using #include <LibC/...> 2023-06-27 12:40:38 +02:00
check-symbols.sh Meta: Make x86-64 target the default 2022-10-03 11:14:53 +02:00
convert-markdown-links.lua Meta/build-manpages-website: Use absolute paths for all links 2023-01-08 13:35:29 +01:00
debug-kernel.sh Revert "Kernel/x86: Bake the Prekernel and the Kernel into one image" 2023-04-28 23:24:19 +02:00
export-argsparser-manpages.sh CI: Ensure the manpage generation step shuts down the VM on failure 2022-10-31 22:10:14 +00:00
extlinux.conf Everywhere: Get rid of the fbdev kernel boot argument remainders 2022-08-14 01:03:23 +01:00
generate-embedded-resource-assembly.sh Meta: Get building on NixOS (#5005) 2021-01-22 17:44:05 +01:00
generate-libwasm-spec-test.py Meta: Use is instead of == to compare types 2023-07-29 23:23:25 +01:00
generate-libwasm-spec-test.sh Meta: Run the Wasm spec tests in CI 2021-05-27 17:28:41 +04:30
grub-ebr.cfg Meta: Use correct boot device selections when using GRUB images 2022-09-02 23:36:08 +01:00
grub-gpt.cfg Meta: Use correct boot device selections when using GRUB images 2022-09-02 23:36:08 +01:00
grub-mbr.cfg Meta: Use correct boot device selections when using GRUB images 2022-09-02 23:36:08 +01:00
install-ports-tree.sh Everywhere: Replace SERENITY_ROOT with SERENITY_SOURCE_DIR 2021-04-20 15:27:52 +02:00
label-pull-requests.js CI: Automatically apply pull request labels for generic PR actions 2023-01-06 15:25:30 +01:00
limine.cfg Everywhere: Get rid of the fbdev kernel boot argument remainders 2022-08-14 01:03:23 +01:00
lint-ci.sh Meta+Utilities: Make pre-commit checks significantly less verbose 2023-07-26 06:21:39 -04:00
lint-clang-format.sh Meta: Switch to clang-format-16 as the standard formatter 2023-07-08 10:32:56 +01:00
lint-commit.sh CI: Add a check to report git merge commit 2022-12-10 12:07:06 +00:00
lint-executable-resources.sh Meta: Add special case for macOS 2021-11-02 12:23:30 +01:00
lint-gml-format.sh Meta+Lagom: Enable CMAKE_BUILD_WITH_INSTALL_RPATH 2023-06-08 17:59:53 +02:00
lint-gn.sh Meta: Add gn linter 2023-07-13 14:07:25 -06:00
lint-keymaps.py Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
lint-ports.py Meta: Dont finish lines with only one character in lint-ports.py 2023-07-18 00:17:34 +02:00
lint-prettier.sh LibJS: Implement ImportCall and HostImportModuleDynamically 2022-01-22 01:21:18 +00:00
lint-python.sh Meta: Get building on NixOS (#5005) 2021-01-22 17:44:05 +01:00
lint-shell-scripts.sh Meta: Allow shellcheck to search sourced files in the script directory 2022-10-16 23:39:45 +02:00
new-project.sh Meta: Add new-project.sh :^) 2021-08-13 21:12:17 +04:30
refresh-serenity-qtcreator.sh Meta: Make *.in files accessible to QtCreator 2023-05-14 16:01:57 -06:00
run.sh Meta: Re-add boot drive to aarch64 run configuration 2023-06-08 14:43:14 +02:00
serenity.sh Meta: Update path to ladybird in gdb invocation 2023-07-02 18:43:46 +02:00
serenity_gdb.py Meta: Pretty-print strings in gdb as a single object, not by character 2023-08-05 02:16:55 +03:30
shell_include.sh Meta: Improve build compatibility with non-GNU userspaces 2023-07-09 06:16:31 +01:00
text-to-cpp-string.sh Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
toot-commits.js CI: Add script to post mastodon toots for commits on master 2023-02-10 13:54:07 +00:00
tweet-commits.js Meta: Ensure long messages fit in commit tweet 2021-06-18 13:34:17 +01:00