Skip to content

Commit

Permalink
module: zstd: check we don't leak symbols; regenerate symbol map
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12988
Closes openzfs#13209
(cherry picked from commit 6ef0019)
  • Loading branch information
nabijaczleweli authored and veggiemike committed May 15, 2022
1 parent 2a64eeb commit 15ae3af
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 209 deletions.
7 changes: 6 additions & 1 deletion Makefile.am
Expand Up @@ -103,7 +103,7 @@ endif
endif

PHONY += codecheck
codecheck: cstyle shellcheck checkbashisms flake8 mancheck testscheck vcscheck
codecheck: cstyle shellcheck checkbashisms flake8 mancheck testscheck vcscheck zstdcheck

PHONY += checkstyle
checkstyle: codecheck commitcheck
Expand All @@ -120,6 +120,7 @@ cstyle:
-o -type f -name '*.[hc]' \
! -name 'zfs_config.*' ! -name '*.mod.c' \
! -name 'opt_global.h' ! -name '*_if*.h' \
! -name 'zstd_compat_wrapper.h' \
! -path './module/zstd/lib/*' \
-exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+

Expand Down Expand Up @@ -173,6 +174,10 @@ vcscheck:
awk '{c++; print} END {if(c>0) exit 1}' ; \
fi

PHONY += zstdcheck
zstdcheck:
@$(MAKE) -C module/zstd checksymbols

PHONY += lint
lint: cppcheck paxcheck

Expand Down
6 changes: 6 additions & 0 deletions module/zstd/Makefile.in
Expand Up @@ -37,3 +37,9 @@ $(MODULE)-objs += zstd_sparc.o

all:
mkdir -p lib

gensymbols:
@OBJDUMP@ -t lib/zstd.o | awk '$$2 == "g" && !/ zfs_/ {print "#define\t" $$6 " zfs_" $$6}' | sort >> include/zstd_compat_wrapper.h

checksymbols:
@OBJDUMP@ -t lib/zstd.o | awk '/file format/ {print} $$2 == "g" && !/ zfs_/ {++ret; print} END {exit ret}'

0 comments on commit 15ae3af

Please sign in to comment.