diff --git a/.github/checks/Makefile b/.github/checks/Makefile index ee373d53d..7fc51d8d4 100644 --- a/.github/checks/Makefile +++ b/.github/checks/Makefile @@ -40,4 +40,7 @@ sorted: sorted.sh sorted_codeopt.sh sorted_opcodes.sh @./sorted_codeopt.sh @./sorted_opcodes.sh +checksp: checksp.sh + @./checksp.sh + endif diff --git a/.github/checks/checksp.sh b/.github/checks/checksp.sh new file mode 100755 index 000000000..f70d92e25 --- /dev/null +++ b/.github/checks/checksp.sh @@ -0,0 +1,22 @@ +#! /bin/bash +OD65_EXE=../bin/od65 +CHECK_PATH=../../libwrk + +cd "${CHECK_PATH}" || { + echo "error: Directory ${CHECK_PATH} doesn't seem to exist" >&2 + exit 1 +} + +[ -x "${OD65_EXE}" ] || { + echo "error: This check requires the od65 executable to be built" >&2 + exit 1 +} + +EXITCODE=0 +find . -name \*.o -print | while read OBJ; do + "${OD65_EXE}" --dump-imports "${OBJ}" | grep -q "\"sp\"" && { + echo "error: Usage of symbol 'sp' found in module ${OBJ}" >&2 + EXITCODE=1 + } +done +exit ${EXITCODE} diff --git a/.github/workflows/build-on-pull-request.yml b/.github/workflows/build-on-pull-request.yml index af79733cf..b577e4b03 100644 --- a/.github/workflows/build-on-pull-request.yml +++ b/.github/workflows/build-on-pull-request.yml @@ -39,6 +39,9 @@ jobs: - name: Build the platform libraries. shell: bash run: make -j2 lib QUIET=1 + - name: check test that no modules use sp + shell: bash + run: make -j2 checksp QUIET=1 - name: Run the regression tests. shell: bash run: make -j2 test QUIET=1 diff --git a/Makefile b/Makefile index 13e965c9e..21c1b3208 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,10 @@ checkstyle: sorted: @$(MAKE) -C .github/checks --no-print-directory $@ +# check that no modules use "sp", requires the binaries to be built first +checksp: + @$(MAKE) -C .github/checks --no-print-directory $@ + # runs regression tests, requires libtest target libraries test: @$(MAKE) -C test --no-print-directory $@