mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
Travis: Run script that checks for forbidden symbols in LibC
check-symbols.sh fails the build if undefined __cx_guard_* symbols are found in LibC. This will help us catch port breakage sooner.
This commit is contained in:
parent
542f665b27
commit
1c20e684f3
Notes:
sideshowbarker
2024-07-19 02:52:14 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/1c20e684f34 Pull-request: https://github.com/SerenityOS/serenity/pull/3414 Reviewed-by: https://github.com/BenWiederhake Reviewed-by: https://github.com/alimpfard
2 changed files with 22 additions and 0 deletions
|
@ -49,6 +49,7 @@ script:
|
|||
- cd Build
|
||||
- cmake .. -DBUILD_LAGOM=1 -DALL_THE_DEBUG_MACROS=1
|
||||
- make -j2
|
||||
- Meta/check-symbols.sh
|
||||
- CTEST_OUTPUT_ON_FAILURE=1 make test
|
||||
- cd Meta/Lagom
|
||||
- DISABLE_DBG_OUTPUT=1 ./test-js
|
||||
|
|
21
Meta/check-symbols.sh
Executable file
21
Meta/check-symbols.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||
cd "$script_path/.."
|
||||
|
||||
# The __cxa_guard_* calls are generated for (non trivial) initialzation of local static objects.
|
||||
# These symbols are OK to use within serenity code, but they are problematic in LibC because their
|
||||
# existence breaks ports (the implementation of these symbols resides in libstdc++.a which we do not link against in ports).
|
||||
# To eliminate the need for these symbols, avoid doing non-trivial construction of local statics in LibC.
|
||||
|
||||
FORBIDDEN_SYMBOLS="__cxa_guard_acquire __cxa_guard_release"
|
||||
LIBC_PATH="Build/Libraries/LibC/libc.a"
|
||||
for forbidden_symbol in $FORBIDDEN_SYMBOLS; do
|
||||
# check if symbol is undefined
|
||||
nm $LIBC_PATH | grep "U $forbidden_symbol"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Forbidden undefined symbol in LibC: $forbidden_symbol"
|
||||
echo "See comment in Meta/check-symbols.sh for more info"
|
||||
exit 1
|
||||
fi
|
||||
done
|
Loading…
Add table
Reference in a new issue