Open GoogleCodeExporter opened 9 years ago
Hi
We're definitely interested in C++ support. Would you like commit access? That
way you can add these modifications yourself.
If you're interested in more C++ support, Spiller was working on it for his
"dingkit", which is built on flatmush original toolchain. I don't know in what
condition it is however.
http://boards.dingoonity.org/dingoo-development/giving-up-and-back/
Original comment by hart...@gmail.com
on 12 Jul 2010 at 9:05
Hi, harteex!
Ok, i like commit access :-)
I will add zlib & tinyxml (C libs) in emulator, so i will test C and C++ code
mix.
PS .bss section must include *(.bss*) sections from objs (i found a bug with
uninitialized static vars (C++ code in namespaces and inside functions)).
Original comment by djd...@gmail.com
on 12 Jul 2010 at 10:28
Alright, you now have commit access.
The more testing, the better ;)
Original comment by hart...@gmail.com
on 13 Jul 2010 at 4:50
I'll assign this issue to you now. BTW, thanks for the commits!
Original comment by hart...@gmail.com
on 17 Jul 2010 at 9:32
Hello! :)
I added stlport library to dingoo-sdk/include/stlport (without streams).
It is not required additional library build, only include headers.
Commit this?
this code works:
----------------
#include <string>
#include <map>
#include <vector>
void* g_pGameDecodeBuf = NULL;
int main(int argc, char**argv)
{
using namespace std;
string path = argv[0];
string::size_type p = path.rfind('/');
if(p == string::npos)
p = path.rfind('\\');
if(p == string::npos)
return -1;
path = path.substr(0, p + 1);
path += "stl_test.log";
map<string, string> string_map;
string_map["key_petya"] = "Petya is a bad guy!";
string_map["key_vasya"] = "Vasily is a good boy ;-)";
vector<string> string_vec;
string_vec.push_back("vector test failed");
string_vec.push_back("vector test unknown");
string_vec.push_back("vector test passed");
FILE* f = fopen(path.c_str(), "w");
string p1 = string("Is stlport") + " works?";
fputs(p1.c_str(), f);
fputs("\n", f);
fputs(string_map["key_vasya"].c_str(), f);
fputs("\n", f);
for(vector<string>::const_iterator it = string_vec.begin(); it != string_vec.end(); ++it)
{
fputs(it->c_str(), f);
fputs("\n", f);
}
fclose(f);
return 0;
}
Original comment by djd...@gmail.com
on 1 Aug 2010 at 9:43
How does it work then, with only include files? Is it using the libs that came
with the toolchain?
In the long run it's better to port libs to the dingoo, but feel free to commit
this in the meantime.
Original comment by hart...@gmail.com
on 2 Aug 2010 at 5:26
[deleted comment]
It has mode _STLP_NO_IOSTREAMS, then only headers used, without building
library.
It used c-libs from this sdk.
I can post patch, you can test it.
Original comment by djd...@gmail.com
on 2 Aug 2010 at 7:58
Attachments:
after patching SDK, ./install it.
then in makefile use
LIBS = -lc -ljz4740 -lgcc -lstdc++
INCLUDE = -I$(DINGOO_SDK)/include -I$(DINGOO_SDK)/include/stlport
-I$(MIPSTOOLS)/mipsel-linux/include -I. -I$
STD_OPTS = -G0 -O3 $(INCLUDE) -Wall -finline-functions -fomit-frame-pointer
-msoft-float -fno-builtin -fno-exceptions -mips32 -mno-abicalls -fno-pic -c
-DMPU_JZ4740 -DNDEBUG -D_DINGOO -DNO_PREFETCH
CPP_OPTS = $(STD_OPTS) -fno-rtti -fno-threadsafe-statics
Original comment by djd...@gmail.com
on 2 Aug 2010 at 8:02
Ah ok, I see.
I don't have time to play around with it now, but it sounds good. Feel free to
commit.
Original comment by hart...@gmail.com
on 3 Aug 2010 at 8:33
i did it! :)
Original comment by djd...@gmail.com
on 3 Aug 2010 at 10:46
Great :)
Btw, if you have time, I noticed virtual members doesn't work.
undefined reference to `vtable for __cxxabiv1::__class_type_info'
undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
I used the virtual members example from this page (without the streams of
course):
http://www.cplusplus.com/doc/tutorial/polymorphism/
Original comment by hart...@gmail.com
on 4 Aug 2010 at 6:58
Hello, harteex!
It is because of runtime type info (RTTI) is enabled by default.
I see you don't use dynamic_cast, typeid, etc.. in this examples.
Try to compile with this options:
STD_OPTS = -G0 -O3 $(INCLUDE) -Wall -finline-functions -fomit-frame-pointer
-msoft-float -fno-builtin -fno-exceptions -mips32 -mno-abicalls -fno-pic -c
-DMPU_JZ4740 -DNDEBUG -D_DINGOO
CPP_OPTS = $(STD_OPTS) -fno-rtti -fno-threadsafe-statics
Original comment by djd...@gmail.com
on 4 Aug 2010 at 7:16
Now only basic C++ functionality was added:
1. new/delete operators.
2. static constructors/destructors call.
3. stub for pure virtual function call.
More advanced unimplemented features:
RTTI, exceptions. I dont know how to implement this now.
If you want you can look at our "unreal speccy portable" sources, we used
virtual functions, and they works fine :)
Original comment by djd...@gmail.com
on 4 Aug 2010 at 7:33
Seems to compile OK now, thanks. I'll play around with it a bit more later.
Original comment by hart...@gmail.com
on 4 Aug 2010 at 7:55
Original comment by Flatmush@googlemail.com
on 12 Feb 2011 at 12:33
Original issue reported on code.google.com by
djd...@gmail.com
on 11 Jul 2010 at 11:27