Re: Linux 2.6.24-rc7 Build-Failure at __you_cannot_kmalloc_that_much

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jean Delvare
Date: Tuesday, January 8, 2008 - 2:56 am

Hi Andrew, hi Chritoph,

On Mon, 7 Jan 2008 11:38:31 -0800, Andrew Morton wrote:

Interesting theory... So I tried to split half of the code of
dmi_id_init() to a subfunction and bingo! gcc 3.2.3 is now able to
build it properly. Thanks for the hint!


Here's a workaround for dmi-id.

Subject: Fix for __you_cannot_kmalloc_that_much failure in dmi-id

gcc 3.2 has a hard time coping with the code in dmi_id_init():

drivers/built-in.o(.init.text+0x789e): In function `dmi_id_init':
: undefined reference to `__you_cannot_kmalloc_that_much'
make: *** [.tmp_vmlinux1] Error 1

Moving half of the code to a separate function seems to help. This is
a no-op for gcc 4.1 which will successfully inline the code anyway.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
 drivers/firmware/dmi-id.c |   19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

--- linux-2.6.24-rc7.orig/drivers/firmware/dmi-id.c	2007-10-24 09:59:28.000000000 +0200
+++ linux-2.6.24-rc7/drivers/firmware/dmi-id.c	2008-01-08 10:32:00.000000000 +0100
@@ -175,12 +175,11 @@ static struct device *dmi_dev;
 
 extern int dmi_available;
 
-static int __init dmi_id_init(void)
+/* In a separate function to keep gcc 3.2 happy - do NOT merge this in
+   dmi_id_init! */
+static void __init dmi_id_init_attr_table(void)
 {
-	int ret, i;
-
-	if (!dmi_available)
-		return -ENODEV;
+	int i;
 
 	/* Not necessarily all DMI fields are available on all
 	 * systems, hence let's built an attribute table of just
@@ -205,6 +204,16 @@ static int __init dmi_id_init(void)
 	ADD_DMI_ATTR(chassis_serial,    DMI_CHASSIS_SERIAL);
 	ADD_DMI_ATTR(chassis_asset_tag, DMI_CHASSIS_ASSET_TAG);
 	sys_dmi_attributes[i++] = &sys_dmi_modalias_attr.attr;
+}
+
+static int __init dmi_id_init(void)
+{
+	int ret;
+
+	if (!dmi_available)
+		return -ENODEV;
+
+	dmi_id_init_attr_table();
 
 	ret = class_register(&dmi_class);
 	if (ret)

I'll now check if I can do something similar for snd-mixer-oss.

-- 
Jean Delvare
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.24-rc7, Linus Torvalds, (Sun Jan 6, 3:19 pm)
Re: Linux 2.6.24-rc7, Mark Lord, (Sun Jan 6, 4:52 pm)
Re: Linux 2.6.24-rc7, Linus Torvalds, (Sun Jan 6, 5:08 pm)
Re: Linux 2.6.24-rc7, Tejun Heo, (Sun Jan 6, 5:35 pm)
Re: Linux 2.6.24-rc7 Build Failure on headers_install, Kamalesh Babulal, (Mon Jan 7, 1:48 am)
Re: Linux 2.6.24-rc7 Build Failure on headers_install, Sam Ravnborg, (Mon Jan 7, 3:12 am)
Re: Linux 2.6.24-rc7 kernel BUG at kernel/sched.c:5156!, Kamalesh Babulal, (Mon Jan 7, 5:13 am)
Re: Linux 2.6.24-rc7, Alejandro Riveira , (Mon Jan 7, 8:53 am)
Re: Linux 2.6.24-rc7, Alejandro Riveira , (Mon Jan 7, 9:14 am)
Re: Linux 2.6.24-rc7, Michael Buesch, (Mon Jan 7, 9:24 am)
smpboot_64 section mismatch warning, Sam Ravnborg, (Mon Jan 7, 9:27 am)
Re: Linux 2.6.24-rc7, Michael Buesch, (Mon Jan 7, 10:30 am)
Re: Linux 2.6.24-rc7 Build-Failure at __you_cannot_kmalloc ..., Christoph Lameter, (Mon Jan 7, 11:31 am)
Re: Linux 2.6.24-rc7, Alejandro Riveira , (Mon Jan 7, 1:23 pm)
Re: smpboot_64 section mismatch warning, David Howells, (Mon Jan 7, 4:27 pm)
Re: Linux 2.6.24-rc7, J.A. , (Mon Jan 7, 5:50 pm)
Re: Linux 2.6.24-rc7 Build-Failure at __you_cannot_kmalloc ..., Christoph Lameter, (Mon Jan 7, 10:23 pm)
Re: smpboot_64 section mismatch warning, Alejandro Riveira , (Tue Jan 8, 2:14 am)
Re: Linux 2.6.24-rc7 Build-Failure at __you_cannot_kmalloc ..., Jean Delvare, (Tue Jan 8, 2:56 am)
Re: Linux 2.6.24-rc7 Build Failure on headers_install, Kamalesh Babulal, (Tue Jan 8, 3:51 am)
Re: smpboot_64 section mismatch warning, David Howells, (Tue Jan 8, 4:17 am)
Re: Linux 2.6.24-rc7, Michael Buesch, (Tue Jan 8, 8:30 am)
Re: Linux 2.6.24-rc7, Alejandro Riveira , (Tue Jan 8, 8:55 am)
Re: Linux 2.6.24-rc7, Willy Tarreau, (Tue Jan 8, 6:17 pm)
Re: Linux 2.6.24-rc7, Avuton Olrich, (Tue Jan 8, 6:32 pm)
Re: Linux 2.6.24-rc7, Tejun Heo, (Tue Jan 8, 6:56 pm)
Re: Linux 2.6.24-rc7, Tejun Heo, (Thu Jan 10, 6:10 am)
Re: Linux 2.6.24-rc7, J.A. , (Sun Jan 13, 4:19 pm)
Re: Linux 2.6.24-rc7, Tejun Heo, (Sun Jan 13, 4:57 pm)
Re: Linux 2.6.24-rc7, J.A. , (Mon Jan 14, 4:38 pm)
Re: Linux 2.6.24-rc7, Tejun Heo, (Mon Jan 14, 4:56 pm)
Re: section mismatch warning in head_64.S, Alejandro Riveira , (Tue Jan 15, 3:18 am)