linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@csd.uu.se>
To: linux-kernel@vger.kernel.org, ulrich.windl@rz.uni-regensburg.de
Subject: Re: Fixes to compile 2.4.32 with gcc-4.0.2
Date: Mon, 23 Jan 2006 08:54:29 +0100 (MET)	[thread overview]
Message-ID: <200601230754.k0N7sTce014819@harpo.it.uu.se> (raw)

On Mon, 23 Jan 2006 08:07:42 +0100, Ulrich Windl wrote:
>I'm no real C guru, neither am I a kernel guru, but I managed to compile Linux-
>2.4.32 with gcc-4.0.2 (I also could boot that kernel, but couldn't load the 
>modules as SuSE 10.0 lacks the old mudutils required to do that).
>
>Please have a look at the attached diffs, as som of my fixes seem to wipe out some 
>real C nonsense, independent of the compiler issues.
>
>Note: gcc still produces a _lot_ of warnings, but at least the kernel compiles.

Well-tested fixes for gcc-4.0.x and recent 2.4 kernels on
i386, x86_64, and ppc(32) are available in
<http://www.csd.uu.se/~mikpe/linux/patches/2.4/>.
Look for the patch-gcc4-fixes-v<N>-<KERNELVERSION> file that
matches your kernel version.

There is also a patch-more-gcc4-fixes-v1-<KERNELVERSION> file
but those changes were only compile-tested once (due to me not
being able to test them at runtime).

I'd be happy to extend these patches if you find that something
important is missing from them.

2.4 is in deep feature freeze and gcc-4 fixes are not being
accepted into the standard 2.4 tree.

>Index: drivers/scsi/aic7xxx/Makefile
>===================================================================
>RCS file: /root/LinuxCVS/Kernel/drivers/scsi/aic7xxx/Makefile,v
>retrieving revision 1.1.1.6
>diff -u -r1.1.1.6 Makefile
>--- drivers/scsi/aic7xxx/Makefile	22 Jan 2005 20:43:25 -0000	1.1.1.6
>+++ drivers/scsi/aic7xxx/Makefile	20 Jan 2006 20:55:44 -0000
>@@ -13,7 +13,7 @@
> obj-$(CONFIG_SCSI_AIC79XX)	+= aic79xx.o
> endif
> 
>-EXTRA_CFLAGS += -I$(TOPDIR)/drivers/scsi -Werror
>+EXTRA_CFLAGS += -I$(TOPDIR)/drivers/scsi #-Werror
> #EXTRA_CFLAGS += -g
> 
> # Platform Specific Files

Better to find and fix the causes of those warnings.

>Index: drivers/sound/sound_firmware.c
>===================================================================
>RCS file: /root/LinuxCVS/Kernel/drivers/sound/sound_firmware.c,v
>retrieving revision 1.1.1.2
>diff -u -r1.1.1.2 sound_firmware.c
>--- drivers/sound/sound_firmware.c	11 Mar 2001 13:55:33 -0000	1.1.1.2
>+++ drivers/sound/sound_firmware.c	21 Jan 2006 22:27:06 -0000
>@@ -7,7 +7,6 @@
> #include <linux/unistd.h>
> #include <asm/uaccess.h>
> 
>-static int errno;
> static int do_mod_firmware_load(const char *fn, char **fp)
> {
> 	int fd;

This changes the semantics of the in-kernel system calls
called here so they now clobber a global errno. My solution
was to force the syscall wrappers to use a local variable
'my_errno'.

/Mikael

             reply	other threads:[~2006-01-23  7:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-23  7:54 Mikael Pettersson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-01-23  7:07 Fixes to compile 2.4.32 with gcc-4.0.2 Ulrich Windl

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=200601230754.k0N7sTce014819@harpo.it.uu.se \
    --to=mikpe@csd.uu.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ulrich.windl@rz.uni-regensburg.de \
    /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;
as well as URLs for NNTP newsgroup(s).