Re: [RFC] Force build error on undefined symbols
From: Sam Ravnborg
Date: Sat Apr 10 2004 - 09:19:35 EST
>
> Therefore, I propose the following patch to detect undefined symbols
> in the final image and force an error if this is the case.
>
> Comments?
Do we really want to do this for all architectures?
You could use something like the attached to restrict it to arm.
Sam
--- v2.6/arch/arm/Makefile 2004-04-05 23:23:54.000000000 +0200
+++ mm4/arch/arm/Makefile 2004-04-10 16:21:29.000000000 +0200
@@ -140,14 +143,19 @@
maketools: include/asm-arm/constants.h include/linux/version.h FORCE
$(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h
+check-undefsyms = $(NM) $^ | egrep -q '^ +U ' && { echo "Link failed: undefined symbols found in $^:"; $(NM) $^ | egrep '^ +U '; rm -f $^; exit 1; } || : endef
+
# Convert bzImage to zImage
bzImage: vmlinux
+ $(check-undefsyms)
$(Q)$(MAKE) $(build)=$(boot) $(boot)/zImage
zImage Image bootpImage uImage: vmlinux
+ $(check-undefsyms)
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
zinstall install: vmlinux
+ $(check-undefsyms)
$(Q)$(MAKE) $(build)=$(boot) $@
CLEAN_FILES += include/asm-arm/constants.h* include/asm-arm/mach-types.h \
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/