Skip to content

Commit

Permalink
Meta: Make check-symbols.sh use the correct build directory
Browse files Browse the repository at this point in the history
Since the build now happens in Build/$SERENITY_ARCH/ and not in Build/,
this updates check-symbols.sh to use the correct directory to check the
LibC symbols in. For some reason, the constant failures did not show
up as errors in CI.
  • Loading branch information
creator1creeper1 authored and linusg committed Jan 15, 2022
1 parent c6a0365 commit 7851151
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ jobs:
run: ccache -s
- name: Lint (Phase 2/2)
working-directory: ${{ github.workspace }}/Meta
env:
SERENITY_ARCH: ${{ matrix.arch }}
run: ./check-symbols.sh

- name: Create Serenity Rootfs
Expand Down
7 changes: 4 additions & 3 deletions Meta/check-symbols.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ cd "$script_path/.." || exit 1
# 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/Userland/Libraries/LibC/libc.a"
TARGET="${SERENITY_ARCH:-"i686"}"
LIBC_PATH="Build/${TARGET}/Userland/Libraries/LibC/libc.a"
for forbidden_symbol in $FORBIDDEN_SYMBOLS; do
# 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"
nm "$LIBC_PATH" | grep "U $forbidden_symbol"
APPEARS_AS_UNDEFINED=$?
nm $LIBC_PATH | grep "T $forbidden_symbol"
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"
Expand Down

0 comments on commit 7851151

Please sign in to comment.