From: Marc Dionne Date: Mon, 28 Jan 2013 01:52:39 +0000 (-0500) Subject: Linux: Detect undefined symbols in kernel modules X-Git-Tag: upstream/1.8.0_pre1^2~1563 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=dbdee60a83d72d38a04a0eeb2a5324cf497e57e3;p=packages%2Fo%2Fopenafs.git 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. Change-Id: I2c428a5ce7e3a0d10178679f789b3d787719c397 Reviewed-on: http://gerrit.openafs.org/8981 Tested-by: BuildBot Reviewed-by: Simon Wilkinson Reviewed-by: Derrick Brashear --- 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 ff56e5d41..7c22992f0 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 \ @@ -373,7 +375,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)