]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux: Detect undefined symbols in kernel modules
authorMarc Dionne <marc.c.dionne@gmail.com>
Mon, 28 Jan 2013 01:52:39 +0000 (20:52 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sat, 30 Mar 2013 15:15:54 +0000 (08:15 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit dbdee60a83d72d38a04a0eeb2a5324cf497e57e3)

Change-Id: I1986dfd3c195be13b4014014b42eb745f9daf1f8
Reviewed-on: http://gerrit.openafs.org/9364
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/libafs/.gitignore
src/libafs/MakefileProto.LINUX.in

index d87f88a216a10dbf959e41c154ae154aae276114..225e979de2930a233798a86fab3530572a651115 100644 (file)
@@ -26,3 +26,4 @@
 /rpc
 /sys
 /rx
+/.makelog
index 63b2f352273528bb19adcddd253a726378de741b..94493607d6789f758f0921f350fe4bc56ff30986 100644 (file)
@@ -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
 
 <all -linux26 -linux_26 -umlinux26>
 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)