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

From: David Howells
Date: Wed Dec 03 2008 - 11:32:56 EST


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@xxxxxxxxxx>
---

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. */

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