public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>,
	mmarek@suse.cz, Sam Ravnborg <sam@ravnborg.org>,
	Michael Holzheu <holzheu@linux.vnet.ibm.com>,
	tabbott@ksplice.com, vda.linux@googlemail.com,
	hpa@linux.intel.com, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, heiko.carstens@de.ibm.com,
	schwidefsky@de.ibm.com
Subject: [PATCH] initramfs: Fix build break on symbol-prefixed archs
Date: Tue, 19 Oct 2010 13:08:03 +0200	[thread overview]
Message-ID: <20101019110801.GA4128@linux.vnet.ibm.com> (raw)
In-Reply-To: <AANLkTikKJ25L=6b2resz+0SAg7ZYL5j=rHG7Lg4kFbwd@mail.gmail.com>

Hi Mike,

On Mon, Oct 18, 2010 at 07:07:13PM -0400, Mike Frysinger wrote:
> On Mon, Oct 18, 2010 at 06:37, Hendrik Brueckner wrote:
> > On Sun, Oct 17, 2010 at 02:28:11PM -0400, Mike Frysinger wrote:
> >> On Tue, Aug 31, 2010 at 04:23, Hendrik Brueckner wrote:
> >> i'm pretty sure this breaks on every symbol-prefixed arch.  at least,
> >> it broke every Blackfin board:
> >> init/built-in.o: In function `populate_rootfs':
> >> init/initramfs.c:(.init.text+0x2548): undefined reference to `__initramfs_size'
> >> init/initramfs.c:(.init.text+0x254e): undefined reference to `__initramfs_size'
> >> make: *** [.tmp_vmlinux1] Error 1
> >>
> negative.  same error.  vmlinux.lds.h might need to be switched to
> CONFIG_SYMBOL_PREFIX.

In my previous patch I missed a change regarding the SYMBOL_PREFIX symbol.
The SYMBOL_PREFIX symbol, which is used by VMLINUX_SYMBOL, is derived
from the CONFIG_SYMBOL_PREFIX and must be defined in the Makefile.

Below you can find the updated patch which worked for my blackfin test build.

Thanks and kind regards,
  Hendrik

--- 8< -----------------------
Define the __initramfs_size variable using VMLINUX_SYMBOL() to take
care of symbol-prefixed architectures, for example, blackfin.

Depending on the CONFIG_SYMBOL_PREFIX configuration option, define
the SYMBOL_PREFIX symbol which is evaluated by VMLINUX_SYMBOL().

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
---
 usr/Makefile         |    3 +++
 usr/initramfs_data.S |    5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)

--- a/usr/Makefile
+++ b/usr/Makefile
@@ -19,6 +19,9 @@ suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZ
 suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZO)   = .lzo
 
 AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)"
+ifdef CONFIG_SYMBOL_PREFIX
+AFLAGS_initramfs_data.o += -DSYMBOL_PREFIX=$(patsubst "%",%,$(CONFIG_SYMBOL_PREFIX))
+endif
 
 # Generate builtin.o based on initramfs_data.o
 obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o
--- a/usr/initramfs_data.S
+++ b/usr/initramfs_data.S
@@ -22,14 +22,15 @@
 */
 
 #include <linux/stringify.h>
+#include <asm-generic/vmlinux.lds.h>
 
 .section .init.ramfs,"a"
 __irf_start:
 .incbin __stringify(INITRAMFS_IMAGE)
 __irf_end:
 .section .init.ramfs.info,"a"
-.globl __initramfs_size
-__initramfs_size:
+.globl VMLINUX_SYMBOL(__initramfs_size)
+VMLINUX_SYMBOL(__initramfs_size):
 #ifdef CONFIG_32BIT
 	.long __irf_end - __irf_start
 #else

  reply	other threads:[~2010-10-19 11:08 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31  8:23 [PATCH 0/2] initramfs: Cleanup and fix initramfs size calculation Hendrik Brueckner
2010-08-31  8:23 ` [PATCH 1/2] initramfs: Generalize initramfs_data.xxx.S variants Hendrik Brueckner
2010-08-31  8:23 ` [PATCH 2/2] initramfs: Fix initramfs size calculation Hendrik Brueckner
2010-09-01  7:47   ` Américo Wang
2010-10-17 18:28   ` Mike Frysinger
2010-10-18 10:37     ` Hendrik Brueckner
2010-10-18 23:07       ` Mike Frysinger
2010-10-19 11:08         ` Hendrik Brueckner [this message]
2010-10-19 20:11           ` [PATCH] initramfs: Fix build break on symbol-prefixed archs Mike Frysinger
2010-10-19 21:31             ` Sam Ravnborg
2010-10-19 21:39               ` Mike Frysinger
2010-10-27 18:23                 ` Mike Frysinger
2010-10-27 22:46                   ` Michal Marek
2010-10-27 23:10                     ` Mike Frysinger
2010-10-27 23:33                       ` Michal Marek
2010-10-27 23:58                         ` Mike Frysinger
2010-10-28 12:08                           ` Michal Marek
2010-10-28 19:46                             ` Mike Frysinger
2010-10-28 19:51                               ` Mike Frysinger
2010-10-28 20:35                     ` Sam Ravnborg
2010-10-28 20:42                       ` Mike Frysinger
2010-10-28 20:53                         ` Mike Frysinger
2010-10-29  6:12                         ` Sam Ravnborg
2010-10-28 21:19                       ` Michal Marek
2010-11-13 23:17                         ` Mike Frysinger
2010-11-24  8:40                           ` Mike Frysinger
2010-11-29 22:38                             ` Andrew Morton
2010-11-29 23:29                               ` Mike Frysinger
2010-11-30 15:36                                 ` Michal Marek
2010-12-02  4:12                                   ` Mike Frysinger
2010-08-31 14:08 ` [PATCH 0/2] initramfs: Cleanup and fix initramfs size calculation Michal Marek
2010-09-07 21:25   ` H. Peter Anvin

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=20101019110801.GA4128@linux.vnet.ibm.com \
    --to=brueckner@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=holzheu@linux.vnet.ibm.com \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=sam@ravnborg.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=tabbott@ksplice.com \
    --cc=vapier.adi@gmail.com \
    --cc=vda.linux@googlemail.com \
    /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