Link library to Amiga shared library is not a compilation issue, more like a "translation" job for which there is unlikely to be a software solution. The assumptions required of each don't seem to match.
Even the header files look quite different, at least to me. One factor maybe that the commonly used variety is intended to work both within an executable file and loaded separately. This is rather on the OS level (AmigaOS 4: a mention of "shared object" in elf.library). Before the program runs one line. Amiga libraries are "opened" by the program and the OS only complies.
Yes, i know, this was a total noob question, since i never tried or done anything like this.
In the meantime i learned, that it need to be done with IDLTool and the help of an .xml file to create a skeleton which the .a/.so library is "linked" in somewhat.
Is it the same case as with -lto, that it has to be turned on in our gcc builds, or do we have to have the corresponding library first to use it in compiling?
Sounds like a really good addition to me and if we could get it, i'd vouche for it.
Can you tell me if that crash is one of those dos.library not open type ones?
Crash log for task "ScummVM_SDL2_Shared"
Generated by GrimReaper 53.19
Crash occured in module libstdc++.so at address 0x7C33C6E4
Type of crash: DSI (Data Storage Interrupt) exception
Alert number: 0x80000003
Im trying to port a game engine that doesn't feature sound yet.
Though MorphOS does integrate it like this:
case AUDIO_S16MSB:
format_str="S16MSB";
audioConfig.format = AUDIO_FLOAT32_SIGNED_LSB;
audioConfig.bytesPerSample = 4;
break;
While it compiles i get a crash on starting the game:
Crash log for task "cosmo_amigaos4"
Generated by GrimReaper 53.19
Crash occured in module cosmo_amigaos4 at address 0x7C5B6E20
Type of crash: DSI (Data Storage Interrupt) exception
Alert number: 0x80000003
Does it work if you compile without audio? Just add to audio.c a "return;" and compile: ... void audio_init() { audioConfig.enabled = false; return; ...
Here it works then fine (no audio), so maybe is some kind of problems with audio not correctly initialized or dunnot.
Try with this Makefile I modified from MorphOS version to use amigaso4 g++:
Could you share your code changes to the github thread, please?
Also the Makefile seems to be from a completely different project...SDLPop and bin is called "prince", the objects doesn't match either...did that really work for you or was it an oversight?
And the game is still being sold, so you should probably remove the link.
Is it the same case as with -lto, that it has to be turned on in our gcc builds, or do we have to have the corresponding library first to use it in compiling?
Sounds like a really good addition to me and if we could get it, i'd vouche for it.
Sanitizers are fantastic tools! I use them as soon as I can (they made me able to send patches to ResidualVM codebase).
Unfortunately, on PPC, even on Linux, their support is not working AFAIK. The libasan is found but that crashes at execution.
I don't remember if I tried with clang (maybe I had other problems to get it working correctly, even without sanitizer options).
I should test again and provide a status.
Edit: Right now, I've just tested on Ubuntu 16.04 PPC with gcc 5.4 and got a valid error detected and reported by the asan sanitizer.
There si a linker error i'm getting and since the code is adapted from MorphOS i'd like you epople to show me the errors.
Thank you
The error is Quote:
backends/libbackends.a(amigaos-dialogs.o): In function `Common::DialogManager::~DialogManager()': ./common/dialogs.h:60: undefined reference to `AmigaOSDialogManager::utf8ToLocal(char*)' ./common/dialogs.h:60: undefined reference to `IAsl' gmake: *** [scummvm] Error 1
class AmigaOSDialogManager : public Common::DialogManager {
public:
virtual DialogResult showFileBrowser(const Common::U32String &title, Common::FSNode &choice, bool isDirBrowser);
private:
char *utf8ToLocal(char *in);
};
#endif
#endif // BACKEND_AMIGAOS_DIALOGS_H
I changed two instances of "IPTR" to "APTR" in this line in amigaos-dialogs.cpp, since "IPTR" gave me an undefined reference as well and because "APTR" is used further down in the "free" block, so i probably messed it up there. It compiled, but i don't really what i'm doing.
IAsl: include <proto/asl.h> in the .cpp using IAsl.
utf8ToLocal: you need to add implementation in the .cpp file. Was it a MorphOS related function?
IPTR: what are the types for "pathBuffer" and "newTitle"? Is cast to APTR even necessary? EDIT: okay, types seem to be char[] and char*. Try without (APTR)?
I don't have the ASL autodoc at hand but you can check what are the expected types for these tags.
utf8ToLocal: MorphOS uses #include <proto/charsets.h>, but i don' t have that
IPTR: I removed the "PTR in the round brackets completely and it compiled, still the same error though, guess it's because of the missing or borked charsets
But error come from dialog.h (not .cpp), so probabaly just include in dialog.h ?
Also, if you want to just use morphos's code, its better to add at the top of file #define __USE_INLINE__ 1, and then no needs to worry about IASL-> and stuff.
IPTR: I removed the "PTR in the round brackets completely and it compiled, still the same error though, guess it's because of the missing or borked charsets
using -lauto and using OpenLibrary can course library to opened twice, as result you can get issue with library open count for etch library, it can course as temporary solution, but should be replaced in the final build.
I had this issue in Basilisk that caused sata device to be closed to many times. This is of course really bad, because the device can risk being unloaded from memory. (You had to run Basilisk maybe 8 times before bad things happened.)
Edited by LiveForIt on 2020/11/16 22:01:07 Edited by LiveForIt on 2020/11/16 22:02:08
(NutsAboutAmiga)
Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.