Skip to contentSkip to conversation

gcc confused about static inline. - route.c

DISCUSSION cliff white 3 participants 5 messages Mar 28, 2005

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

Building the gkernel bits, have this error:

net/ipv4/route.c: In function `rt_remove_balanced_route':
net/ipv4/route.c:151: sorry, unimplemented: inlining failed in call to 'compare_keys': function body not available net/ipv4/route.c:540: sorry, unimplemented: called from here

route.c has this define at line 151
:
static inline int compare_keys(struct flowi *fl1, struct flowi *fl2);

function body is defined starting at line 861.

We are using gcc 3.4.2 right now, is there a way to fix this? thanks
cliffw

Signature · 2 lines
"Ive always gone through periods where I bolt upright at four in the morning; 
now at least theres a reason." -Michael Feldman
#1 lore raw
Quoted 11 lines · cliff white

Building the gkernel bits, have this error:

net/ipv4/route.c: In function `rt_remove_balanced_route':
net/ipv4/route.c:151: sorry, unimplemented: inlining failed in call to 'compare_keys': function body not available net/ipv4/route.c:540: sorry, unimplemented: called from here

route.c has this define at line 151
:
static inline int compare_keys(struct flowi *fl1, struct flowi *fl2);

Quoted 5 lines

function body is defined starting at line 861.

We are using gcc 3.4.2 right now, is there a way to fix this? thanks
cliffw

Shuffling the order of the functions fixed this for me.

Dave

net/ipv4/route.c renamed from net/ipv4/route.c~ +7 -7
diff -urNp --exclude-from=/home/davej/.exclude linux-10001/init/Makefile linux-10002/init/Makefile
@@ -520,6 +520,13 @@ static inline u32 rt_score(struct rtable
 	return score;
 }
 
+static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
+{
+	return memcmp(&fl1->nl_u.ip4_u, &fl2->nl_u.ip4_u, sizeof(fl1->nl_u.ip4_u)) == 0 &&
+	       fl1->oif     == fl2->oif &&
+	       fl1->iif     == fl2->iif;
+}
+
 #ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
 static struct rtable **rt_remove_balanced_route(struct rtable **chain_head,
 						struct rtable *expentry,
@@ -858,13 +865,6 @@ work_done:
 out:	return 0;
 }
 
-static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
-{
-	return memcmp(&fl1->nl_u.ip4_u, &fl2->nl_u.ip4_u, sizeof(fl1->nl_u.ip4_u)) == 0 &&
-	       fl1->oif     == fl2->oif &&
-	       fl1->iif     == fl2->iif;
-}
-
 static int rt_intern_hash(unsigned hash, struct rtable *rt, struct rtable **rp)
 {
 	struct rtable	*rth, **rthp;
#2 lore raw
In reply to Dave Jones
Quoted 12 lines · On Mon, 28 Mar 2005 16:41:03 -0500 Dave Jones <[email protected]> wrote:
Quoted 11 lines · cliff white

Building the gkernel bits, have this error:

net/ipv4/route.c: In function `rt_remove_balanced_route':
net/ipv4/route.c:151: sorry, unimplemented: inlining failed in call to 'compare_keys': function body not available net/ipv4/route.c:540: sorry, unimplemented: called from here

route.c has this define at line 151
:
static inline int compare_keys(struct flowi *fl1, struct flowi *fl2);

Quoted 9 lines
Quoted 5 lines

function body is defined starting at line 861.

We are using gcc 3.4.2 right now, is there a way to fix this? thanks
cliffw

Shuffling the order of the functions fixed this for me.

Thanks, that looked like the answer, but i wanted to ask anyway... cliffw

Quoted 36 lines

Dave

diff -urNp --exclude-from=/home/davej/.exclude linux-10001/init/Makefile linux-10002/init/Makefile

net/ipv4/route.c renamed from net/ipv4/route.c~ +7 -7
@@ -520,6 +520,13 @@ static inline u32 rt_score(struct rtable
 	return score;
 }
 
+static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
+{
+	return memcmp(&fl1->nl_u.ip4_u, &fl2->nl_u.ip4_u, sizeof(fl1->nl_u.ip4_u)) == 0 &&
+	       fl1->oif     == fl2->oif &&
+	       fl1->iif     == fl2->iif;
+}
+
 #ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
 static struct rtable **rt_remove_balanced_route(struct rtable **chain_head,
 						struct rtable *expentry,
@@ -858,13 +865,6 @@ work_done:
 out:	return 0;
 }
 
-static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
-{
-	return memcmp(&fl1->nl_u.ip4_u, &fl2->nl_u.ip4_u, sizeof(fl1->nl_u.ip4_u)) == 0 &&
-	       fl1->oif     == fl2->oif &&
-	       fl1->iif     == fl2->iif;
-}
-
 static int rt_intern_hash(unsigned hash, struct rtable *rt, struct rtable **rp)
 {
 	struct rtable	*rth, **rthp;
Signature · 2 lines
"Ive always gone through periods where I bolt upright at four in the morning; 
now at least theres a reason." -Michael Feldman
#4 lore raw
In reply to Francois Romieu
Quoted 6 lines · On Mon, 28 Mar 2005 23:53:37 +0200 Francois Romieu <[email protected]> wrote:

cliff white <[email protected]> :
[...]

Quoted 1 line

We are using gcc 3.4.2 right now, is there a way to fix this?

http://marc.theaimsgroup.com/?l=bk-commits-head&m=111188776823016&w=2

Whumps.
Thanks, i missed this email.
Didn't know it was already fixed.
cliffw

Quoted 3 lines

--
Ueimor

Signature · 2 lines
"Ive always gone through periods where I bolt upright at four in the morning; 
now at least theres a reason." -Michael Feldman