linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* gcc4 compile fixes
@ 2005-03-19  0:55 Dan Kegel
  2005-04-04  1:51 ` Christian
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Kegel @ 2005-03-19  0:55 UTC (permalink / raw)
  To: linuxppc-dev

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'm finding things here and there that need patching to let
the build finish.  For instance:

In file included from include/asm/setup.h:8,
                  from include/asm/machdep.h:8,
                  from include/asm/irq.h:6,
                  from include/asm/hardirq.h:8,
                  from include/linux/hardirq.h:6,
                  from include/asm-generic/local.h:6,
                  from include/asm/local.h:4,
                  from include/linux/module.h:21,
                  from init/main.c:16:
include/asm-m68k/setup.h:365: error: array type has incomplete element type

(This pops up because asm-ppc/setup.h just includes asm-m68k/setup.h.)

That's a garden-variety 'used before defined' problem, fixed thus:

--- linux-2.6.11.3/include/asm-m68k/setup.h.old Fri Mar 18 13:48:03 2005
+++ linux-2.6.11.3/include/asm-m68k/setup.h     Fri Mar 18 13:48:14 2005
@@ -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__ */
--- snip ---

Ditto for the next one:

In file included from include/asm/current.h:4,
                  from include/linux/wait.h:27,
                  from include/asm/semaphore.h:15,
                  from include/linux/sched.h:19,
                  from arch/ppc64/kernel/asm-offsets.c:18:
include/asm/paca.h:25: error: array type has incomplete element type
make[1]: *** [arch/ppc64/kernel/asm-offsets.s] Error 1

--- linux-2.6.11.3/include/asm-ppc64/paca.h.old Fri Mar 18 13:23:40 2005
+++ linux-2.6.11.3/include/asm-ppc64/paca.h     Fri Mar 18 13:24:04 2005
@@ -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

@@ -114,5 +113,7 @@
         struct ItLpRegSave reg_save;
  #endif
  };
+
+extern struct paca_struct paca[];

  #endif /* _PPC64_PACA_H */
--- snip ---

If somebody else has already fixed all of these, I'd rather
just use their sources.   So... shall I keep on patching
and posting, or are these already fixed somewhere?

Thanks,
Dan

-- 
Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html

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

* Re: gcc4 compile fixes
  2005-03-19  0:55 gcc4 compile fixes Dan Kegel
@ 2005-04-04  1:51 ` Christian
  2005-04-04 13:57   ` Christian
  0 siblings, 1 reply; 4+ messages in thread
From: Christian @ 2005-04-04  1:51 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Dan Kegel

[-- Attachment #1: Type: text/plain, Size: 1503 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCUJ25C/PVm5+NVoYRArBVAKDU+Zbg2dYxXksrN7eK5jpx+kzmpgCdGgHY
kxED/GRoU4+1c/NrrGXn4D8=
=hn4d
-----END PGP SIGNATURE-----

[-- Attachment #2: 2.6.11.6.gcc4_compile_fixes.diff --]
[-- Type: text/plain, Size: 1092 bytes --]

--- 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__ */

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

* Re: gcc4 compile fixes
  2005-04-04  1:51 ` Christian
@ 2005-04-04 13:57   ` Christian
  2005-04-04 14:10     ` Dan Kegel
  0 siblings, 1 reply; 4+ messages in thread
From: Christian @ 2005-04-04 13:57 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Dan Kegel

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

replying to myself:

Christian wrote:
> 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
[...]

..and there were other error messages too. not knowing a *bit* of C, i was
able to do minor alterations which i deduced from gcc's error messages.
now compiling for ppc604 (PReP) with gcc4 succeeds.

thank you for your concern,
Christian.
- --
BOFH excuse #403:

Sysadmin didn't hear pager go off due to loud music from bar-room speakers.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCUUfEC/PVm5+NVoYRAiMYAKCVru912jky9ctrnAhBe+ukymReQgCg9z6Y
YSNKwksGyXiDKgxpvGhO1wM=
=WSll
-----END PGP SIGNATURE-----

[-- Attachment #2: 2.6.11.6.gcc4_compile_fixes-take2.diff --]
[-- Type: text/plain, Size: 1770 bytes --]

--- linux-2.6/arch/ppc/syslib/open_pic_defs.h.orig	2005-04-04 15:01:39.581824538 +0200
+++ linux-2.6/arch/ppc/syslib/open_pic_defs.h	2005-04-04 15:01:52.679696972 +0200
@@ -172,7 +172,7 @@
     OpenPIC_Processor Processor[OPENPIC_MAX_PROCESSORS];
 };
 
-extern volatile struct OpenPIC __iomem *OpenPIC;
+static volatile struct OpenPIC __iomem *OpenPIC;
 
 
     /*
--- linux-2.6/arch/ppc/kernel/time.c.orig	2005-04-04 15:12:41.963801575 +0200
+++ linux-2.6/arch/ppc/kernel/time.c	2005-04-04 15:12:56.390559608 +0200
@@ -89,7 +89,7 @@
 
 extern unsigned long wall_jiffies;
 
-static long time_offset;
+extern long time_offset;
 
 DEFINE_SPINLOCK(rtc_lock);
 
--- linux-2.6/include/asm-ppc/time.h.orig	2005-04-04 14:47:55.526765569 +0200
+++ linux-2.6/include/asm-ppc/time.h	2005-04-04 14:49:59.075129571 +0200
@@ -58,7 +58,7 @@
 /* Accessor functions for the timebase (RTC on 601) registers. */
 /* If one day CONFIG_POWER is added just define __USE_RTC as 1 */
 #ifdef CONFIG_6xx
-extern __inline__ int const __USE_RTC(void) {
+static __inline__ int const __USE_RTC(void) {
 	return (mfspr(SPRN_PVR)>>16) == 1;
 }
 #else
@@ -92,7 +92,7 @@
 	mtspr(SPRN_TBWL, lower);
 }
 
-extern __inline__ unsigned long get_rtcl(void) {
+static __inline__ unsigned long get_rtcl(void) {
 	unsigned long rtcl;
 	asm volatile("mfrtcl %0" : "=r" (rtcl));
 	return rtcl;
--- linux-2.6/include/asm-ppc/prom.h.orig	2005-04-04 14:56:50.014752710 +0200
+++ linux-2.6/include/asm-ppc/prom.h	2005-04-04 14:59:59.805414063 +0200
@@ -13,8 +13,8 @@
 typedef void *phandle;
 typedef void *ihandle;
 
-extern char *prom_display_paths[];
-extern unsigned int prom_num_displays;
+static char *prom_display_paths[];
+static unsigned int prom_num_displays;
 
 struct address_range {
 	unsigned int space;

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

* Re: gcc4 compile fixes
  2005-04-04 13:57   ` Christian
@ 2005-04-04 14:10     ` Dan Kegel
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Kegel @ 2005-04-04 14:10 UTC (permalink / raw)
  To: Christian; +Cc: linuxppc-dev

Christian wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> replying to myself:
> 
> Christian wrote:
> 
>>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
> 
> [...]
> 
> ..and there were other error messages too. not knowing a *bit* of C, i was
> able to do minor alterations which i deduced from gcc's error messages.
> now compiling for ppc604 (PReP) with gcc4 succeeds.

Thanks for the report and the patch.
Parts of that patch look like ones I've already collected at:
http://www.kegel.com/crosstool/crosstool-0.30/patches/linux-2.6.11.3/
Here are the patches I have so far:
kaz-types.patch
linux-2.6.11-allow-gcc-4.0-asm-i386.patch
linux-2.6.11-allow-gcc-4.0-asm-m68k.patch
linux-2.6.11-allow-gcc-4.0-asm-ppc64.patch
linux-2.6.11-allow-gcc-4.0-asm-x86_64.patch
linux-2.6.11-allow-gcc-4.0-i2c.patch
linux-2.6.11-allow-gcc-4.0-ppc-mikpe.patch

In particular,
http://www.kegel.com/crosstool/crosstool-0.30/patches/linux-2.6.11.3/linux-2.6.11-allow-gcc-4.0-ppc-mikpe.patch
covers some of what you found.

Maybe if I apply your first patch, I'll make it all the way through.

Thanks,
Dan

-- 
Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html

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

end of thread, other threads:[~2005-04-04 14:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-19  0:55 gcc4 compile fixes Dan Kegel
2005-04-04  1:51 ` Christian
2005-04-04 13:57   ` Christian
2005-04-04 14:10     ` Dan Kegel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).