Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Karlos on April 03, 2004, 10:19:00 PM
-
Hi,
It's Saturday, so that must mean its time for another stupid question regarding amigaos + GCC/C++ :-D
It seems that any code using amiga os shared libraries from GCC/C++ mode refuses to link unless there is a stub .lib for that library.
This is totally irritating - am I doing something wrong here? Surely there should be some other mechanism for handling OS calls or do we alwys need a stub?
The increase in code size alone is starting to annoy me without having to make stubs for every shared library not covered by amiga.lib :-x
Someone please tell me there is a #pragma or some other method for this!
-edit-
I dunno. You go to the effort of at least trying to make your code more standards compliant by moving to gcc and it just wants to throw endless obstacles your way :-(
No wonder most amiga stuff is still written in C - it's the only way to stay sane :lol:
-
BUMP
Did you find the solutioin yet?
I'm surprised nobody has answered yet.
-
GadgetMaster wrote:
BUMP
Did you find the solutioin yet?
I'm surprised nobody has answered yet.
And what I am most surprized at is:
WHY, THE HELL GNU C++ DOESN'T RECOGNIZE ITS OWN PRAGMAS FROM GNU C???
At least that's what I understood from few Karlos' threads.
Hmmm... thinking of it - mayby thats because of C++ mangling fascilities?
That makes me completly :insane:.
-
Hmm?? In MorphOS I'm using GCC and C++ code compiles just fine without stubs. However certain inline stuff is not working but in general I can compile without stubs...
-
@itix
A few *issues* Im having in ANSI C++ mode
1) Register specific parameters to a function (as allowed in ANSI C mode), using __asm("regname") refuse to be accepted. That's one avenue for library function calls gone.
2) #pragmas for library calls (and tag calls) aren't recognised either.
3) Final code size has absolutely *ballooned* compared to stormc v3. My old image warping demo used to compile to 56Kb, the gcc version compiles to 130Kb. Perversely, the object sizes for my code are similar, so the problem must be code added during linking.
So far, it seems I have to use stub libraries, resulting in a stack based call to a function that has to do call the OS in turn. Not the most efficient thing.
@PiR
I know. Mental, isnt it? I found that perfectly acceptable ANSI C headers, that contain register specific parameters in function prototypes simply *refuse* to be accepted in C++ mode, even with the extern "C" decleration.
A friend reported the same issue with gcc under linux x86 too.
-
Changed title to something more "on topic" :-)
@GadgetMaster
Still scratching my head for a non stub library way here since you last popped round, but I've resigned to it for now. If a magic third option appears I'll rebuild the entire lot then :-)