linux-mips
[Top] [All Lists]

RE: [Patch] make 2.4 compile with GCC-3.4.3...

To: "Thiemo Seufer" <ica2_ts@csv.ica.uni-stuttgart.de>
Subject: RE: [Patch] make 2.4 compile with GCC-3.4.3...
From: "David Daney" <ddaney@avtrex.com>
Date: Thu, 2 Dec 2004 22:20:35 -0800
Cc: <linux-mips@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Thread-index: AcTY9GF1P2Gkgu4tQBCZOA+wwGQoOwACgaBK
Thread-topic: [Patch] make 2.4 compile with GCC-3.4.3...
Thiemo Seufer wrote:
>David Daney wrote:
>[snip]
>> *** kernel/Makefile   2 Dec 2004 19:50:05 -0000       1.2
>> --- kernel/Makefile   3 Dec 2004 03:00:44 -0000
>> *************** obj-y         += branch.o cpu-probe.o irq.o pro
>> *** 18,23 ****
>> --- 18,27 ----
>>                  traps.o ptrace.o reset.o semaphore.o setup.o syscall.o \
>>                  sysmips.o ipc.o scall_o32.o time.o unaligned.o
>>  
>> + check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > 
>> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
>> +
>> + syscall.o signal.o : override CFLAGS += $(call check_gcc, 
>> -fno-unit-at-a-time,)
>
>What difference does this cause?

It causes -fno-unit-at-a-time to be added to CFLAGS when compiling
syscall.c and signal.c.  All other files are compiled with the "normal" CFLAGS.
 
-fno-unit-at-a-time prevents GCC from rearranging things in its output thus 
preventing
the save_static_function() from being separated from its companion.  As far as 
I could tell
only syscall.c and signal.c need this.
 
One small issue is that these two files now seem to get recompiled with each
make invocation.  But that is better than being miscompiled.
 
I am not sure if check_gcc is inherited from the higher level makefile so I put 
it in this one
as well.  If you think it is a good approach I will try to simplify the patch a 
little.

>[snip]
>> --- 77,84 ----
>>    * Atomically swap in the new signal mask, and wait for a signal.
>>    */
>>   save_static_function(sys_sigsuspend);
>> ! __attribute_used__ static int
>> ! _sys_sigsuspend(struct pt_regs regs)
>
>These should also use "noinline", like 2.6.

noinline was not defined for me :( so I removed it.  It seems that in 2.6 it is
just #defined to be nothing.  The alternative is to add:
 
#ifndef noinline
#define noinline
#endif
 
to compiler.h as is done in 2.6
 
David Daney.
<Prev in Thread] Current Thread [Next in Thread>