lkml.org 
[lkml]   [1998]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Memory Rusting Effect [re: Linux hostile to poverty]
On Wed, 22 Jul 1998, Chris Wedgwood wrote:
> > Compile drivers/scsi/scsi_debug.c after defining "SCSI_DATARATE" and
> > "SCSI_SETUP_LATENCY".
> >
> > This generates floating-point code in kernel, on intel something like:
> >
> > fldl .LC25
> > fmulp %st,%st(1)
> > fldl .LC26
> > fdivr %st,%st(1)
>
> Hmm... its probably not the only place.
>
> It might be a good idea if somebody has the time to hack the makefile so all
> .c targets are moved through .s targets where its possible to grep for
> nasties like the above.

A simpler approach is to use gcc's "-msoft-float" flag. This causes
all (almost, see the gcc info pages) floating-point operations to be
emitted as calls to external library routines. Since neither gcc
nor the linux kernel supply these by default, code using f.p. will
trigger linker errors. I've tried this on the i386 and it catches
f.p. use both in the resident part of the kernel and in modules.

This patch won't catch explicit f.p. insns in assembly code, but it
should catch all cases of "accidental" f.p. use.

If gcc's "-msoft-float" feature is spelled the same on all targets
then this should probably be moved to the main Makefile.

/Mikael

--- linux-2.1.110/arch/i386/Makefile.orig Wed Jul 22 01:29:08 1998
+++ linux-2.1.110/arch/i386/Makefile Wed Jul 22 01:30:04 1998
@@ -23,6 +23,8 @@
CFLAGS_NSR := -fno-strength-reduce
CFLAGS := $(CFLAGS) $(CFLAGS_PIPE) $(CFLAGS_NSR)

+CFLAGS := $(CFLAGS) -msoft-float
+
ifdef CONFIG_M386
CFLAGS := $(CFLAGS) -m386 -DCPU=386
endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.060 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site