Page 4 of 4

Re: Manually loading shared object

PostPosted: Sat Jul 29, 2017 9:59 pm
by salass00
capehill wrote:I'm not able to build a helloworld with clib2, I get undefined reference to GetProgramName. viewtopic.php?f=27&t=3194&hilit=getprogramname


There's an updated build of clib2 on OS4Depot which should fix that issue:

http://os4depot.net/index.php?function= ... /clib2.lha

Re: Manually loading shared object

PostPosted: Sun Jul 30, 2017 9:40 am
by capehill
salass00 wrote:
capehill wrote:I'm not able to build a helloworld with clib2, I get undefined reference to GetProgramName. viewtopic.php?f=27&t=3194&hilit=getprogramname


There's an updated build of clib2 on OS4Depot which should fix that issue:

http://os4depot.net/index.php?function= ... /clib2.lha


Cheers, I totally forgot to check OS4depot! :oops:

Re: Manually loading shared object

PostPosted: Tue Aug 01, 2017 7:49 pm
by capehill
softwarefailure wrote:Since nobody has an idea what's wrong here I've now requested a clib2 static link library build of SDL2:
https://sourceforge.net/p/sdl2-amigaos4/tickets/29/

Let's hope that this materialises so that I can finally finish this plugin for OS4...


It's possible to build libSDL2.a with -mcrt=clib2, but not with -mcrt=clib2-ts (-lgcc missing).

Now creating sdl2.library was an interesting suggestion. It sounds like a lot of work though. SDL2 relies on C library functions a lot so this may be a potential issue. I assume that newlib could be used though.

A native thread implementation for SDL2 might be easier goal, assuming SDL1 version can be referenced.

What features/subsystems of SDL2 do you require for your plugin?

Re: Manually loading shared object

PostPosted: Wed Aug 02, 2017 12:29 pm
by softwarefailure
What features/subsystems of SDL2 do you require for your plugin?


I don't require threads. I just require the following subsystems: SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_JOYSTICK|SDL_INIT_GAMECONTROLLER|SDL_INIT_AUDIO. So if you can provide a clib2 version for that it would already be sufficient. Threads aren't necessary for my plugin.

Re: Manually loading shared object

PostPosted: Wed Aug 02, 2017 6:52 pm
by broadblues
capehill wrote:
softwarefailure wrote:Since nobody has an idea what's wrong here I've now requested a clib2 static link library build of SDL2:
https://sourceforge.net/p/sdl2-amigaos4/tickets/29/

Let's hope that this materialises so that I can finally finish this plugin for OS4...


It's possible to build libSDL2.a with -mcrt=clib2, but not with -mcrt=clib2-ts (-lgcc missing).


If using a recent gcc I think you need to do this.
makelink from SDK:gcc/lib/gcc/ppc-amigaos/5.4.0/clib2-ts to SDK:gcc/lib/gcc/ppc-amigaos/5.4.0/clib2

Now creating sdl2.library was an interesting suggestion. It sounds like a lot of work though. SDL2 relies on C library functions a lot so this may be a potential issue. I assume that newlib could be used though.


It's use of clibrary function is only an issue if the API requires you to pass things like sockets and filehandles as arguments, and malloc is not used, (or at least no malloced memeory is pass the to caller to free) being gfx related I'd think this was un likelty, but you never know... If all clibrary usage is internal either clib2 or newlib can easily be used in a library.

Re: Manually loading shared object

PostPosted: Tue Sep 12, 2017 8:23 pm
by capehill
softwarefailure wrote:
What features/subsystems of SDL2 do you require for your plugin?


I don't require threads. I just require the following subsystems: SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_JOYSTICK|SDL_INIT_GAMECONTROLLER|SDL_INIT_AUDIO. So if you can provide a clib2 version for that it would already be sufficient. Threads aren't necessary for my plugin.


SDL audio needs threads and mutexes.