Search found 15 matches

by BigEvilCorporation
Tue Oct 16, 2018 4:59 pm
Forum: Programming Discussion
Topic: KOS - static initialisation failure: __gnu_cxx::__concurrence_lock_error
Replies: 17
Views: 1389

Re: KOS - static initialisation failure: __gnu_cxx::__concurrence_lock_error

Well, this has taken a month (on and off) to track down but my game is finally running again. TL;DR version: pay attention to your compiler warnings, kids! Long version: The actual error in question turned out to be spurious after I moved code around and started getting different types of failures, ...
by BigEvilCorporation
Tue Sep 11, 2018 10:09 am
Forum: Programming Discussion
Topic: KOS - static initialisation failure: __gnu_cxx::__concurrence_lock_error
Replies: 17
Views: 1389

Re: KOS - static initialisation failure: __gnu_cxx::__concurrence_lock_error

Ok i dunno if this is related, but I discovered a while back that building KOS with a recent GCC would absolutely screw up the c++ standard library. The solution was to go back to compiling the toolchain itself with GCC 4.X. Maybe it's that? That's interesting - I'm making some use of C++11 feature...
by BigEvilCorporation
Tue Sep 11, 2018 8:05 am
Forum: Programming Discussion
Topic: KOS - static initialisation failure: __gnu_cxx::__concurrence_lock_error
Replies: 17
Views: 1389

Re: KOS - static initialisation failure: __gnu_cxx::__concurrence_lock_error

I did try without const, and modifying the data to tell the optimiser to leave it alone, but same story. Turns out it's a bad test - VC++ adds the whole blob to the EXE (the compiled Win32 exe grows as I increase that buffer size), but for ELF it seems to mark it as allocated in a map, and manually ...
by BigEvilCorporation
Tue Sep 11, 2018 6:20 am
Forum: Programming Discussion
Topic: KOS - static initialisation failure: __gnu_cxx::__concurrence_lock_error
Replies: 17
Views: 1389

Re: KOS - static initialisation failure: __gnu_cxx::__concurrence_lock_error

Ok after further investigation, looks like objcopy is stripping things it shouldn't. EDIT: the resulting ELF from this sample: #include <stdio.h> static const char data[1024 * 1024 * 4] = { 0 }; int main() { printf("H E L L O W O R L D %c\n", data[1024]); return 0; } is only 1776kb. That data chunk...
by BigEvilCorporation
Sun Sep 09, 2018 8:03 am
Forum: Programming Discussion
Topic: KOS - static initialisation failure: __gnu_cxx::__concurrence_lock_error
Replies: 17
Views: 1389

KOS - static initialisation failure: __gnu_cxx::__concurrence_lock_error

Hi, I've been banging my head against a wall for days trying to figure out why my (once working with KOS back in 2016) project is no longer booting after updating KOS to latest and greatest. During startup, after KOS init and before main(), I get this error during static initialisation: terminate ca...
by BigEvilCorporation
Wed Aug 22, 2018 5:45 am
Forum: Programming Discussion
Topic: KOS G++ linker bug - "L" after "I" stripped (MSYS2)
Replies: 3
Views: 617

Re: KOS G++ linker bug - "L" after "I" stripped (MSYS2)

I managed to work around the issue by moving my codebase to c:\dev, I suspect this might be a poorly handled max path issue. Perhaps paths overflow a text buffer somewhere, and an unrelated parser starts stripping from the next consecutive area of memory. Just a theory. Anyway, it seems to be workin...
by BigEvilCorporation
Tue Aug 21, 2018 8:36 am
Forum: Programming Discussion
Topic: KOS G++ linker bug - "L" after "I" stripped (MSYS2)
Replies: 3
Views: 617

KOS G++ linker bug - "L" after "I" stripped (MSYS2)

Hi, Bit of an odd issue this one. I use the KOS toolchain on MSYS2 MingW32 (Win10) built from source, using the jamplus build system. I recently ran into an issue where some files passed to sh-elf-g++.exe would have the L character stripped when following an I. I found two examples. Passing this to ...
by BigEvilCorporation
Mon Jan 02, 2017 8:20 am
Forum: Programming Discussion
Topic: KGL - glLoadMatrixf() not behaving as expected
Replies: 10
Views: 717

Re: KGL - glLoadMatrixf() not behaving as expected

maybe you usually program in C++ and are used to the function overload to sinf? Yeah that was the first issue. The cosf/sinf/sqrtf versions in stdlib are still broken, though. Once the new cables for my Katana kit arrive I can debug it properly and see what's going on. Without floats working in pri...
by BigEvilCorporation
Mon Jan 02, 2017 7:10 am
Forum: Programming Discussion
Topic: KGL - glLoadMatrixf() not behaving as expected
Replies: 10
Views: 717

Re: KGL - glLoadMatrixf() not behaving as expected

Solved! The problem is the cosf/sinf/sqrtf funcs in the stdlib math.h. If I replace them all with fcos/fsin/fsqrt defined in kernel/arch/dc/fmath.h my matrix problems go away. I'll need to bear this in mind when building any third party libs, though :( I'll have a look at the vertex winding another ...
by BigEvilCorporation
Sun Jan 01, 2017 8:14 pm
Forum: Programming Discussion
Topic: KGL - glLoadMatrixf() not behaving as expected
Replies: 10
Views: 717

Re: KGL - glLoadMatrixf() not behaving as expected

Update: I have suspicions that my glLoadMatrixf() problems are caused by double precision math funcs in an m4-single-only environment. On Windows, all usages of sin/cos/atan/sqrt in my matrix maths evaluate to float overloaded versions, but in KOS they evaluate to the double versions. I've explicitl...
by BigEvilCorporation
Sun Jan 01, 2017 2:49 pm
Forum: Programming Discussion
Topic: KGL - glLoadMatrixf() not behaving as expected
Replies: 10
Views: 717

Re: KGL - glLoadMatrixf() not behaving as expected

Thank you! If he's busy then I'll check out the source and track these bugs down when I get a chance. I can see the packaged source on SourceForge, is there an official repository that takes pull requests, or should I just make patches? For now I can get around it by pre-processing my vertex buffers...
by BigEvilCorporation
Sun Jan 01, 2017 9:07 am
Forum: Programming Discussion
Topic: KGL - glLoadMatrixf() not behaving as expected
Replies: 10
Views: 717

Re: KGL - glLoadMatrixf() not behaving as expected

Might be a red herring, there seems to be something wrong with the ftoa() implementation, and those floats are printing incorrectly. Same result with sprintf, printf, std::cout and std::stringstream, so whatever's broken there seems to be low level. If I shove some integers at glLoadMatrix and read ...
by BigEvilCorporation
Sat Dec 31, 2016 7:51 am
Forum: Programming Discussion
Topic: KGL - glLoadMatrixf() not behaving as expected
Replies: 10
Views: 717

KGL - glLoadMatrixf() not behaving as expected

Hi! I've ported my core engine and renderer over to KOS, and have a test program building under both Windows and KOS, but I'm having difficulty getting KGL to behave consistently with the Windows implementation. First off, I noticed the vertex winding seems to be backwards, and glFrontFace() doesn't...
by BigEvilCorporation
Wed Dec 28, 2016 1:04 pm
Forum: Programming Discussion
Topic: KOS on MSYS2 with custom build system - linker errors
Replies: 3
Views: 325

Re: KOS on MSYS2 with custom build system - linker errors

Normally, this is handled by surrounding those three libraries "-Wl,--start-group" and "-Wl,--end-group" when invoking sh-elf-gcc to do the linking ("-Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group"). 1> @ C.kos.Link <dreamcast!debug:dctest>dctest 1> *** updated 1 target(s)... 1> *** finishe...
by BigEvilCorporation
Tue Dec 27, 2016 11:01 am
Forum: Programming Discussion
Topic: KOS on MSYS2 with custom build system - linker errors
Replies: 3
Views: 325

KOS on MSYS2 with custom build system - linker errors

Hi all, I have the KOS toolchain built on Windows under MSYS2, and I'm setting it up with the JamPlus build system. I've got as far as linking, and I'm having difficulty finding which objs contain "_gettimeofday_r" and "_sbrk". I can find some *UND* (referenced but undefined) stubs in libkallisti.a:...