CI: Don't fail check-symbols if symbol is defiend somewhere else

This commit is contained in:
Itamar 2021-03-17 23:23:13 +02:00 committed by Andreas Kling
parent ae67cabe11
commit 4cb38f6dd8
Notes: sideshowbarker 2024-07-18 21:13:56 +09:00

View file

@ -11,8 +11,12 @@ cd "$script_path/.." || exit 1
FORBIDDEN_SYMBOLS="__cxa_guard_acquire __cxa_guard_release"
LIBC_PATH="Build/Userland/Libraries/LibC/libc.a"
for forbidden_symbol in $FORBIDDEN_SYMBOLS; do
# check if symbol is undefined
if nm $LIBC_PATH | grep "U $forbidden_symbol" ; then
# check if there's an undefined reference to the symbol & it is not defined anywhere else in the library
nm $LIBC_PATH | grep "U $forbidden_symbol"
APPEARS_AS_UNDEFINED=$?
nm $LIBC_PATH | grep "T $forbidden_symbol"
APPEARS_AS_DEFINED=$?
if [ $APPEARS_AS_UNDEFINED -eq 0 ] && [ ! $APPEARS_AS_DEFINED -eq 0 ]; then
echo "Forbidden undefined symbol in LibC: $forbidden_symbol"
echo "See comment in Meta/check-symbols.sh for more info"
exit 1