This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
PATCH for gcc2.95 vxworks5.4 compilers
- To: gcc-bugs at gcc dot gnu dot org
- Subject: PATCH for gcc2.95 vxworks5.4 compilers
- From: "Brad M. Garcia" <bgarcia at fore dot com>
- Date: Wed, 4 Aug 1999 12:35:18 -0400 (EDT)
I needed to make the following changes in order to produce
vxworks 5.4 cross-compilers. Please look these over and
provide feedback.
In vxworks5.4, size_t is defined as "unsigned int", while the default
for gcc is "unsigned long". Therefore, the following changes
should be made:
****************************************************************************
diff -u -r gcc-2.95.ORIG/gcc/config/i386/vxi386.h gcc-2.95/gcc/config/i386/vxi386.h
--- gcc-2.95.ORIG/gcc/config/i386/vxi386.h Tue Apr 13 17:30:32 1999
+++ gcc-2.95/gcc/config/i386/vxi386.h Tue Aug 3 16:01:55 1999
@@ -53,6 +53,9 @@
#undef LINK_SPEC
#define LINK_SPEC "-r"
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
/* VxWorks provides the functionality of crt0.o and friends itself. */
#undef STARTFILE_SPEC
diff -u -r gcc-2.95.ORIG/gcc/config/i960/vx960-coff.h gcc-2.95/gcc/config/i960/vx960-coff.h
--- gcc-2.95.ORIG/gcc/config/i960/vx960-coff.h Tue Jan 19 07:02:59 1999
+++ gcc-2.95/gcc/config/i960/vx960-coff.h Wed Aug 4 09:59:59 1999
@@ -31,6 +31,9 @@
#undef STARTFILE_SPEC
#define STARTFILE_SPEC ""
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
/* Predefine vxworks. */
#undef CPP_PREDEFINES
****************************************************************************
In addition, I made a couple of hacks to get the thing to compile.
I DEFINITELY DO _NOT_ want these changes going into the code base,
but I'm hoping that someone will see the problem and be able to
propose a real fix.
First of all, tinfo.cc attempts to define type_info::operator==(),
but this is already defined in vxWorks's "typeinfo" header file.
I simply commented this out to get things to compile:
****************************************************************************
diff -u -r gcc-2.95.ORIG/gcc/cp/tinfo.cc gcc-2.95/gcc/cp/tinfo.cc
--- gcc-2.95.ORIG/gcc/cp/tinfo.cc Tue Aug 3 14:52:05 1999
+++ gcc-2.95/gcc/cp/tinfo.cc Tue Aug 3 23:03:58 1999
@@ -39,12 +39,14 @@
~type_info ()
{ }
+#if 0
// We can't rely on common symbols being shared between shared objects.
bool std::type_info::
operator== (const std::type_info& arg) const
{
return (&arg == this) || (strcmp (name (), arg.name ()) == 0);
}
+#endif
extern "C" void
__rtti_class (void *addr, const char *name,
****************************************************************************
Next, _G_HAVE_PRINTF_FP is getting set to 1, even though vxworks does
not have a "printf.h" header file, and even though vxworks' own header
files arch/i86/_G_configArch.h and arch/i960/_G_configArch.h
(and I assume all others architectures) have this set to 0.
So I hacked the code to always set it to 0. Perhaps we need a better
test in gen-params?
****************************************************************************
diff -u -r gcc-2.95.ORIG/libio/gen-params gcc-2.95/libio/gen-params
--- gcc-2.95.ORIG/libio/gen-params Tue Mar 23 18:58:21 1999
+++ gcc-2.95/libio/gen-params Wed Aug 4 07:37:33 1999
@@ -717,8 +717,8 @@
EOF
if ${CC} dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_PRINTF_FP 1"
- echo "#define ${macro_prefix}HAVE_LONG_DOUBLE_IO 1"
+ echo "#define ${macro_prefix}HAVE_PRINTF_FP 0"
+ echo "#define ${macro_prefix}HAVE_LONG_DOUBLE_IO 0"
else
echo "#define ${macro_prefix}HAVE_PRINTF_FP 0"
echo "#define ${macro_prefix}HAVE_LONG_DOUBLE_IO 0"
****************************************************************************
Brad Garcia
___/ __ / __ / ___/ "I'm very good at being concise
__/ / / / _/ __/ at the expense of information"
_/ ____/ _/ _| ____/ - me