mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][2.6.12-rc1-mm1] fix ppc64 linkage error on G5
@ 2005-03-21 15:19 Mikael Pettersson
  2005-03-21 16:32 ` [PATCH] ppc64: fix " Anton Blanchard
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Pettersson @ 2005-03-21 15:19 UTC (permalink / raw)
  To: akpm, paulus; +Cc: linux-kernel, linuxppc64-dev

When 2.6.12-rc1-mm1 is configured for a ppc64/G5, so CONFIG_PPC_PSERIES
is disabled, linking of vmlinux fails with:

arch/ppc64/kernel/built-in.o(.text+0x7de0): In function `.sys_call_table32':
: undefined reference to `.ppc_rtas'
arch/ppc64/kernel/built-in.o(.text+0x8668): In function `.sys_call_table':
: undefined reference to `.ppc_rtas'
make: *** [.tmp_vmlinux1] Error 1

This is because 2.6.12-rc1-mm1 contains the apparently broken patch:

>--- linux-2.6.12-rc1/arch/ppc64/kernel/misc.S   2005-03-17 21:43:54.000000000 -0800
>+++ 25/arch/ppc64/kernel/misc.S 2005-03-21 01:07:42.000000000 -0800
>@@ -680,7 +680,7 @@ _GLOBAL(kernel_thread)
>        ld      r30,-16(r1)
>        blr
> 
>-#ifndef CONFIG_PPC_PSERIES     /* hack hack hack */
>+#ifdef CONFIG_PPC_RTAS /* hack hack hack */
> #define ppc_rtas       sys_ni_syscall
> #endif

PPC_PSERIES implies PPC_RTAS. It seems someone tried to clean up the
condition but accidentally negated it: on PSERIES the system call will
now go to sys_ni_syscall, and on !PSERIES linking will fail.

Fix: negate the condition.

Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se>

--- linux-2.6.12-rc1-mm1/arch/ppc64/kernel/misc.S.~1~	2005-03-21 14:48:51.000000000 +0100
+++ linux-2.6.12-rc1-mm1/arch/ppc64/kernel/misc.S	2005-03-21 15:22:04.000000000 +0100
@@ -680,7 +680,7 @@ _GLOBAL(kernel_thread)
 	ld	r30,-16(r1)
 	blr
 
-#ifdef CONFIG_PPC_RTAS /* hack hack hack */
+#ifndef CONFIG_PPC_RTAS /* hack hack hack */
 #define ppc_rtas	sys_ni_syscall
 #endif
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] ppc64: fix linkage error on G5
  2005-03-21 15:19 [PATCH][2.6.12-rc1-mm1] fix ppc64 linkage error on G5 Mikael Pettersson
@ 2005-03-21 16:32 ` Anton Blanchard
  0 siblings, 0 replies; 3+ messages in thread
From: Anton Blanchard @ 2005-03-21 16:32 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: akpm, paulus, linux-kernel, linuxppc64-dev


> When 2.6.12-rc1-mm1 is configured for a ppc64/G5, so CONFIG_PPC_PSERIES
> is disabled, linking of vmlinux fails with:
> 
> arch/ppc64/kernel/built-in.o(.text+0x7de0): In function `.sys_call_table32':
> : undefined reference to `.ppc_rtas'
> arch/ppc64/kernel/built-in.o(.text+0x8668): In function `.sys_call_table':
> : undefined reference to `.ppc_rtas'
> make: *** [.tmp_vmlinux1] Error 1

It turns out we are trying to fix this problem twice, we may as well
remove the #define hack and use cond_syscall.

--

Move the ppc64 specific cond_syscall(ppc_rtas) into sys_ni.c so that it
takes effect. With this fixed we can remove the #define hack.

Signed-off-by: Anton Blanchard <anton@samba.org>

diff -puN arch/ppc64/kernel/misc.S~fix_ppc_rtas arch/ppc64/kernel/misc.S
--- foobar2/arch/ppc64/kernel/misc.S~fix_ppc_rtas	2005-03-22 02:41:53.819634410 +1100
+++ foobar2-anton/arch/ppc64/kernel/misc.S	2005-03-22 02:41:53.851631972 +1100
@@ -680,10 +680,6 @@ _GLOBAL(kernel_thread)
 	ld	r30,-16(r1)
 	blr
 
-#ifdef CONFIG_PPC_RTAS /* hack hack hack */
-#define ppc_rtas	sys_ni_syscall
-#endif
-
 /* Why isn't this a) automatic, b) written in 'C'? */	
 	.balign 8
 _GLOBAL(sys_call_table32)
diff -puN arch/ppc64/kernel/syscalls.c~fix_ppc_rtas arch/ppc64/kernel/syscalls.c
--- foobar2/arch/ppc64/kernel/syscalls.c~fix_ppc_rtas	2005-03-22 02:41:53.825633952 +1100
+++ foobar2-anton/arch/ppc64/kernel/syscalls.c	2005-03-22 02:41:53.852631895 +1100
@@ -256,6 +256,3 @@ void do_show_syscall_exit(unsigned long 
 {
 	printk(" -> %lx, current=%p cpu=%d\n", r3, current, smp_processor_id());
 }
-
-/* Only exists on P-series. */
-cond_syscall(ppc_rtas);
diff -puN kernel/sys_ni.c~fix_ppc_rtas kernel/sys_ni.c
--- foobar2/kernel/sys_ni.c~fix_ppc_rtas	2005-03-22 02:41:53.829633648 +1100
+++ foobar2-anton/kernel/sys_ni.c	2005-03-22 02:41:53.853631819 +1100
@@ -83,3 +83,4 @@ cond_syscall(sys_pciconfig_write);
 cond_syscall(sys_pciconfig_iobase);
 cond_syscall(sys32_ipc);
 cond_syscall(sys32_sysctl);
+cond_syscall(ppc_rtas);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ppc64: fix linkage error on G5
@ 2005-03-21 19:30 Mikael Pettersson
  0 siblings, 0 replies; 3+ messages in thread
From: Mikael Pettersson @ 2005-03-21 19:30 UTC (permalink / raw)
  To: anton; +Cc: akpm, linux-kernel, linuxppc64-dev, paulus

On Tue, 22 Mar 2005 03:32:59 +1100, Anton Blanchard wrote:
>> When 2.6.12-rc1-mm1 is configured for a ppc64/G5, so CONFIG_PPC_PSERIES
>> is disabled, linking of vmlinux fails with:
>> 
>> arch/ppc64/kernel/built-in.o(.text+0x7de0): In function `.sys_call_table32':
>> : undefined reference to `.ppc_rtas'
>> arch/ppc64/kernel/built-in.o(.text+0x8668): In function `.sys_call_table':
>> : undefined reference to `.ppc_rtas'
>> make: *** [.tmp_vmlinux1] Error 1
>
>It turns out we are trying to fix this problem twice, we may as well
>remove the #define hack and use cond_syscall.
>
>--
>
>Move the ppc64 specific cond_syscall(ppc_rtas) into sys_ni.c so that it
>takes effect. With this fixed we can remove the #define hack.

This worked fine. Thanks.

/Mikael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-21 19:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-21 15:19 [PATCH][2.6.12-rc1-mm1] fix ppc64 linkage error on G5 Mikael Pettersson
2005-03-21 16:32 ` [PATCH] ppc64: fix " Anton Blanchard
2005-03-21 19:30 Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®