Skip to contentSkip to conversation

making ubifs compile with gcc-3.4

RFC PATCH Applied Hamish Moffatt 2 participants 2 messages May 2, 2008 – May 5, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 making ubifs compile with gcc-3.4

ubifs fails to compile with my gcc 3.4.4 (for arm), bombing with:

fs/built-in.o: In function `ubifs_create_dflt_lpt':
lpt_commit.c:(.text+0x88690): undefined reference to `__you_cannot_kmalloc_that_much' make[1]: *** [.tmp_vmlinux1] Error 1

It compiles with 4.1.2 ok though. Some web searches suggest that this is due to a compiler bug. Patches have been applied in other parts of the tree to work around this so perhaps you'll consider this patch for ubifs also.

I found that rearranging the kmalloc order makes it compile. I don't believe there is any effect on the behaviour.

--

fs/ubifs/lpt.c +1 -1
@@ -597,11 +597,11 @@
 	/* Needed by 'ubifs_pack_lsave()' */
 	c->main_first = c->leb_cnt - *main_lebs;
 
+	lsave = kmalloc(sizeof(int) * c->lsave_cnt, GFP_KERNEL);
 	pnode = kzalloc(sizeof(struct ubifs_pnode), GFP_KERNEL);
 	nnode = kzalloc(sizeof(struct ubifs_nnode), GFP_KERNEL);
 	buf = vmalloc(c->leb_size);
 	ltab = vmalloc(sizeof(struct ubifs_lpt_lprops) * c->lpt_lebs);
-	lsave = kmalloc(sizeof(int) * c->lsave_cnt, GFP_KERNEL);
 	if (!pnode || !nnode || !buf || !ltab || !lsave) {
 		err = -ENOMEM;
 		goto out;
Signature · 1 line
Hamish Moffatt VK3SB <[email protected]> <[email protected]>
#1 lore raw
Quoted 11 lines · Hamish Moffatt

ubifs fails to compile with my gcc 3.4.4 (for arm), bombing with:

fs/built-in.o: In function `ubifs_create_dflt_lpt':
lpt_commit.c:(.text+0x88690): undefined reference to `__you_cannot_kmalloc_that_much' make[1]: *** [.tmp_vmlinux1] Error 1

It compiles with 4.1.2 ok though. Some web searches suggest that this is due to a compiler bug. Patches have been applied in other parts of the tree to work around this so perhaps you'll consider this patch for ubifs also.

Quoted 4 lines

I found that rearranging the kmalloc order makes it compile. I don't believe there is any effect on the behaviour.

Applied, thank you.

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)