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
  • Loading branch information
nabijaczleweli authored and andrewc12 committed Sep 23, 2022
1 parent 73f86e1 commit b63e3bb
Show file tree
Hide file tree
Showing 3 changed files with 284 additions and 325 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 @@ -125,6 +125,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/*' \
! -path './include/sys/lua/*' \
! -path './module/lua/l*.[ch]' \
Expand Down Expand Up @@ -164,6 +165,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
5 changes: 5 additions & 0 deletions module/zstd/Makefile.in
Expand Up @@ -62,3 +62,8 @@ $(MODULE)-objs += $(vanilla-objs)
all:
mkdir -p lib/common lib/compress lib/decompress

gensymbols:
for obj in $(vanilla-objs); do echo; echo "/* $$obj: */"; @OBJDUMP@ -t $$obj | awk '$$2 == "g" && !/ zfs_/ {print "#define\t" $$6 " zfs_" $$6}' | sort; done >> include/zstd_compat_wrapper.h

checksymbols:
@OBJDUMP@ -t $(vanilla-objs) | awk '/file format/ {print} $$2 == "g" && !/ zfs_/ {++ret; print} END {exit ret}'

0 comments on commit b63e3bb

Please sign in to comment.