PDA

View Full Version : KOS environment



GPF
January 5th, 2005, 15:51
had a couple of questions about debug vs release environments for KOS.

right now I am using for my $KOS_CFLAGS


-O2 -DFRAME_POINTERS -ml -m4-single-only -fno-crossjumping -I/usr/local/dc/kos1.3/kos/../kos-ports/include -I/usr/local/dc/kos1.3/kos/include -I/usr/local/dc/kos1.3/kos/kernel/arch/dreamcast/include -I/usr/local/dc/kos1.3/kos/addons/include -D_arch_dreamcast -D_arch_sub_pristine -Wall -g -fno-builtin -fno-strict-aliasing

and thats what my KOS libs were built with.

For a release should I recompile KOS with
-fomit-frame-pointer and remove the -g ? Also Is there any benifit for recompile KOS with more optimizations -O3?

Also with the new gnu-wrappers, if I want to use other compilation environment(different flags/higher optimization), is there an easy way to do that? or do I just have a second environ..sh script that I run when doing builds vs when rebuilding KOS ?

Thanks,
Troy

DanPotter
January 6th, 2005, 11:09
For a release should I recompile KOS with
-fomit-frame-pointer and remove the -g ? Also Is there any benifit for recompile KOS with more optimizations -O3?

Definitely don't go to -O3. It provides little benefit even in the normal x86 type platforms (sometimes it even makes the code slower!) and the optimization on SH-4 is not unbuggy enough either.

For the other, you can do that if you like but it's more of a personal preference. The omit-frame-pointer frees up a general purpose register but I've not found it to make a huge difference, and that introduces differences into the code that could turn into bug entropy.

Removing the -g is also not really necessary because you can just run sh-elf-strip when you're done and remove the symbols, and they won't get copied into a .bin anyway.


Also with the new gnu-wrappers, if I want to use other compilation environment(different flags/higher optimization), is there an easy way to do that? or do I just have a second environ..sh script that I run when doing builds vs when rebuilding KOS ?

Yeah you need a new script. The wrappers didn't change that, you just don't see it anymore. All they do is run your sh-elf GCC with KOS_CFLAGS and all that.

GPF
January 6th, 2005, 11:39
thanks