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 30 September 2017 20:38

A lot of what I was thinking, why this would be so simple, is that a lot of old SDL programs are compiled with GCC 2.95.3, including what hopefully might come out of this the version of ScummVM 0.11.1 for OS4, but compiled for WarpOS. Maybe just maybe if we get a working shared lib for SDL someone takes up the Dosbox challenge too, or a few other interesting apps for WarpOS.

And uh the SDL TV commercials say just use SDL, simple adjustments to makefiles and the programs work, 100% money back guarantee.

Hedeon 30 September 2017 21:27

-warpup invokes warpcollect and elf2exe2 i think.

Hedeon 30 September 2017 21:38

A very simple program like:

main();
SetExcMMU();
return();

Returns with unknown symbol SetExcMMU. I guess we are missing some include or lib

emufan 30 September 2017 21:39

Quote:

Originally Posted by Hedeon (Post 1188824)
-warpup invokes warpcollect and elf2exe2 i think.

*argh* and I was so proud of my nice workarround above :D
Quote:

Originally Posted by Hedeon (Post 1188825)
Returns with unknown symbol SetExcMMU. I guess we are missing some include or lib

if I dont mix it again "unknown symbol" refers to missing lib or object file with function.
"unreferenced ...." is missing include or declaration.

#1) or the other way around.

Hedeon 30 September 2017 22:06

compiling that SetExcMMU program with GCC from StormC4 with amiga603.lib works.

Hedeon 30 September 2017 22:33

Was missing powerpc/powerpc_protos.h and powerpc/warpup_macros.h

Now that small program compiles correctly with GCC 2.95.3....

emufan 01 October 2017 00:52

I did a 'grep -ir amiga603 *' in the stormc4 source code, and found it
only as a dependency in the project files.

so they are cheating with the gcc license, not providing everything?

even if we can build the gcc/g++ from that source, I think we need those link libs too, right?

grelbfarlk 01 October 2017 01:45

Quote:

Originally Posted by emufan (Post 1188849)
I did a 'grep -ir amiga603 *' in the stormc4 source code, and found it
only as a dependency in the project files.

so they are cheating with the gcc license, not providing everything?

even if we can build the gcc/g++ from that source, I think we need those link libs too, right?

I really should try this test file with stormc and the stormc PPC version of sdl.
Damnit-*booting up a4000*

Hedeon 01 October 2017 01:48

I got the libSDL_wos compiled like Gerbilfark. When I link the SDL test files to it with the
-lSDL_wos parameter after the -o <targetfile> it finds the SDL functions.

However, within those SDL functions are AmigaOS calls. These functions are not compiled correctly and result in undefined symbols like AllocMem.

So I did a small program again with OpenLibrary() and compiled it with ppc-amigaos-gcc but no matter what include I add (clib/inlines/proto) I cannot do an AmigaOS call from a WarpOS program build with gcc (or g++). What am I missing?

Hedeon 01 October 2017 02:09

Say what do I need to include to get something like:

int main()
{
Enable();
return(0);
}

Going for WarpOS on gcc.

emufan 01 October 2017 02:13

@Hedeon: build it and look for the linker messages/errors.

@grelbfarlk: yep, give it a try, maybe it isn't that bad.

Hedeon 01 October 2017 02:17

Quote:

Originally Posted by emufan (Post 1188863)
@Hedeon: build it and look for the linker messages/errors.

The error message is 'undefined symbol: Enable' in the above example.

Somewhere needs to be defined how the PPC can context-switch to AmigaOS 68K functions...but I don't know where.

vbcc has a .lib for AmigaOS calls by the PPC, for example. StormC too.

So what does gcc need is the question...

emufan 01 October 2017 02:25

Quote:

Originally Posted by Hedeon (Post 1188865)
The error message is 'undefined symbol: Enable' in the above example.

Somewhere needs to be defined how the PPC can context-switch to AmigaOS 68K functions...but I don't know where.

vbcc has a .lib for AmigaOS calls by the PPC, for example. StormC too.

So what does gcc need is the question...

you are the only one with that compiler, so who should know :blased

but look what's provided in the link lib folder(s). there was a start.o and end.o in grelbfarlk toolchain.
which got added as 1st and last object in the object link chain.
maybe something like that you have there too.

and do a 'grep Enable lib/*' to find the lib which hold that function.
maybe better results with nm, ar and objdump on those link libs.

try those options with gcc/g++:
Code:

  -dumpspecs              Display all of the built in spec strings
  -dumpversion            Display the version of the compiler
  -dumpmachine            Display the compiler's target processor


emufan 01 October 2017 02:45

while looking at the stormc4 src code (again), searching for noixemul, I found
Code:

#define SYSTEM_INCLUDE_DIR  "/gg/os-include"
#define STANDARD_INCLUDE_DIR    "/gg/include"

#define STANDARD_EXEC_PREFIX_1 "/gg/lib/gcc/"
#define STANDARD_STARTFILE_PREFIX_1 "/gg/lib/"
#define STANDARD_STARTFILE_PREFIX_2 "/gg/lib/"

in: gcc/config/m68k/xm-amigaos.h: ixemul.library which provides for this unix'ism, and for the usual

did they use gg == geekgadget's stuff? if so, we can try to build that gcc/g++ and use the
things provided with the already available link libs from grelbfarlk's toolchain.

#1) gcc/NEWS lists 2.8.1 as highest version number. not entirely sure, but is it that version of stormc4 ?

@Hedeon: what says: gcc -dumpversion ?

grelbfarlk 01 October 2017 03:51

So what happened is that somewhere along the way I botched my ppc-amigaos-gcc install. I had compiled a few WarpOS Q2 mods about a year ago which I can't compile any more, just get those undefined symbols. Not sure what I broke and when. Comparing to my backup a year ago... that's in an even worse state.

emufan 01 October 2017 03:56

oh, yes, I know that.
you want build something usefull, but instead you have to fight with the tools.
that's sort of frustrating ... :)

grelbfarlk 01 October 2017 04:05

Quote:

Originally Posted by emufan (Post 1188872)
oh, yes, I know that.
you want build something usefull, but instead you have to fight with the tools.
that's sort of frustrating ... :)

Yeah, actually I feel terrible about it since I recruited some smart people who I tempted into working on WarpOS project with a working build environment.... I can only imagine what an effing idiot they think I am (justifiably).

emufan 01 October 2017 04:20

tell them , they are now in amigaland, where things are slow and offten weird :spin

Hedeon 01 October 2017 06:31

It finally compiled correctly. Also the sdl examples compiled. Not sure if they are good examples as they are missing some resources.

Both open a screen and in example 2 a 640x480 window is opened and closed again after a delay.

In the end, the gcc/g++ install was botched. Also had to add some stuff here and there.

Victory at last :-D

emufan 01 October 2017 15:03

Quote:

Originally Posted by Hedeon (Post 1188881)
It finally compiled correctly.

good news. it was done with the stormc4 gcc ?
Quote:

Originally Posted by emufan (Post 1188867)
@Hedeon: what says: gcc -dumpversion ?



All times are GMT +2. The time now is 22:34.

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

Page generated in 0.05359 seconds with 11 queries