English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. C/C++ (https://eab.abime.net/forumdisplay.php?f=118)
-   -   WarpOS version of SDL (https://eab.abime.net/showthread.php?t=88760)

grelbfarlk 24 September 2017 04:18

WarpOS version of SDL
 
Does anyone know of or have an SDL link library for WarpOS for GCC 2.95.3?
I have found a StormC version and what I think is a SAS/C version but nothing for GCC or the source for it.

http://aminet.net/package/dev/misc/AmigaSDLstorm4

I am aware of the WarpSDL.library from OnyxSoft.

http://www.onyxsoft.se/warpsdl.html

But no source is available and I'm not smart enough to convert all those to openlibrary calls even if all of the functions are available.

Just as an experiment I tried compiling the old OS4 version of ScummVM 0.11.1 which fails on the OS FS stuff and SDL, but 589 other objects were compiled.

grelbfarlk 28 September 2017 04:03

So I found an older version which includes a WarpOS version and managed to get it all to compile except for the PPC Tasks and Threads part. These didn't compile.

Prerequisite `SDL_syssem.wo' of target `libSDL_wos.a' does not exist.
Prerequisite `SDL_systhread.wo' of target `libSDL_wos.a' does not exist.
Prerequisite `SDL_thread.wo' of target `libSDL_wos.a' does not exist.

ppc-amigaos-gcc -warpup -O2 -fomit-frame-pointer -I./proto -I./devices -I./clib -DENABLE_CYBERGRAPHICS -DENABLE_AHI -DNO_SIGNAL_H -DWARPOS -DNO_AMIGADEBUG -o SDL_syssem.wo -c SDL_syssem.c
In file included from SDL_syssem.c:34:
/ade/os-includeppc/powerpc/semaphoresPPC.h:11: field `ssppc_SS' has incomplete type
make: [SDL_syssem.wo] Error 1 (ignored)
ppc-amigaos-gcc -warpup -O2 -fomit-frame-pointer -I./proto -I./devices -I./clib -DENABLE_CYBERGRAPHICS -DENABLE_AHI -DNO_SIGNAL_H -DWARPOS -DNO_AMIGADEBUG -o SDL_systhread.wo -c SDL_systhread.c
In file included from /ade/os-includeppc/powerpc/portsPPC.h:13,
from /ade/os-includeppc/powerpc/tasksPPC.h:5,
from SDL_systhread.c:68:
/ade/os-includeppc/powerpc/semaphoresPPC.h: In function `RunThread':
/ade/os-includeppc/powerpc/semaphoresPPC.h:11: field `ssppc_SS' has incomplete type
In file included from SDL_systhread.c:68:
/ade/os-includeppc/powerpc/tasksPPC.h:28: field `tp_Task' has incomplete type
SDL_systhread.c: In function `SDL_SYS_CreateThread':
SDL_systhread.c:160: warning: assignment makes pointer from integer without a cast
make: [SDL_systhread.wo] Error 1 (ignored)
ppc-amigaos-gcc -warpup -O2 -fomit-frame-pointer -I./proto -I./devices -I./clib -DENABLE_CYBERGRAPHICS -DENABLE_AHI -DNO_SIGNAL_H -DWARPOS -DNO_AMIGADEBUG -o SDL_thread.wo -c SDL_thread.c
SDL_thread.c: In function `SDL_CreateThread':
SDL_thread.c:227: warning: assignment makes pointer from integer without a cast
SDL_thread.c: At top level:
SDL_thread.c:48: storage size of `thread_lock' isn't known

make: [SDL_thread.wo] Error 1 (ignored)


Which it seems to be complaining about:



In sdlssyemc: Line 38:
struct SDL_semaphore
{
struct SignalSemaphore Sem;
Uint32 count;
Uint32 waiters_count;
SDL_mutex *count_lock;
SDL_cond *count_nonzero;
};
In Semawhoresppc.h:

struct SignalSemaphorePPC {
struct SignalSemaphore ssppc_SS;
APTR ssppc_reserved; /* private */
UWORD ssppc_lock; /* private */
};

grelbfarlk 29 September 2017 02:59

*Update* turns out I wasn't including the right file.

Done, I mean if it works.

emufan 29 September 2017 03:26

the .lib do indeed look like sas/c compatible stuff. fileheader on those gcc made .a look different.

some moons ago I was building successfully sdl with SDL-AmigaSrc.lha.
using Makefile.cross. IIRC i only enabled "-DNO_AMIGADEBUG".

it was build for 68k, not sure about ppc. cannot remember which compiler, maybe
2.95 gcc or the one from AmiDevCpp ( gcc 3.5) - on a win7 box.

Cowcat 29 September 2017 09:40

Grelbfarlk: Can you compile a simple intuition program and test if it works?

emufan 29 September 2017 12:19

Quote:

Originally Posted by Cowcat (Post 1188420)
Grelbfarlk: Can you compile a simple intuition program and test if it works?

I have 3 gcc crosscompiler on my winbox. some sources compile with 2.95,
others with 6.x only. most compatible gcc comes with AmiDevCPP - gcc3.4.

you can use AmiDevCpp's gcc from a dos command shell.

open a cmd, cd to AmiDevCpp/bin and start a bash. basicaly it is a cygwin environment.
after starting bash.exe I only add path:
Code:

export PATH=/cygdrive/d/AmiDevCpp/usr/local/amiga/bin:/cygdrive/d/AmiDevCpp/bin:$PATH
this way you can use ./configure scripts, which is impossible with the AmiDevCpp gui version.
it does also have ppc-amigaos-gcc-4.2.0.exe incl the compiler tools for that.

#1) sometimes it is usefull to use CFLAGS like -std=c99 .
not sure if the following options apply to warpos / ppc aswell:
gcc with -noixemul or -mcrt=clib2 or -mcrt=nix13 or without any of them, can make big difference.

#2) and offten you try to find some errors in the source code, but the troublemaker is the incompatibe compiler ...

Quote:

Originally Posted by grelbfarlk (Post 1188386)
*Update* turns out I wasn't including the right file.

... or the wrong includes :spin

grelbfarlk 30 September 2017 00:45

Very interesting Emufan, I didn't know there was a cross compiler for WarpOS in Amidevcpp. I'll look into that.

Here's the lib if anyone wants to give it a try making it do something. It's compiled in gcc 2.95.3.

Version 1.2.6 (really old).

emufan 30 September 2017 01:11

congrats :spin

1.2.6 is old, but good enough for the amiga. I'm using them for the sdl emulators.
btw. I'm using the includes by Novacoder - SDL_AGA.
take a look at the SDL_config* files. maybe usefull somehow.

grelbfarlk 30 September 2017 01:31

now if I could only figure out how to use ppc-amigaos-g++ to actually link to the thing properly, I might could meet Cowcat's challenge of opening a simple intution window.:banghead

emufan 30 September 2017 02:12

hmm, link with libSDl.a ? something like this:
g++ example.cpp libSDl.a -o example.exe

btw: some good point of AmiDevCpp, it does have the ability to produce binaries,
which uses ixemul.library. this was of great use, when it came to source code with path/directory/filehandling.
this happens if you do not use any of the 3 CFLAGs i wrote above.

grelbfarlk 30 September 2017 02:17

Quote:

Originally Posted by emufan (Post 1188633)
hmm, link with libSDl.a ? something like this:
g++ example.cpp libSDl.a -o example.exe

btw: some good point of AmiDevCpp, it does have the ability to produce binaries,
which uses ixemul.library. this was of great use, when it came to source code with path/directory/filehandling.
this happens if you do not use any of the 3 CFLAGs i wrote above.

Are you sure that the cross compiler for AmiDevCPP works with Warpos? The ppc-amigaos-gcc stuff seems to just be for OS4.

emufan 30 September 2017 02:18

Quote:

Originally Posted by grelbfarlk (Post 1188634)
Are you sure that the cross compiler for AmiDevCPP works with Warpos? The ppc-amigaos-gcc stuff seems to just be for OS4.

I cannot say for sure, never did any ppc stuff, just saw the *ppc* binary :nervous

#1) in the gui i can only find new project for amiga-68k and amiga-OS4. my bad :/

grelbfarlk 30 September 2017 05:06

Pretty sure the lib is a failure. No matter what I try to link it with I get stuff like:
Code:

Error: Undefined Symbol: SDL_LoadBMP_RW
Error: Undefined Symbol: SDL_Quit
Error: Undefined Symbol: SDL_RWFromFile
Error: Undefined Symbol: SDL_Delay
Error: Undefined Symbol: SDL_UpperBlit
Error: Undefined Symbol: SDL_Init
Error: Undefined Symbol: SDL_FreeSurface
Error: Undefined Symbol: SDL_Flip
Error: Undefined Symbol: SDL_SetVideoMode

Or a ton of Undefined Symbols from Intuition, Exec, CGX...
Like this:
Code:

Error: Undefined Symbol: ChangeScreenBuffer
Error: Undefined Symbol: BltMaskBitMapRastPort
Error: Undefined Symbol: OpenScreenTags
Error: Undefined Symbol: ChangeWindowBox
Error: Undefined Symbol: CreateIORequest
Error: Undefined Symbol: WaitTOF
Error: Undefined Symbol: AllocVec
Error: Undefined Symbol: FreeScreenBuffer
Error: Undefined Symbol: ClearPointer
Error: Undefined Symbol: SetPointer
Error: Undefined Symbol: OpenWindowTags
Error: Undefined Symbol: UnlockPubScreen
Error: Undefined Symbol: ReleasePen
Error: Undefined Symbol: CheckIO
Error: Undefined Symbol: DeleteMsgPort
Error: Undefined Symbol: BltBitMap
Error: Undefined Symbol: AllocMem
Error: Undefined Symbol: AbortIO
Error: Undefined Symbol: GetMsg
Error: Undefined Symbol: BltBitMapRastPort
Error: Undefined Symbol: SetWindowTitles
Error: Undefined Symbol: CloseWindow
Error: Undefined Symbol: CreateMsgPort
Error: Undefined Symbol: GetSysTimePPC
Error: Undefined Symbol: LockPubScreen
Error: Undefined Symbol: Wait
Error: Undefined Symbol: PPCCallOS
Error: Undefined Symbol: CloseDevice
Error: Undefined Symbol: AllocScreenBuffer
Error: Undefined Symbol: DeleteIORequest
Error: Undefined Symbol: NextDisplayInfo
Error: Undefined Symbol: AllocBitMap
Error: Undefined Symbol: OpenLibrary
Error: Undefined Symbol: GetVPModeID
Error: Undefined Symbol: SendIO
Error: Undefined Symbol: Delay
Error: Undefined Symbol: WindowLimits
Error: Undefined Symbol: FreeBitMap
Error: Undefined Symbol: ReadJoyPort
Error: Undefined Symbol: FreeVec
Error: Undefined Symbol: CloseScreen
Error: Undefined Symbol: FindDisplayInfo
Error: Undefined Symbol: WaitIO
Error: Undefined Symbol: LoadRGB32
Error: Undefined Symbol: InitRastPort
Error: Undefined Symbol: FreeMem
Error: Undefined Symbol: ReplyMsg
Error: Undefined Symbol: GetDisplayInfoData
Error: Undefined Symbol: ObtainBestPenA
Error: Undefined Symbol: RawKeyConvert
Error: Undefined Symbol: OpenDevice
Error: Undefined Symbol: CloseLibrary


Cowcat 30 September 2017 11:39

As I explained in other thread, the gcc-warpos stuff doesn't work now AFAIK. I asume the compiled gcc binaries/libraries where done with old warpos includes. I tried to correct some of those (specially some function calls inlines that needed more parameters/registers), but no luck for now.

But I don't know any binary done by this gcc version to compare for example with an old or new warpos kernel.

emufan 30 September 2017 12:50

Quote:

Originally Posted by grelbfarlk (Post 1188637)
Pretty sure the lib is a failure. No matter what I try to link it with I get stuff like:
Code:

Error: Undefined Symbol: SDL_LoadBMP_RW
Error: Undefined Symbol: SDL_Quit
Error: Undefined Symbol: SDL_RWFromFile
Error: Undefined Symbol: SDL_Delay
Error: Undefined Symbol: SDL_UpperBlit
Error: Undefined Symbol: SDL_Init
Error: Undefined Symbol: SDL_FreeSurface
Error: Undefined Symbol: SDL_Flip
Error: Undefined Symbol: SDL_SetVideoMode


try the nm command and look if those function are in the libSDL.a:
Code:

$ m68k-amigaos-nm.exe -l libSDL.a | grep SDL_Flip
0000089c T _SDL_Flip

and ensure you have libSDl.a in last position in the object link order.
Quote:

Or a ton of Undefined Symbols from Intuition, Exec, CGX...
Like this:
Code:

Error: Undefined Symbol: ChangeScreenBuffer
Error: Undefined Symbol: BltMaskBitMapRastPort
Error: Undefined Symbol: OpenScreenTags
Error: Undefined Symbol: ChangeWindowBox
Error: Undefined Symbol: CreateIORequest
Error: Undefined Symbol: OpenDevice
Error: Undefined Symbol: CloseLibrary


with the m68k cross compilers those issue may be fixed by using libauto, -lAuto , -lauto.
-noixemul is ment to take care of those aswell.
not all compilers support those commands, or have their functionality, it seems.

phx 30 September 2017 13:33

Quote:

Originally Posted by emufan (Post 1188685)
Quote:

Code:

Error: Undefined Symbol: SDL_Flip

try the nm command and look if those function are in the libSDL.a:
Code:

$ m68k-amigaos-nm.exe -l libSDL.a | grep SDL_Flip
0000089c T _SDL_Flip

and ensure you have libSDl.a in last position in the object link order.

I didn't read all of this thread, but your PPC-gcc seems to be configured for ELF V.4-ABI, not WarpOS PowerOpen-ABI. In ELF the compiler creates (and refers to) symbols without leading underscore. The library, on the other hand, looks like a real WarpOS library with underscores.

emufan 30 September 2017 13:38

Quote:

Originally Posted by phx (Post 1188699)
I didn't read all of this thread

in this case, bad choice :blased
it's about grelbfarlk attemp to create a libsSDl for warpOS.
i only gave some hint on how I did things with building m68k version of libSDL.

but any help is welcome :spin

#1) your vbcc does have support for warpos, does build wos binaries?

#2) zoned: stormc4_gnu_sources.part1.rar stormc4_gnu_sources.part2.rar
which should have wos support?
there are some bin-utils binaries included. not sure if 68k or wos.
project files for StormC4 to rebuild them seems to be there too, also some Makefies.

is StormC4 still being sold? I can find StormC3 only. anyone with StormC4 installer?

#3) tested the bin-utils from stromc archive, no ppc support it seems:
Code:

3.SYS:binutils> nm-new -l ram:libSDL_wos.a
nm-new: SDL_error.wo: File format not recognized
nm-new: SDL_fatal.wo: File format not recognized
nm-new: SDL_yuv.wo: File format not recognized
nm-new: SDL_yuv_sw.wo: File format not recognized
nm-new: SDL_yuv_mmx.wo: File format not recognized
...

the Undefined Symbol are not available. ?

grelbfarlk 30 September 2017 14:11

Quote:

Originally Posted by emufan (Post 1188702)
in this case, bad choice :blased
it's about grelbfarlk attemp to create a libsSDl for warpOS.
i only gave some hint on how I did things with building m68k version of libSDL.

but any help is welcome :spin

#1) your vbcc does have support for warpos, does build wos binaries?

Yeah it does, actually Hedeon suggested trying VBCC to build some of these objects when GCC wasn't giving me any useful errors. That's what lead me to find that it was puking on the includes.

nm says: For SDL_Flip
000012d8 T SDL_Flip
U SDL_FormatChanged (null):0
U SDL_FreeFormat (null):0
U SDL_FreeSurface (null):0

And SDL_Init
0000015c T SDL_Init

emufan 30 September 2017 14:43

Quote:

Originally Posted by grelbfarlk (Post 1188706)
Yeah it does, actually Hedeon suggested trying VBCC to build some of these objects when GCC wasn't giving me any useful errors. That's what lead me to find that it was puking on the includes.

nm says: For SDL_Flip
000012d8 T SDL_Flip
U SDL_FormatChanged (null):0
U SDL_FreeFormat (null):0
U SDL_FreeSurface (null):0

And SDL_Init
0000015c T SDL_Init

I get the same for the 68k version. with different offset and leading "_".
hmm, you did link with the correct version: g++ ... libSDL_wos.a
dont use -lSDL to ensure you link with the correct one.

grelbfarlk 30 September 2017 14:47

Quote:

Originally Posted by emufan (Post 1188714)
I get the same for the 68k version. with different offset and leading "_".
hmm, you did link with the correct version: g++ ... libSDL_wos.a
dont use -lSDL to ensure you link with the correct one.

I use -lSDL_wos or -LlibSDL_wos.a same difference. -lauto and -lAuto are not found.

If I do:
ppc-amigaos-g++ -warpup -lSDL_wos sdltest2.cpp -o sdltest801.elf
that gives me:
Error: Undefined Symbol: SDL_LoadBMP_RW
Error: Undefined Symbol: SDL_Quit
Error: Undefined Symbol: SDL_RWFromFile
Error: Undefined Symbol: SDL_Delay
Error: Undefined Symbol: SDL_UpperBlit
Error: Undefined Symbol: SDL_Init
Error: Undefined Symbol: SDL_FreeSurface
Error: Undefined Symbol: SDL_Flip
Error: Undefined Symbol: SDL_SetVideoMode

If I do:
ppc-amigaos-g++ sdltest2.cpp -warpup -lSDL_wos -o sdltest801.elf

Error: Undefined Symbol: ChangeScreenBuffer
Error: Undefined Symbol: BltMaskBitMapRastPort
Error: Undefined Symbol: OpenScreenTags
Error: Undefined Symbol: ChangeWindowBox
Error: Undefined Symbol: CreateIORequest
Error: Undefined Symbol: WaitTOF
Error: Undefined Symbol: AllocVec
Error: Undefined Symbol: FreeScreenBuffer
Error: Undefined Symbol: ClearPointer
Error: Undefined Symbol: SetPointer
Error: Undefined Symbol: OpenWindowTags
Error: Undefined Symbol: UnlockPubScreen
Error: Undefined Symbol: ReleasePen
Error: Undefined Symbol: CheckIO
Error: Undefined Symbol: DeleteMsgPort
Error: Undefined Symbol: BltBitMap
Error: Undefined Symbol: AllocMem
Error: Undefined Symbol: AbortIO
Error: Undefined Symbol: GetMsg
Error: Undefined Symbol: BltBitMapRastPort
Error: Undefined Symbol: SetWindowTitles
Error: Undefined Symbol: CloseWindow
Error: Undefined Symbol: CreateMsgPort
Error: Undefined Symbol: GetSysTimePPC
Error: Undefined Symbol: LockPubScreen
Error: Undefined Symbol: Wait
Error: Undefined Symbol: PPCCallOS
Error: Undefined Symbol: CloseDevice
Error: Undefined Symbol: AllocScreenBuffer
Error: Undefined Symbol: DeleteIORequest
Error: Undefined Symbol: NextDisplayInfo
Error: Undefined Symbol: AllocBitMap
Error: Undefined Symbol: OpenLibrary
Error: Undefined Symbol: GetVPModeID
Error: Undefined Symbol: SendIO
Error: Undefined Symbol: Delay
Error: Undefined Symbol: WindowLimits
Error: Undefined Symbol: FreeBitMap
Error: Undefined Symbol: ReadJoyPort
Error: Undefined Symbol: FreeVec
Error: Undefined Symbol: CloseScreen
Error: Undefined Symbol: FindDisplayInfo
Error: Undefined Symbol: WaitIO
Error: Undefined Symbol: LoadRGB32
Error: Undefined Symbol: InitRastPort
Error: Undefined Symbol: FreeMem
Error: Undefined Symbol: ReplyMsg
Error: Undefined Symbol: GetDisplayInfoData
Error: Undefined Symbol: ObtainBestPenA
Error: Undefined Symbol: RawKeyConvert
Error: Undefined Symbol: OpenDevice
Error: Undefined Symbol: CloseLibrary
Error: Error processing Elffile !


All times are GMT +2. The time now is 09:11.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.05520 seconds with 11 queries