2001-02-12 20:24:30

by Carlos Carvalho

[permalink] [raw]
Subject: 2.2.19pre10 doesn't compile on alphas (sunrpc)

When doing the final ld .... -o vmlinux on an alpha the linker
complains:

net/network.a(sunrpc.o): In function `xprt_ping_reserve':
sunrpc.o(.text+0x4b94): undefined reference to `BUG'
sunrpc.o(.text+0x4b98): undefined reference to `BUG'

Looks like a problem in Trond's patches, also it doesn't happen with
pre9. It links in intel machines. I didn't reboot to test yet...


2001-02-12 21:49:54

by Alan

[permalink] [raw]
Subject: Re: 2.2.19pre10 doesn't compile on alphas (sunrpc)

> net/network.a(sunrpc.o): In function `xprt_ping_reserve':
> sunrpc.o(.text+0x4b94): undefined reference to `BUG'
> sunrpc.o(.text+0x4b98): undefined reference to `BUG'
>
> Looks like a problem in Trond's patches, also it doesn't happen with
> pre9. It links in intel machines. I didn't reboot to test yet...

The ideal solution would be for someone to provide BUG() on the Alpha platform
as in 2.4. That would sort things cleanly

2001-02-12 22:09:14

by Carlos Carvalho

[permalink] [raw]
Subject: Re: 2.2.19pre10 doesn't compile on alphas (sunrpc)

Alan Cox ([email protected]) wrote on 12 February 2001 21:49:
>The ideal solution would be for someone to provide BUG() on the
>Alpha platform as in 2.4. That would sort things cleanly

Hmm... Looks more difficult than I expected. Can we just change the
one call to BUG to something sensible on alphas? I'm really eager to
run this kernel..

2001-02-12 22:13:44

by Alan

[permalink] [raw]
Subject: Re: 2.2.19pre10 doesn't compile on alphas (sunrpc)

> Hmm... Looks more difficult than I expected. Can we just change the
> one call to BUG to something sensible on alphas? I'm really eager to
> run this kernel..

The 'something sensible' is what you need to define BUG() to be, so its no
harder to do it right IMHO

I suspect adding

#define BUG() __asm__ __volatile__("call_pal 129 # bugchk")

to include/asm-alpha/page.h will do the right thing, since it works on 2.4



2001-02-12 22:37:48

by David Miller

[permalink] [raw]
Subject: Re: 2.2.19pre10 doesn't compile on alphas (sunrpc)


Alan Cox writes:
> I suspect adding
>
> #define BUG() __asm__ __volatile__("call_pal 129 # bugchk")
>
> to include/asm-alpha/page.h will do the right thing, since it works on 2.4

You have to add a few bits to arch/alpha/kernel/traps.c
I could be wrong though...

Later,
David S. Miller
[email protected]

2001-02-13 09:58:39

by Trond Myklebust

[permalink] [raw]
Subject: Re: 2.2.19pre10 doesn't compile on alphas (sunrpc)

>>>>> " " == Alan Cox <[email protected]> writes:

>> net/network.a(sunrpc.o): In function `xprt_ping_reserve':
>> sunrpc.o(.text+0x4b94): undefined reference to `BUG'
>> sunrpc.o(.text+0x4b98): undefined reference to `BUG'
>>
>> Looks like a problem in Trond's patches, also it doesn't happen
>> with pre9. It links in intel machines. I didn't reboot to test
>> yet...

> The ideal solution would be for someone to provide BUG() on the
> Alpha platform as in 2.4. That would sort things cleanly

Actually, since BUG() only seems to be defined on i386 platforms for
2.2.x, perhaps the easiest thing to do (unless somebody wants to
volunteer to backport all the `safe' definitions from 2.4.x) would be
to add the generic `*(int *)0 = 0' definition for local use by ping()
itself.

Cheers,
Trond

--- net/sunrpc/ping.c.orig Tue Feb 13 10:47:20 2001
+++ net/sunrpc/ping.c Tue Feb 13 10:50:03 2001
@@ -25,6 +25,10 @@
# define RPCDBG_FACILITY RPCDBG_XPRT
#endif

+#ifndef BUG
+#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0)
+#endif
+
static void ping_call_reserve(struct rpc_task *);
static void ping_call_allocate(struct rpc_task *);
static void ping_call_encode(struct rpc_task *);

2001-02-13 10:17:42

by Carlos Carvalho

[permalink] [raw]
Subject: Re: 2.2.19pre10 doesn't compile on alphas (sunrpc)

Trond Myklebust ([email protected]) wrote on 13 February 2001 10:56:
>Actually, since BUG() only seems to be defined on i386 platforms for
>2.2.x, perhaps the easiest thing to do (unless somebody wants to
>volunteer to backport all the `safe' definitions from 2.4.x) would be
>to add the generic `*(int *)0 = 0' definition for local use by ping()
>itself.

Yes, this is what I wanted, something just enough to catch the bug and
run 2.2.19 until we can use 2.4. Thanks.

2001-02-13 10:34:24

by Carlos Carvalho

[permalink] [raw]
Subject: Re: 2.2.19pre10 doesn't compile on alphas (sunrpc)

Trond Myklebust ([email protected]) wrote on 13 February 2001 10:56:
>--- net/sunrpc/ping.c.orig Tue Feb 13 10:47:20 2001
>+++ net/sunrpc/ping.c Tue Feb 13 10:50:03 2001
******

Oops, the BUG() call appears in xprt.c! Here's a patch that makes it
compile. Let's see if it runs...

--- linux/net/sunrpc/xprt.c.orig Tue Feb 13 08:30:20 2001
+++ linux/net/sunrpc/xprt.c Tue Feb 13 08:29:43 2001
@@ -81,6 +81,10 @@
# define MIN(a, b) ((a) < (b)? (a) : (b))
#endif

+#ifndef BUG
+#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0)
+#endif
+
/*
* Local functions
*/

2001-02-13 11:28:37

by Alan

[permalink] [raw]
Subject: Re: 2.2.19pre10 doesn't compile on alphas (sunrpc)

> volunteer to backport all the `safe' definitions from 2.4.x) would be
> to add the generic `*(int *)0 = 0' definition for local use by ping()
> itself.

*(int *)0 doesnt work for all ports either

I'd rather let people suffer a little and fix BUG 8)

2001-02-14 02:31:39

by Richard Henderson

[permalink] [raw]
Subject: Re: 2.2.19pre10 doesn't compile on alphas (sunrpc)

On Mon, Feb 12, 2001 at 02:33:17PM -0800, David S. Miller wrote:
> You have to add a few bits to arch/alpha/kernel/traps.c
> I could be wrong though...

Only to make the oops look pretty. Something like

die_if_kernel((type == 1 ? "Kernel Bug" : "Instruction fault"),
&regs, type, 0);

Don't have a 2.2 tree handy to look at the moment...


r~