All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@avtrex.com>
To: linux-mips@linux-mips.org
Subject: [Patch] make 2.4 compile with GCC-3.4.3...
Date: Thu, 02 Dec 2004 19:14:32 -0800	[thread overview]
Message-ID: <41AFDA18.2010906@avtrex.com> (raw)

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

I just upgraded to the most recent 2.4.29-pre1 sources from the CVS archive
 with the intent of being able to compile with gcc-3.4.3.

It turns out that the compiler is splitting:

 save_static_function(sys_fork);
 static_unused int _sys_fork(struct pt_regs regs)

The result being an unusable kernel.

I think that this issue has been discussed before, but I couldn't find the
solution in the mail group.  So I applied this small hack.  The
modifications to syscall.c and signal.c may not be necessary, but I
borrowed them from the 2.6 tree in hopes of fixing the problem and then
moved to the Makefile change.

It may be that only the Makefile change is necessary (I suspect so), but I
have not tried it alone.

The CVS versions in the diff are from my local cvs and do not correspond to
the linux-mips.org CVS.

David Daney.

[-- Attachment #2: uat.d --]
[-- Type: text/plain, Size: 3592 bytes --]

Index: kernel/Makefile
===================================================================
RCS file: /linux/linux/arch/mips/kernel/Makefile,v
retrieving revision 1.2
diff -c -p -r1.2 Makefile
*** 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,)
+ 
  obj-$(CONFIG_MODULES)		+= mips_ksyms.o
  
  obj-$(CONFIG_CPU_R3000)		+= r2300_fpu.o r2300_switch.o
Index: kernel/signal.c
===================================================================
RCS file: /linux/linux/arch/mips/kernel/signal.c,v
retrieving revision 1.1.1.2
diff -c -p -r1.1.1.2 signal.c
*** kernel/signal.c	1 Dec 2004 21:50:39 -0000	1.1.1.2
--- kernel/signal.c	3 Dec 2004 03:00:44 -0000
***************
*** 18,23 ****
--- 18,24 ----
  #include <linux/errno.h>
  #include <linux/wait.h>
  #include <linux/unistd.h>
+ #include <linux/compiler.h>
  
  #include <asm/asm.h>
  #include <asm/bitops.h>
*************** int copy_siginfo_to_user(siginfo_t *to, 
*** 76,82 ****
   * Atomically swap in the new signal mask, and wait for a signal.
   */
  save_static_function(sys_sigsuspend);
! static_unused int _sys_sigsuspend(struct pt_regs regs)
  {
  	sigset_t *uset, saveset, newset;
  
--- 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)
  {
  	sigset_t *uset, saveset, newset;
  
*************** static_unused int _sys_sigsuspend(struct
*** 102,108 ****
  }
  
  save_static_function(sys_rt_sigsuspend);
! static_unused int _sys_rt_sigsuspend(struct pt_regs regs)
  {
  	sigset_t *unewset, saveset, newset;
          size_t sigsetsize;
--- 104,111 ----
  }
  
  save_static_function(sys_rt_sigsuspend);
! __attribute_used__ static int
! _sys_rt_sigsuspend(struct pt_regs regs)
  {
  	sigset_t *unewset, saveset, newset;
          size_t sigsetsize;
Index: kernel/syscall.c
===================================================================
RCS file: /linux/linux/arch/mips/kernel/syscall.c,v
retrieving revision 1.1.1.2
diff -c -p -r1.1.1.2 syscall.c
*** kernel/syscall.c	1 Dec 2004 21:50:39 -0000	1.1.1.2
--- kernel/syscall.c	3 Dec 2004 03:00:44 -0000
***************
*** 25,30 ****
--- 25,31 ----
  #include <linux/slab.h>
  #include <linux/utsname.h>
  #include <linux/unistd.h>
+ #include <linux/compiler.h>
  #include <asm/branch.h>
  #include <asm/offset.h>
  #include <asm/ptrace.h>
*************** sys_mmap2(unsigned long addr, unsigned l
*** 158,164 ****
  }
  
  save_static_function(sys_fork);
! static_unused int _sys_fork(struct pt_regs regs)
  {
  	int res;
  
--- 159,166 ----
  }
  
  save_static_function(sys_fork);
! __attribute_used__ static int
! _sys_fork(struct pt_regs regs)
  {
  	int res;
  
*************** static_unused int _sys_fork(struct pt_re
*** 168,174 ****
  
  
  save_static_function(sys_clone);
! static_unused int _sys_clone(struct pt_regs regs)
  {
  	unsigned long clone_flags;
  	unsigned long newsp;
--- 170,177 ----
  
  
  save_static_function(sys_clone);
! __attribute_used__ static int
! _sys_clone(struct pt_regs regs)
  {
  	unsigned long clone_flags;
  	unsigned long newsp;

             reply	other threads:[~2004-12-03  3:14 UTC|newest]

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

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=41AFDA18.2010906@avtrex.com \
    --to=ddaney@avtrex.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.