patches/linux/2.6.11.3/170-linux-2.6.11-allow-gcc-4.0-ppc-mikpe.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 13 10:32:38 2008 +0000 (2008-07-13)
changeset 645 8e58024f8e37
permissions -rw-r--r--
Ioannis E. VENETIS <venetis@mail.capsl.udel.edu> pointed out that GMP and MPFR were not used by gcc.
Turned out that none could use GMP and MPFR as the config option changed its name, but the change was not propagated to all users.

/trunk/scripts/build/binutils.sh | 2 1 1 0 +-
/trunk/scripts/build/debug/300-gdb.sh | 2 1 1 0 +-
/trunk/scripts/build/cc_gcc.sh | 6 3 3 0 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
yann@402
     1
yann@402
     2
Fixes
yann@402
     3
yann@402
     4
In file included from arch/ppc/kernel/time.c:68:
yann@402
     5
arch/ppc/kernel/time.c:92: error: static declaration of 'time_offset' follows non-static declaration
yann@402
     6
include/linux/timex.h:236: error: previous declaration of 'time_offset' was here
yann@402
     7
make[1]: *** [arch/ppc/kernel/time.o] Error 1
yann@402
     8
yann@402
     9
when compiling with gcc-4.0
yann@402
    10
yann@402
    11
Taken from
yann@402
    12
http://user.it.uu.se/~mikpe/linux/patches/2.6/patch-gcc4-fixes-v2-2.6.11
yann@402
    13
Also removes some obsolete externs that caused problems for Mike
yann@402
    14
Mike's patch has a bit more stuff in it, but this was enough for me
yann@402
    15
yann@402
    16
yann@402
    17
diff -rupN linux-2.6.11/arch/ppc/kernel/time.c linux-2.6.11.gcc4-fixes-v2/arch/ppc/kernel/time.c
yann@402
    18
--- linux-2.6.11/arch/ppc/kernel/time.c	2005-03-02 19:24:14.000000000 +0100
yann@402
    19
+++ linux-2.6.11.gcc4-fixes-v2/arch/ppc/kernel/time.c	2005-03-02 19:36:26.000000000 +0100
yann@402
    20
@@ -89,7 +89,7 @@ unsigned long tb_to_ns_scale;
yann@402
    21
 
yann@402
    22
 extern unsigned long wall_jiffies;
yann@402
    23
 
yann@402
    24
-static long time_offset;
yann@402
    25
+static long ppc_time_offset;
yann@402
    26
 
yann@402
    27
 DEFINE_SPINLOCK(rtc_lock);
yann@402
    28
 
yann@402
    29
@@ -172,7 +172,7 @@ void timer_interrupt(struct pt_regs * re
yann@402
    30
 		     xtime.tv_sec - last_rtc_update >= 659 &&
yann@402
    31
 		     abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ &&
yann@402
    32
 		     jiffies - wall_jiffies == 1) {
yann@402
    33
-		  	if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) == 0)
yann@402
    34
+		  	if (ppc_md.set_rtc_time(xtime.tv_sec+1 + ppc_time_offset) == 0)
yann@402
    35
 				last_rtc_update = xtime.tv_sec+1;
yann@402
    36
 			else
yann@402
    37
 				/* Try again one minute later */
yann@402
    38
@@ -289,7 +289,7 @@ void __init time_init(void)
yann@402
    39
 	unsigned old_stamp, stamp, elapsed;
yann@402
    40
 
yann@402
    41
         if (ppc_md.time_init != NULL)
yann@402
    42
-                time_offset = ppc_md.time_init();
yann@402
    43
+                ppc_time_offset = ppc_md.time_init();
yann@402
    44
 
yann@402
    45
 	if (__USE_RTC()) {
yann@402
    46
 		/* 601 processor: dec counts down by 128 every 128ns */
yann@402
    47
@@ -334,10 +334,10 @@ void __init time_init(void)
yann@402
    48
 	set_dec(tb_ticks_per_jiffy);
yann@402
    49
 
yann@402
    50
 	/* If platform provided a timezone (pmac), we correct the time */
yann@402
    51
-        if (time_offset) {
yann@402
    52
-		sys_tz.tz_minuteswest = -time_offset / 60;
yann@402
    53
+        if (ppc_time_offset) {
yann@402
    54
+		sys_tz.tz_minuteswest = -ppc_time_offset / 60;
yann@402
    55
 		sys_tz.tz_dsttime = 0;
yann@402
    56
-		xtime.tv_sec -= time_offset;
yann@402
    57
+		xtime.tv_sec -= ppc_time_offset;
yann@402
    58
         }
yann@402
    59
         set_normalized_timespec(&wall_to_monotonic,
yann@402
    60
                                 -xtime.tv_sec, -xtime.tv_nsec);
yann@402
    61
diff -rupN linux-2.6.11/arch/ppc/syslib/open_pic_defs.h linux-2.6.11.gcc4-fixes-v2/arch/ppc/syslib/open_pic_defs.h
yann@402
    62
--- linux-2.6.11/arch/ppc/syslib/open_pic_defs.h	2005-03-02 19:24:14.000000000 +0100
yann@402
    63
+++ linux-2.6.11.gcc4-fixes-v2/arch/ppc/syslib/open_pic_defs.h	2005-03-02 19:36:26.000000000 +0100
yann@402
    64
@@ -172,9 +172,6 @@ struct OpenPIC {
yann@402
    65
     OpenPIC_Processor Processor[OPENPIC_MAX_PROCESSORS];
yann@402
    66
 };
yann@402
    67
 
yann@402
    68
-extern volatile struct OpenPIC __iomem *OpenPIC;
yann@402
    69
-
yann@402
    70
-
yann@402
    71
     /*
yann@402
    72
      *  Current Task Priority Register
yann@402
    73
      */
yann@402
    74
diff -rupN linux-2.6.11/include/asm-ppc/prom.h linux-2.6.11.gcc4-fixes-v2/include/asm-ppc/prom.h
yann@402
    75
--- linux-2.6.11/include/asm-ppc/prom.h	2003-09-28 12:19:57.000000000 +0200
yann@402
    76
+++ linux-2.6.11.gcc4-fixes-v2/include/asm-ppc/prom.h	2005-03-02 19:36:26.000000000 +0100
yann@402
    77
@@ -13,9 +13,6 @@
yann@402
    78
 typedef void *phandle;
yann@402
    79
 typedef void *ihandle;
yann@402
    80
 
yann@402
    81
-extern char *prom_display_paths[];
yann@402
    82
-extern unsigned int prom_num_displays;
yann@402
    83
-
yann@402
    84
 struct address_range {
yann@402
    85
 	unsigned int space;
yann@402
    86
 	unsigned int address;