After some sweating I have managed to create sdl2.library. It doesn't work of course, but crashes on pthread_key_create().
Code: Select all
(0x57C49C70) [source/linklib/lib.c:380] CURRDIR:sdl2.library:pthread_key_create()+0x24 (section 1 @ 0xB5180)
(0x57C49C80) CURRDIR:sdl2.library:SDL_SYS_GetTLSData()+0xcc (section 1 @ 0x5D330)
(0x57C49CB0) CURRDIR:sdl2.library:SDL_GetErrBuf()+0x94 (section 1 @ 0x3C0E4)
(0x57C49CD0) CURRDIR:sdl2.library:SDL_ClearError()+0x10 (section 1 @ 0x30F8)
(0x57C49CE0) CURRDIR:sdl2.library:SDL_InitSubSystem()+0x2c (section 1 @ 0x24F4)
(0x57C49CF0) a.out:main()+0x38 (section 1 @ 0x38C)
(0x57C49D00) native kernel module Kickstart/newlib.library.kmod+0x00002194
(0x57C49D60) native kernel module Kickstart/newlib.library.kmod+0x00003074
(0x57C49F10) native kernel module Kickstart/newlib.library.kmod+0x00003340
(0x57C49F40) a.out:_start()+0x174 (section 1 @ 0x170)
(0x57C49F90) native kernel module Kickstart/dos.library.kmod+0x00026728
(0x57C49FC0) native kernel module Kickstart/kernel+0x0003e9a8
(0x57C49FD0) native kernel module Kickstart/kernel+0x0003e9f0
Is it allowed to link static libraries, such as libpthread.a to a native library? Should I implement a native threading solution rather?
EDIT: I called __init_threads() now manually, and it crashed now in a different place:
Code: Select all
(0x5AE71C40) LIBS:pthreads.library:hash_table_find_specific()+0x28 (section 1 @ 0x5A50)
(0x5AE71C50) LIBS:pthreads.library:get_key()+0x18 (section 1 @ 0x2190)
(0x5AE71C70) [source/linklib/lib.c:401] CURRDIR:sdl2.library:pthread_getspecific()+0x28 (section 1 @ 0xB52B8)
(0x5AE71C80) CURRDIR:sdl2.library:SDL_SYS_GetTLSData()+0x64 (section 1 @ 0x5D2E4)
(0x5AE71CB0) CURRDIR:sdl2.library:SDL_GetErrBuf()+0x94 (section 1 @ 0x3C100)
(0x5AE71CD0) CURRDIR:sdl2.library:SDL_ClearError()+0x10 (section 1 @ 0x3114)
(0x5AE71CE0) CURRDIR:sdl2.library:SDL_InitSubSystem()+0x2c (section 1 @ 0x2510)
(0x5AE71CF0) a.out:main()+0x38 (section 1 @ 0x38C)
(0x5AE71D00) native kernel module Kickstart/newlib.library.kmod+0x00002194
(0x5AE71D60) native kernel module Kickstart/newlib.library.kmod+0x00003074
(0x5AE71F10) native kernel module Kickstart/newlib.library.kmod+0x00003340
(0x5AE71F40) a.out:_start()+0x174 (section 1 @ 0x170)
(0x5AE71F90) native kernel module Kickstart/dos.library.kmod+0x00026728
(0x5AE71FC0) native kernel module Kickstart/kernel+0x0003e9a8
(0x5AE71FD0) native kernel module Kickstart/kernel+0x0003e9f0