From cff3b5ddd1b92d769138ed97addb54602de3f540 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Sun, 27 Jan 2013 20:52:39 -0500 Subject: [PATCH] Linux: Detect undefined symbols in kernel modules Undefined symbols in the kernel modules are not currently detected at build time. As a result, buildbot may indicate success while the resulting kernel modules are unusable. In the kernel build process, modpost warns about missing symbols but does not return an error in the case of external modules. Detect these warnings and cause the libafs build to fail. Reviewed-on: http://gerrit.openafs.org/8981 Tested-by: BuildBot Reviewed-by: Simon Wilkinson Reviewed-by: Derrick Brashear (cherry picked from commit dbdee60a83d72d38a04a0eeb2a5324cf497e57e3) Change-Id: I1986dfd3c195be13b4014014b42eb745f9daf1f8 Reviewed-on: http://gerrit.openafs.org/9364 Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- src/libafs/.gitignore | 1 + src/libafs/MakefileProto.LINUX.in | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/libafs/.gitignore b/src/libafs/.gitignore index d87f88a21..225e979de 100644 --- a/src/libafs/.gitignore +++ b/src/libafs/.gitignore @@ -26,3 +26,4 @@ /rpc /sys /rx +/.makelog diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in index 63b2f3522..94493607d 100644 --- a/src/libafs/MakefileProto.LINUX.in +++ b/src/libafs/MakefileProto.LINUX.in @@ -19,6 +19,8 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ +AFS_OS_CLEAN = .makelog + # OS specific object files: AFS_OS_OBJS = \ osi_alloc.o \ @@ -338,7 +340,13 @@ ${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: ${LINUX_LIBAFS_NAME}.ko .FORCE: ${LINUX_LIBAFS_NAME}.ko afspag.ko: .FORCE env EXTRA_CFLAGS="${EXTRA_CFLAGS}" @TOP_SRCDIR@/libafs/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common - env EXTRA_CFLAGS="${EXTRA_CFLAGS}" $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules + env EXTRA_CFLAGS="${EXTRA_CFLAGS}" $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules 2>&1 | tee .makelog + @if [ `grep ^WARNING .makelog | wc -l` -ne 0 ]; then \ + echo Error: Undefined symbols in modules ; \ + rm .makelog \ + exit 1 ; \ + fi + rm .makelog ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS) -- 2.39.5