This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

i386-elf-gcc multi-lib patch for software FP


Hi,

The attached patch to GCC 3.3.1 adds multi-lib support for the i386-elf target to build libgcc's for software floating point (e.g., for a i386 with no 387). Specifically:

$ i386-elf-gcc -print-multi-lib
.;
m386;@mcpu=i386
soft-float;@msoft-float
soft-float/nofp;@msoft-float@mno-fp-ret-in-387
m386/soft-float;@mcpu=i386@msoft-float
m386/soft-float/nofp;@mcpu=i386@msoft-float@mno-fp-ret-in-387

Before I pass the patch onto the GCC guys is there anything wrong/missing?

(Ultimately, I suppose that adding FPU emulation to the eCos i386 HAL would be a better solution.)

David Vrabel
--
David Vrabel, Design Engineer

Arcom                         Tel: +44 (0)1223 411200 ext. 3233
Clifton Road                  Fax: +44 (0)1223 403400
Cambridge CB1 7EA             E-mail: dvrabel@arcom.com
UK                            Web: http://www.arcom.com/


________________________________________________________________________ This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com ________________________________________________________________________
--- gcc-3.3.1/gcc/config/i386/i386elf.h.orig	2002-06-16 22:13:09.000000000 +0100
+++ gcc-3.3.1/gcc/config/i386/i386elf.h	2003-09-04 12:46:00.000000000 +0100
@@ -41,7 +41,7 @@
    || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
 
 #undef CPP_SPEC
-#define CPP_SPEC ""
+#define CPP_SPEC "%{msoft-float:-D_SOFT_FLOAT}"
 
 #define ENDFILE_SPEC "crtend.o%s"
 
--- gcc-3.3.1/gcc/config/i386/t-i386elf.orig	2003-09-03 13:21:51.000000000 +0100
+++ gcc-3.3.1/gcc/config/i386/t-i386elf	2003-09-04 12:44:39.000000000 +0100
@@ -2,3 +2,37 @@
 # end labels to the .ctors and .dtors section when we link using gcc.
 
 EXTRA_PARTS=crtbegin.o crtend.o
+
+# We want fine grained libraries, so use the new code to build the
+# floating point emulation libraries.
+FPBIT = fp-bit.c
+DPBIT = dp-bit.c
+
+LIB2FUNCS_EXTRA = xp-bit.c
+
+dp-bit.c: $(srcdir)/config/fp-bit.c
+	echo '#ifdef __LITTLE_ENDIAN__' > dp-bit.c
+	echo '#define FLOAT_BIT_ORDER_MISMATCH' >>dp-bit.c
+	echo '#endif'           >> dp-bit.c
+	cat $(srcdir)/config/fp-bit.c >> dp-bit.c
+
+fp-bit.c: $(srcdir)/config/fp-bit.c
+	echo '#define FLOAT' > fp-bit.c
+	echo '#ifdef __LITTLE_ENDIAN__' >> fp-bit.c
+	echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
+	echo '#endif'           >> fp-bit.c
+	cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+xp-bit.c: $(srcdir)/config/fp-bit.c
+	echo '#define EXTENDED_FLOAT_STUBS' > xp-bit.c
+	cat $(srcdir)/config/fp-bit.c >> xp-bit.c
+
+MULTILIB_OPTIONS = mcpu=i386 msoft-float mno-fp-ret-in-387
+MULTILIB_DIRNAMES= m386 soft-float nofp
+MULTILIB_MATCHES = msoft-float=mno-m80387
+MULTILIB_EXCEPTIONS = mno-fp-ret-in-387 mcpu=i386/mno-fp-ret-in-387
+
+EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]