[PATCH 2/3] [PATCH] param: Stop gcc from inlining empty weak functions

David Howells
2008-12-03T16:32:55Z

Stop gcc from inlining empty weak functions by making them non-empty. The gcc
I have for FRV (4.1.2) will inline empty weak functions that are in the same
file, even if those functions are marked 'noinline'.

Without this patch, the default arch_get_boot_command_line() is rolled into
start_kernel(), and the arch specific one is not called, thus making the
kernel unbootable.

Signed-off-by: David Howells <dhowells@redhat.com>
---

init/main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/init/main.c b/init/main.c
index 92ad2fe..665993b 100644
--- a/init/main.c
+++ b/init/main.c
@@ -522,15 +522,18 @@ static void __init boot_cpu_init(void)

void __init __weak smp_setup_processor_id(void)
{
+ barrier();
}

void __init __weak thread_info_cache_init(void)
{
+ barrier();
}

/* If the arch already sets boot_command_line, we need do nothing. */
void __init __weak arch_get_boot_command_line(void)
{
+ barrier();
}

/* Ideally, this would take a 'const char *cmdline' param. */