This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Howto get basic STL running
- From: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- To: ecos-discuss at sources dot redhat dot com, eibach at gdsys dot de
- Date: Wed, 21 Jan 2004 13:42:10 +0100
- Subject: [ECOS] Howto get basic STL running
- Organization: Zylin AS
- References: <1074669063.16438.ezmlm@sources.redhat.com>
> You just have to download STLPort library for www.stlport.org
>
> Then include it into your project.
>
> I have made some hacks, so that it compiles. Most of them are quick and dirty,
> but they work fine for me. Hopefully someone more gifted than me can improve
> them and feed them back to the list.
> I have attached a patch (against STLPort 4.6).
I've applied the patch(there was a small bump in the road, since my
patch command didn't grok the patch format, fixed patch attached), but I
run into problems with include files which I don't understand.
>From my toolchain:
./ecos/gnutools/arm-elf/arm-elf/include/bits/functexcept.h
./ecos/gnutools/arm-elf/arm-elf/include/exception
./ecos/gnutools/arm-elf/arm-elf/include/exception_defines.h
./ecos/gnutools/arm-elf/arm-elf/include/stdexcept
Here is the error messsage:
arm-elf-g++ -MP -MT 'output/stlport/stl/_vector.o' -MT
'output/stlport/stl/_vector.d' -M -MF output/stlport/stl/_vector.d
-I/cygdrive/c/e21/workspace/firmware/stlport -I../romapp/install/include
-I. -mcpu=arm7tdmi -mno-short-load-words -Wall -Wpointer-arith
-Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions
-fvtable-gc -finit-priority -O0 -fexceptions -fno-vtable-gc
-I../gnutools/arm-elf/arm-elf/include stlport/stl/_vector.c
In file included from
/cygdrive/c/e21/workspace/firmware/stlport/config/stlcomp.h:54,
from
/cygdrive/c/e21/workspace/firmware/stlport/stl/_config.h:74,
from
/cygdrive/c/e21/workspace/firmware/stlport/stl/_prolog.h:10,
from
/cygdrive/c/e21/workspace/firmware/stlport/cstddef:23,
from
/cygdrive/c/e21/workspace/firmware/stlport/stl/_algobase.h:35,
from
/cygdrive/c/e21/workspace/firmware/stlport/stl/_vector.h:36,
from stlport/stl/_vector.c:30:
/cygdrive/c/e21/workspace/firmware/stlport/config/stl_gcc.h:266:34:
warning: "__APPLE__" is not defined
In file included from
/cygdrive/c/e21/workspace/firmware/stlport/stl/_alloc.h:68,
from
/cygdrive/c/e21/workspace/firmware/stlport/stl/_vector.h:40,
from stlport/stl/_vector.c:30:
/cygdrive/c/e21/workspace/firmware/stlport/stl/_construct.h:57:6:
warning: "_MSC_VER" is not defined
In file included from
/cygdrive/c/e21/workspace/firmware/stlport/stdexcept:37,
from
/cygdrive/c/e21/workspace/firmware/stlport/stl/_range_errors.h:47,
from
/cygdrive/c/e21/workspace/firmware/stlport/stl/_vector.h:52,
from stlport/stl/_vector.c:30:
/cygdrive/c/e21/workspace/firmware/stlport/exception:58:56:
../3.2.1/exception.h: No such file or directory
make: *** [output/stlport/stl/_vector.d] Error 1
diff -aur ../STLport-4.6/stlport/cstdio stlport/cstdio
--- ../STLport-4.6/stlport/cstdio 2003-07-21 03:36:41.000000000 +0200
+++ stlport/cstdio 2004-01-21 10:41:45.275408000 +0100
@@ -98,16 +98,20 @@
using _STLP_VENDOR_CSTD::perror;
using _STLP_VENDOR_CSTD::printf;
using _STLP_VENDOR_CSTD::puts;
+# if (!defined (__ECOS__))
using _STLP_VENDOR_CSTD::remove;
using _STLP_VENDOR_CSTD::rename;
+# endif
using _STLP_VENDOR_CSTD::rewind;
using _STLP_VENDOR_CSTD::scanf;
using _STLP_VENDOR_CSTD::setbuf;
using _STLP_VENDOR_CSTD::setvbuf;
using _STLP_VENDOR_CSTD::sprintf;
using _STLP_VENDOR_CSTD::sscanf;
+# if (!defined (__ECOS__))
using _STLP_VENDOR_CSTD::tmpfile;
using _STLP_VENDOR_CSTD::tmpnam;
+#endif
using _STLP_VENDOR_CSTD::ungetc;
using _STLP_VENDOR_CSTD::vfprintf;
using _STLP_VENDOR_CSTD::vprintf;
diff -aur ../STLport-4.6/stlport/new.h stlport/new.h
--- ../STLport-4.6/stlport/new.h 2003-10-09 05:30:02.000000000 +0200
+++ stlport/new.h 2004-01-21 10:51:47.691640000 +0100
@@ -21,6 +21,17 @@
# define _STLP_DONT_POP_0x848
# endif
+
+
+#ifdef __ECOS__
+// Default placement versions of operator new.
+inline void* operator new(size_t, void* __p) throw() { return __p; }
+inline void* operator new[](size_t, void* __p) throw() { return __p; }
+
+// Default placement versions of operator delete.
+inline void operator delete (void*, void*) throw() { };
+inline void operator delete[](void*, void*) throw() { };
+#else
# ifndef _STLP_WINCE
# if defined (__BORLANDC__)
# include <new.>
@@ -33,7 +44,9 @@
# include _STLP_NATIVE_CPP_RUNTIME_HEADER(new.h)
# endif
# endif
-# endif /* STL_WINCE */
+# endif
+#endif // __ECOS__
+
# if (_STLP_OUTERMOST_HEADER_ID == 0x848)
# if ! defined (_STLP_DONT_POP_0x848)
diff -aur ../STLport-4.6/stlport/stl/_alloc.h stlport/stl/_alloc.h
--- ../STLport-4.6/stlport/stl/_alloc.h 2003-10-21 05:45:48.000000000 +0200
+++ stlport/stl/_alloc.h 2004-01-21 10:45:03.079836800 +0100
@@ -119,7 +119,7 @@
}
};
-
+#ifndef __ECOS__
// New-based allocator. Typically slower than default alloc below.
// Typically thread-safe and more storage efficient.
class _STLP_CLASS_DECLSPEC __new_alloc {
@@ -134,7 +134,7 @@
static void* _STLP_CALL allocate(size_t __n) { return __stl_new(__n); }
static void _STLP_CALL deallocate(void* __p, size_t) { __stl_delete(__p); }
};
-
+#endif
// Allocator adaptor to check size arguments for debugging.
// Reports errors using assert. Checking can be disabled with
diff -aur ../STLport-4.6/stlport/stl/_config.h stlport/stl/_config.h
--- ../STLport-4.6/stlport/stl/_config.h 2003-11-01 00:53:47.000000000 +0100
+++ stlport/stl/_config.h 2004-01-21 10:45:59.751326400 +0100
@@ -471,7 +471,7 @@
/* if using stlport:: namespace or if C library stuff is not in vendor's std::,
* try importing 'em.
* MSVC has ambiguity problem when we try to import C-style std:: stuff back into global namespace */
-# if defined (_STLP_USE_NAMESPACES) && /* ! defined (_STLP_OWN_IOSTREAMS) && */ \
+# if defined (_STLP_USE_NAMESPACES) && /* ! defined (_STLP_OWN_IOSTREAMS) && */ !defined (__ECOS__) &&\
( defined(_STLP_USE_OWN_NAMESPACE) || defined (_STLP_VENDOR_GLOBAL_CSTD))
# define _STLP_IMPORT_VENDOR_CSTD 1
# endif
diff -aur ../STLport-4.6/stlport/stl/_threads.h stlport/stl/_threads.h
--- ../STLport-4.6/stlport/stl/_threads.h 2003-10-22 19:58:59.000000000 +0200
+++ stlport/stl/_threads.h 2004-01-21 10:46:39.117932800 +0100
@@ -52,7 +52,7 @@
# else
# if defined (_STLP_USE_NAMESPACES) && ! defined (_STLP_VENDOR_GLOBAL_CSTD)
// using _STLP_VENDOR_CSTD::size_t;
-using namespace _STLP_VENDOR_CSTD;
+//using namespace _STLP_VENDOR_CSTD;
# endif
typedef size_t __stl_atomic_t;
#endif
diff -aur ../STLport-4.6/stlport/stl_user_config.h stlport/stl_user_config.h
--- ../STLport-4.6/stlport/stl_user_config.h 2003-07-23 21:51:51.000000000 +0200
+++ stlport/stl_user_config.h 2004-01-21 12:43:02.940176000 +0100
@@ -62,7 +62,7 @@
* Use this switch for embedded systems where no iostreams are available
* at all. STLport own iostreams will also get disabled automatically then.
*/
-// # define _STLP_NO_IOSTREAMS 1
+# define _STLP_NO_IOSTREAMS 1
/*
* Set _STLP_DEBUG to turn the "Debug Mode" on.
@@ -197,6 +197,19 @@
//==========================================================
+#define __ECOS__
+#define __CYGWIN__
+#define _STLP_NO_NEW_C_HEADERS
+#define _STLP_NO_NEW_NEW_HEADER
+#define _STLP_NO_OWN_NAMESPACE
+#define _STLP_USE_MALLOC
+#define _STLP_NODE_ALLOC_USE_MALLOC
+#define _STLP_NO_WCHAR_T
+//#define _STLP_DEBUG_ALLOC
+//#define __INTEL_COMPILER 0
+//#define __APPLE__ 0
+
+
// Local Variables:
// mode:C++
// End:
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss