diff --git a/src/bin/launcher/Makefile b/src/bin/launcher/Makefile index c6a59c1..516d176 100644 --- a/src/bin/launcher/Makefile +++ b/src/bin/launcher/Makefile @@ -21,7 +21,7 @@ OBJS = launcher.o ubixButton.o ubixDesktop.o #Libraries -LIBRARIES2 = ../../lib/objgfx40/*.o ../../lib/libcpp/*.o ../../lib/views/sunlight/*.o +LIBRARIES2 = ../../lib/objgfx40/*.o ../../lib/libcpp/*.o ../../lib/views/sunlight/*.o ../../lib/libstdc++/*.o #Include INCLUDE = -I../../lib/libc/include -I../../lib/libcpp/include -I../../lib/objgfx40/objgfx40 -I../../lib/views/sunlight/include -I./include @@ -36,7 +36,7 @@ # Compile the source files .cpp.o: - $(CXX) -Wall -fomit-frame-pointer -O $(CFLAGS) $(INCLUDE) -c -o $@ $< + $(CXX) -Wall -nostdlib -fomit-frame-pointer -O $(CFLAGS) $(INCLUDE) -c -o $@ $< .cc.o: $(CXX) -Wall -fomit-frame-pointer -O $(CFLAGS) $(INCLUDE) -c -o $@ $< diff --git a/src/bin/launcher/launcher.cpp b/src/bin/launcher/launcher.cpp index e7dfb62..0e30dd4 100644 --- a/src/bin/launcher/launcher.cpp +++ b/src/bin/launcher/launcher.cpp @@ -3,6 +3,7 @@ #include #include #include +#include int main(void) { diff --git a/src/lib/libcpp/include/libcpp.h b/src/lib/libcpp/include/libcpp.h index 596455b..78f02c8 100644 --- a/src/lib/libcpp/include/libcpp.h +++ b/src/lib/libcpp/include/libcpp.h @@ -6,8 +6,4 @@ void * operator new[](unsigned size); void operator delete[](void * ptr); -template -class __default_alloc_template { - }; - #endif diff --git a/src/lib/libcpp/libcpp.cc b/src/lib/libcpp/libcpp.cc index 52beaa9..9ce0ea6 100644 --- a/src/lib/libcpp/libcpp.cc +++ b/src/lib/libcpp/libcpp.cc @@ -4,31 +4,10 @@ /* Don't Touch Mark */ void __pure_virtual() { while(1); } void __cxa_pure_virtual() { while(1); } -/* Don't Touch Mark */ - - void * __dynamic_cast(void *a,void *b,void *c,void *d) { - return(0x0); - } - void * __rtti_user(void *a,void *b) { - return(0x0); - } - void * __rtti_class(void *a,void *b,void *c,void *d) { - return(0x0); - } - void * __rtti_si(void *a,void *b,void *c) { - return(0x0); - } - void __eprintf(void *a,void *b,void *c,void *d) { - return; - } - } +} #include -typedef char c; - -template class __default_alloc_template<0, 0>; - /* Don't Touch Mark */ void * operator new[](unsigned size) { diff --git a/src/lib/libstdc++/sinst.cc b/src/lib/libstdc++/sinst.cc index 385e0e7..b40cc3b 100644 --- a/src/lib/libstdc++/sinst.cc +++ b/src/lib/libstdc++/sinst.cc @@ -1,11 +1,42 @@ #include +extern "C" { + void * __dynamic_cast(void *a,void *b,void *c,void *d) { + return(0x0); + } + void * __rtti_user(void *a,void *b) { + return(0x0); + } + void * __rtti_class(void *a,void *b,void *c,void *d) { + return(0x0); + } + void * __rtti_si(void *a,void *b,void *c) { + return(0x0); + } + void __eprintf(void *a,void *b,void *c,void *d) { + return; + } +} + + typedef char c; template class string_char_traits ; -ostream& endl(ostream& outs) +ostream& endl(ostream& outs) { + return flush(outs.put('\n')); + } + +ostream& ostream::flush() { -// return flush(outs.put('\n')); - return('\n'); +// if (_strbuf->sync()) + // set(ios::badbit); + return *this; +} + + + +ostream& flush(ostream& outs) +{ + return outs.flush(); } diff --git a/src/lib/libstdc++/std/straights.h b/src/lib/libstdc++/std/straights.h index e4dbaaa..a5f6b77 100644 --- a/src/lib/libstdc++/std/straights.h +++ b/src/lib/libstdc++/std/straights.h @@ -8,4 +8,29 @@ static void assign (char_type& c1, const char_type& c2) { c1 = c2; } }; +class streambuf;class ios;class istream; class ostream; + +typedef ios& (*__manip)(ios&); +typedef istream& (*__imanip)(istream&); +typedef ostream& (*__omanip)(ostream&); + +extern ostream& flush(ostream& outs); + +struct _ios_fields { // The data members of an ios. + void *test; + }; + + +class ios : public _ios_fields { + public: + ios& test(void) { return *this; } + }; + +class ostream : virtual public ios { + public: + ostream() { } + ostream& put(char c) { return *this; } + ostream& flush(); + }; + } diff --git a/src/lib/objgfx40/Makefile b/src/lib/objgfx40/Makefile index 7382a27..6a81b85 100644 --- a/src/lib/objgfx40/Makefile +++ b/src/lib/objgfx40/Makefile @@ -21,10 +21,10 @@ # Compile the source files .cpp.o: - $(CXX) -Wall -g -fno-exceptions -DNOBOOL $(INCLUDE) -c -o $@ $< + $(CXX) -Wall -g -nostdlib -fno-exceptions -DNOBOOL $(INCLUDE) -c -o $@ $< .cc.o: - $(CXX) -Wall -fomit-frame-pointer -O -nobuilting -I../../lib/libc/include -I./include -S -o $@ $< + $(CXX) -Wall -nostdlib -fomit-frame-pointer -O -nobuilting -I../../lib/libc/include -I./include -S -o $@ $< .c.o: $(CC) -Wall -O -I../../lib/libc/include -c -o $@ $< diff --git a/src/lib/views/sunlight/Makefile b/src/lib/views/sunlight/Makefile index 5b62073..4ae2d08 100644 --- a/src/lib/views/sunlight/Makefile +++ b/src/lib/views/sunlight/Makefile @@ -13,7 +13,7 @@ OUTPUT = views.so $(OUTPUT): $(OBJS) - $(CC) -shared -Wl,-soname,$(OUTPUT) -o $(OUTPUT) $(OBJS) + $(CXX) -nostdlib -shared -Wl,-soname,$(OUTPUT) -o $(OUTPUT) $(OBJS) # Compile the source files .cpp.o: