Manually loading shared object

This forum is for general developer support questions.

Re: Manually loading shared object

Postby salass00 » Sat Jul 29, 2017 9:59 pm

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
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 486
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: Manually loading shared object

Postby capehill » Sun Jul 30, 2017 9:40 am

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:
capehill
 
Posts: 17
Joined: Sun Jun 18, 2017 2:07 pm

Re: Manually loading shared object

Postby capehill » Tue Aug 01, 2017 7:49 pm

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?
capehill
 
Posts: 17
Joined: Sun Jun 18, 2017 2:07 pm

Re: Manually loading shared object

Postby softwarefailure » Wed Aug 02, 2017 12:29 pm

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.
softwarefailure
 
Posts: 80
Joined: Fri Feb 14, 2014 11:29 pm

Re: Manually loading shared object

Postby broadblues » Wed Aug 02, 2017 6:52 pm

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.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 484
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: Manually loading shared object

Postby capehill » Tue Sep 12, 2017 8:23 pm

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.
capehill
 
Posts: 17
Joined: Sun Jun 18, 2017 2:07 pm

Previous

Return to General Developer Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron