mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] Force build error on undefined symbols
Date: Sat, 10 Apr 2004 16:24:01 +0200	[thread overview]
Message-ID: <20040410142401.GA2439@mars.ravnborg.org> (raw)
In-Reply-To: <20040410131028.A4221@flint.arm.linux.org.uk>

> 
> 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 \

  reply	other threads:[~2004-04-10 14:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-10 12:10 Russell King
2004-04-10 14:24 ` Sam Ravnborg [this message]
2004-04-10 14:35   ` Russell King
2004-04-10 17:28     ` Sam Ravnborg
2004-04-10 19:08       ` Russell King
2004-04-10 19:33 ` Brian Gerst
2004-04-10 20:19   ` Russell King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040410142401.GA2439@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®