Subject: Re: gcc4 compile fixes

From: Christian <[email-masked]>
Date: Mon, 04 Apr 2005 03:51:53 +0200

Dan Kegel wrote:
> Howdy all.  I'm trying to bring up gcc-4.0 toolchains
> using the headers from linux-2.6.11.3, and as a sanity
> check, I'm trying to build ppc750 and ppc970 kernels, too.

i have tried with vanilla 2.6.11.6 now and compiling for ppc604 still
fails with the errors you described. they go away with your suggested
fixes (only had to modify the linenumbers, diff attached, apply with -p0)

oh, not that the kernel compiles now - it seems it just overcame a build
error out of many :->

now it [1] fails with:

In file included from arch/ppc/kernel/time.c:68:
include/asm/time.h:61: warning: type qualifiers ignored on function return
type
arch/ppc/kernel/time.c:92: error: static declaration of 'time_offset'
follows non-static declaration
include/linux/timex.h:236: error: previous declaration of 'time_offset'
was here
make[1]: *** [arch/ppc/kernel/time.o] Error 1
make: *** [arch/ppc/kernel] Error 2

thank you,
Christian.

[1] building a ppc604(PReP) kernel on i386:
powerpc-604-linux-gnu-gcc (GCC) 4.0.0 20050305 (prerelease)
GNU ld version 2.15
  Supported emulations:
   elf32ppclinux
   elf32ppc
   elf32ppcsim
- --
BOFH excuse #345:

Having to manually track the satellite.
--- include/asm-ppc64/paca.h.orig	2005-04-04 03:39:48.576951465 +0200
+++ include/asm-ppc64/paca.h	2005-04-04 03:42:17.970090549 +0200
@@ -22,7 +22,6 @@
 #include	<asm/iSeries/ItLpRegSave.h>
 #include	<asm/mmu.h>
 
-extern struct paca_struct paca[];
 register struct paca_struct *local_paca asm("r13");
 #define get_paca()	local_paca
 
@@ -115,4 +114,6 @@
 #endif
 };
 
+extern struct paca_struct paca[];
+
 #endif /* _PPC64_PACA_H */
--- include/asm-m68k/setup.h.orig	2005-04-04 03:38:34.249350160 +0200
+++ include/asm-m68k/setup.h	2005-04-04 03:39:33.945211078 +0200
@@ -362,12 +362,13 @@
 #ifndef __ASSEMBLY__
 extern int m68k_num_memory;		/* # of memory blocks found (and used) */
 extern int m68k_realnum_memory;		/* real # of memory blocks found */
-extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */
 
 struct mem_info {
 	unsigned long addr;		/* physical address of memory chunk */
 	unsigned long size;		/* length of memory chunk (in bytes) */
 };
+
+extern struct mem_info m68k_memory[NUM_MEMINFO]; /* memory description */
 #endif
 
 #endif /* __KERNEL__ */