mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 12:23:15 +00:00
Toolchain: Introduce stubs for core system libraries
This allows the linker to link against these dynamic libraries when compiling libc++/libunwind, without having to do a separate bootstrapping LibC build. Without this change, libc++ would fail to pick up the need to link to `LibPthread` if no prior builds of it existed. Because of this, we'd immediately have an assertion failure in SystemServer, as mutexes are used for the safe construction of function-local static variables.
This commit is contained in:
parent
95c32fdf19
commit
c524f58290
21
Toolchain/Stubs/README.md
Normal file
21
Toolchain/Stubs/README.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Library stubs
|
||||
|
||||
This directory contains stubs for SerenityOS libraries (LibC, LibM, LibDl, LibPthread)
|
||||
that are referenced from the LLVM runtime libraries. These are needed by the linker
|
||||
in order to add the required `DT_NEEDED` entries.
|
||||
|
||||
## Do these need to be updated?
|
||||
|
||||
Generally, no. LLVM does not use the header files to decide which functionality it can
|
||||
use. After adding a new function to a header, you don't have to worry about LLVM
|
||||
toolchain builds failing because the symbol is not present in the stubs.
|
||||
|
||||
## How to generate these?
|
||||
|
||||
First, you need to have a working SerenityOS installation that's been built by the
|
||||
Clang toolchain. Then, using the `llvm-ifs` tool, these libraries need to be converted
|
||||
into a stripped-down stub form. To do that, run the following command:
|
||||
|
||||
```sh
|
||||
Toolchain/Local/clang/bin/llvm-ifs --output-format=ELF --output=<path-to-stub> <path-to-original>
|
||||
```
|
BIN
Toolchain/Stubs/i686clang/libc.so
Normal file
BIN
Toolchain/Stubs/i686clang/libc.so
Normal file
Binary file not shown.
BIN
Toolchain/Stubs/i686clang/libdl.so
Normal file
BIN
Toolchain/Stubs/i686clang/libdl.so
Normal file
Binary file not shown.
BIN
Toolchain/Stubs/i686clang/libm.so
Normal file
BIN
Toolchain/Stubs/i686clang/libm.so
Normal file
Binary file not shown.
BIN
Toolchain/Stubs/i686clang/libpthread.so
Normal file
BIN
Toolchain/Stubs/i686clang/libpthread.so
Normal file
Binary file not shown.
BIN
Toolchain/Stubs/x86_64clang/libc.so
Normal file
BIN
Toolchain/Stubs/x86_64clang/libc.so
Normal file
Binary file not shown.
BIN
Toolchain/Stubs/x86_64clang/libdl.so
Normal file
BIN
Toolchain/Stubs/x86_64clang/libdl.so
Normal file
Binary file not shown.
BIN
Toolchain/Stubs/x86_64clang/libm.so
Normal file
BIN
Toolchain/Stubs/x86_64clang/libm.so
Normal file
Binary file not shown.
BIN
Toolchain/Stubs/x86_64clang/libpthread.so
Normal file
BIN
Toolchain/Stubs/x86_64clang/libpthread.so
Normal file
Binary file not shown.
Loading…
Reference in a new issue