-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to compile Amiga Shared Libraries with this wonderfull compiler ? #379
Comments
Sorry, no plans. |
Hello again, This is well explained in this short asm example that does compile a valid .library: I may be wrong, but enclosing static-linked C++ inside an Amiga library with C Api would "just" implies the static inits usually done before entering main() in an exe, would be done in that Open() call, and then closed in the expunge() call. There is something about data allocated for each caller in the documentation, but for a pure "re-entrant" api, which is the case of what I want to port, and most "well done" codes, this is not even needed. ... StormC4 used to patch GCC2.5 but used their own format for makefiles, and I bet they never published their linker sources. there is something called "stormlink" that allows to link a library. in that case the first .o linked is "gcclibrary_startup.o" , which I inspected, and it is exactly looking like the structure described in the link, with names to be replaced... The whole AmigaOS 3.9 must have been compiled with that, This was done by the same team if i'm correct. I may investigate further myself If there's no plan for generating libraries... I noted that doing gcc -shared would generate a legit "68k elf .so file" ... maybe coding a "dlopen() using 68k elf" on amiga would be a solution. For information, I have a pistorm here and I've ported a static version of "libheif" , something to read the new .heic image format of the phones. The example "convert-heif" is already 90% working , yet a few of the iOS images I tested have glitchs, but the exe looks stable. it embbeds also libde265, the h265 codec (!). libheif is done in C11 with shared_ptr<> and all, but then the API is very C-looking and would fit a .library and fd file. My plan is to have a heif.library , and then doing a "datatype class" to allow Amiga Apps to read the images directly, that would use the library. As their is a USB MTP driver with the Amiga Poseidon USB stack, this would allow to read images from modern androids directly. ... If I have a way to generate shared libraries with gcc6, then I would also try to do a python3 port. |
I am building many shared libraries with this gcc and there are no issues with that. As you have found out yourself shared libraries are executables, just built differently. The issue reported here is actually irrelevant to the gcc project itself, so it could be closed here. You can find examples of my libraries (build with gcc-6.5 and cmake) can be found here: |
Thanks a lot mister Schulz. I'll just looked at that.
The thing is, newcomers will endlessly try to build shared libraries with the common gcc options. using -nostartfiles and using a init.c to make the executable header is not that intuitive nor documented... Plus, I will look further into your examples, but ideally the .library should also manage the init/close of the C++ runtime. All thatshould be documented somewhere. ( and also thanks because I am a very happy piStorm user.) |
Yeah, unfortunately AmigaOS shared libraries are completely different from what you know in case of other operating systems, so making a shared .library cannot be done just by adding a But you're right, a topic like how to create shared library or .device file in pure C or C++ should be documented somewhere as it would probably help many :) |
Wrong: Now shared libraries can be done just by adding a |
Read more here: https://franke.ms/amiga/so.wiki |
Hello, not necessarily a bug, but maybe still an issue:
Is there a way to compile a .library file containing C++ , with this compiler ?
I can't find any information on this, neither for the old GCC 2.5.
...The closest I can find is year 2000 StormC4 with their patched GCC 2.5 and there is a shared library example which links a special startup and uses a .fd file to build a library. Very nice but still GCC 2.5.
Did I missed something ? Is such feature planned ?
Thanks for your efforts, and happy new year by the way.
The text was updated successfully, but these errors were encountered: