Page 1 of 1

PS2SDK Bugfix marathon

Posted: Wed Jul 07, 2004 2:32 pm
by Warren
There will be a PS2SDK bug squashing marathon starting Monday, July 12th.

Please list any known bugs in this thread and indicate whether or not you can help.

Bugs:
- Lack of proper C++ support
- Depenancy on newlib (mrbrown can you help here?)
- $(PS2LIB) still being used in places
- things break when using an installed version of ps2sdk vs stuff compiled in ps2sdk source dir

Posted: Wed Jul 07, 2004 2:57 pm
by mrbrown
When ps2sdk was being discussed, Oobles was going to copy the ps2lib and ps2drv files on the CVS server to preserve CVS history. This didn't happen, instead he imported the sources from a checked out copy. He and Lukasz also redid the build system. There are a lot of hacks in the source and Makefiles related to this.

If the files are matched 1:1 and the build system restored, everything should work as it did in ps2lib and ps2drv. The ps2drv build system should be used instead of ps2lib's build system.

As far as C++ support goes, it works, I'm not sure what's not "proper" about it. Our crt0.s is not compliant with how ELF/SysV wants to do program initialization, so adding calls to _init() before the call to main() and _fini() after main() (before exit()) should do the trick. There are plenty of non-MIPS crt0's or crt1's to use as examples (see the directory newlib/libc/sys/ in newlib).

Anyway, I committed something that should hopefully take care of the dependency on newlib problem.

As far as $(PS2LIB)/$(PS2DRV) being used in other projects - leave them be. Don't force ps2sdk down folks throats, especially when it isn't ready yet.

Re: PS2SDK Bugfix marathon

Posted: Wed Jul 07, 2004 3:01 pm
by Drakonite
Warren wrote: - things break when using an installed version of ps2sdk vs stuff compiled in ps2sdk source dir
This has been a peive of mine as well. My understanding is that nothing should be using $(PS2SDKSRC) unless it's part of ps2sdk, yet I've seen numerous things using it that are not in ps2sdk. Granted, at least a couple of them are intended for inclusion in ps2sdk once they are finished, But I still felt this worth bitching about..

Another problem is the permissions that are chmod'd to by make dist are wrong. They should be 644 not 622. I'm fixing that right now.

Posted: Thu Jul 08, 2004 6:43 am
by Warren
So I cheated and started early last night.

I fixed all the $(PS2LIB) references and fixed the library link order in the makefile.eeglobal_cpp in ps2sdk/samples to compile things with oopo's beta toolcahin build script.

Current .cpp linkage is:
EE_LIBS += -lc -lkernel -lstdc++ -lc -lkernel -lsyscall

Right now it still relies of libstdc++ (is this newlib?) and takes the crt0.o from newlib (I had to overwrite it with ps2sdk's).

I was also talking to loser about cpp stuff and he was saying he had to manually link in ctri and crtn but then something else didn't work.

I don't know a whole lot about compilers and such but I'm willing to give getting this stuff working a shot if someone can point me in the right direction.

Posted: Thu Jul 08, 2004 7:09 am
by ooPo
Newlib is a C library. Gcc provides its own C++ library called libstdc++.

Posted: Thu Jul 08, 2004 7:17 am
by pixel
And libstdc++ requires newlib. At least, for some parts.

Posted: Thu Jul 08, 2004 7:20 am
by mrbrown
If libsyscall is put back into libkernel where it's supposed to be, you should be able to simplify the library line to "-lstdc++ -lc -lkernel". If no one else gets to it I'll look at it tonite.