* [PATCH] Compile kernel with GCC-3.5 and without regparm
@ 2004-03-03 0:23 Art Haas
2004-03-03 0:59 ` Andrew Morton
2004-03-03 1:10 ` Brian Gerst
0 siblings, 2 replies; 3+ messages in thread
From: Art Haas @ 2004-03-03 0:23 UTC (permalink / raw)
To: linux-kernel
Hi.
I tried to build the kernel with my CVS GCC-3.5 compiler today, and had
all sorts of failures about prototypes not matching. My configuration
had not selected the 'CONFIG_REGPARM' option, so the new '-mregparm=3'
flag wasn't passed to the compiler. That's fine, but the problem is the
FASTCALL macro is unconditionally defined to add an regparm(3)
attribute, making the compiler quite confused. The following small patch
conditionally defines FASTCALL, and allowed my compilation to succeed
either with or without the CONFIG_REGPARM conditional being defined.
I tested this patch by configuring a kernel without the CONFIG_REGPARM
flag, then started the build. Once the build got through building a
couple of files in 'arch/i386/kernel' that had failed previously, I
stopped the build. A cleanup and reconfiguration with the CONFIG_REGPARM
conditional followed, and a new build began. Again, the files in the
same directory compiled fine, so things looked good. I then tried to
build with CONFIG_REGPARM defined and setting CC and HOSTCC to use
my gcc-2.95 compiler, and the files in that directory compiled again
successfully once more.
If this patch is deemed correct, a similar patch for 'asm-um' is
likely necessary as well.
Art Haas
===== include/asm-i386/linkage.h 1.2 vs edited =====
--- 1.2/include/asm-i386/linkage.h Sun Aug 4 00:44:49 2002
+++ edited/include/asm-i386/linkage.h Tue Mar 2 17:59:59 2004
@@ -2,7 +2,9 @@
#define __ASM_LINKAGE_H
#define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
+#ifdef CONFIG_REGPARM
#define FASTCALL(x) x __attribute__((regparm(3)))
+#endif
#ifdef CONFIG_X86_ALIGNMENT_16
#define __ALIGN .align 16,0x90
--
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.
-Thomas Jefferson to James Smith, 1822
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Compile kernel with GCC-3.5 and without regparm
2004-03-03 0:23 [PATCH] Compile kernel with GCC-3.5 and without regparm Art Haas
@ 2004-03-03 0:59 ` Andrew Morton
2004-03-03 1:10 ` Brian Gerst
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2004-03-03 0:59 UTC (permalink / raw)
To: Art Haas; +Cc: linux-kernel
"Art Haas" <ahaas@airmail.net> wrote:
>
> I tried to build the kernel with my CVS GCC-3.5 compiler today, and had
> all sorts of failures about prototypes not matching.
-mm is where the gcc-3.5 action is. There seems to be a bit of an arms
race going on wherein the gcc developers are trying to break the kernel
build faster than I and others can fix it.
See the fastcall-* patches.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Compile kernel with GCC-3.5 and without regparm
2004-03-03 0:23 [PATCH] Compile kernel with GCC-3.5 and without regparm Art Haas
2004-03-03 0:59 ` Andrew Morton
@ 2004-03-03 1:10 ` Brian Gerst
1 sibling, 0 replies; 3+ messages in thread
From: Brian Gerst @ 2004-03-03 1:10 UTC (permalink / raw)
To: Art Haas; +Cc: linux-kernel
Art Haas wrote:
> Hi.
>
> I tried to build the kernel with my CVS GCC-3.5 compiler today, and had
> all sorts of failures about prototypes not matching. My configuration
> had not selected the 'CONFIG_REGPARM' option, so the new '-mregparm=3'
> flag wasn't passed to the compiler. That's fine, but the problem is the
> FASTCALL macro is unconditionally defined to add an regparm(3)
> attribute, making the compiler quite confused. The following small patch
> conditionally defines FASTCALL, and allowed my compilation to succeed
> either with or without the CONFIG_REGPARM conditional being defined.
>
> I tested this patch by configuring a kernel without the CONFIG_REGPARM
> flag, then started the build. Once the build got through building a
> couple of files in 'arch/i386/kernel' that had failed previously, I
> stopped the build. A cleanup and reconfiguration with the CONFIG_REGPARM
> conditional followed, and a new build began. Again, the files in the
> same directory compiled fine, so things looked good. I then tried to
> build with CONFIG_REGPARM defined and setting CC and HOSTCC to use
> my gcc-2.95 compiler, and the files in that directory compiled again
> successfully once more.
>
> If this patch is deemed correct, a similar patch for 'asm-um' is
> likely necessary as well.
>
> Art Haas
>
> ===== include/asm-i386/linkage.h 1.2 vs edited =====
> --- 1.2/include/asm-i386/linkage.h Sun Aug 4 00:44:49 2002
> +++ edited/include/asm-i386/linkage.h Tue Mar 2 17:59:59 2004
> @@ -2,7 +2,9 @@
> #define __ASM_LINKAGE_H
>
> #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
> +#ifdef CONFIG_REGPARM
> #define FASTCALL(x) x __attribute__((regparm(3)))
> +#endif
>
> #ifdef CONFIG_X86_ALIGNMENT_16
> #define __ALIGN .align 16,0x90
You can't do this. Some of these functions are called from asm code
which assumes that parameters are passed in registers. The right fix is
to make the prototypes and function match.
--
Brian Gerst
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-03-03 1:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-03 0:23 [PATCH] Compile kernel with GCC-3.5 and without regparm Art Haas
2004-03-03 0:59 ` Andrew Morton
2004-03-03 1:10 ` Brian Gerst
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®