Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "David Daney" <ddaney@avtrex.com>
To: "Thiemo Seufer" <ica2_ts@csv.ica.uni-stuttgart.de>
Cc: <linux-mips@linux-mips.org>
Subject: RE: [Patch] make 2.4 compile with GCC-3.4.3...
Date: Thu, 2 Dec 2004 22:20:35 -0800	[thread overview]
Message-ID: <69397FFCADEFD94F8D5A0FC0FDBCBBDEF4FA@avtrex-server.hq.avtrex.com> (raw)

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.

WARNING: multiple messages have this Message-ID (diff)
From: "David Daney" <ddaney@avtrex.com>
To: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
Cc: linux-mips@linux-mips.org
Subject: RE: [Patch] make 2.4 compile with GCC-3.4.3...
Date: Thu, 2 Dec 2004 22:20:35 -0800	[thread overview]
Message-ID: <69397FFCADEFD94F8D5A0FC0FDBCBBDEF4FA@avtrex-server.hq.avtrex.com> (raw)
Message-ID: <20041203062035.G62X6PnJYQrmkdX3JfyxbUbRME6ZHQPl7qFAp7dwFLk@z> (raw)

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.

             reply	other threads:[~2004-12-03  6:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-03  6:20 David Daney [this message]
2004-12-03  6:20 ` [Patch] make 2.4 compile with GCC-3.4.3 David Daney
2004-12-03  6:40 ` Thiemo Seufer
2004-12-03 13:50   ` Maciej W. Rozycki
  -- strict thread matches above, loose matches on Subject: below --
2004-12-03  3:14 David Daney
2004-12-03  4:55 ` Thiemo Seufer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69397FFCADEFD94F8D5A0FC0FDBCBBDEF4FA@avtrex-server.hq.avtrex.com \
    --to=ddaney@avtrex.com \
    --cc=ica2_ts@csv.ica.uni-stuttgart.de \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox