micja@IDA.LiU.SE (Michael Jansson) (12/21/90)
I have been working a bit with amiga libraries and manx 5.0[a,d] and have had little success so far. When I used 5.0a I never managed to compile a library that worked unless I added the optimizer flag (-so). This is a real pain because that made it close to impossible to debug the libraries with sdb. I think the compiler was generating 'link a5,?' when it shouldn't which was 'optimized' out with the -so flag. Another 'feature' is that the function in the libraries must be declared with prototypes and pragmas or else it won't find the library base and possible other global data (It seems like the compiler will 'magically' bind the library-base variable to a6 instead of just allocating some stack space for the base variable). I tried to recompile the libraries with 5.0d, which I got last week on disk and managed to do some meditation. I copied the the res_lib from 5.0a and compiled that with the same result. I compiled the 'open/close/expunge' function with the '-a' flag an started to look at the assembly code that the compiler had generated. I found out that the compiler generates a 'move.l (sp)+,a4' when it shouldn't. It will trash a4 and it will trash the stack! The library worked after I removed these lines. These odities can be found when the functions are declared as library functions, i.e. prototyped and pragmaed. I guess the compiler works great when it compiles 'ordinary' functions, but it sure don't when it comes to library functions. CONCLUSION: Manx 5.0[a,d] are NOT stable enough to create amiga libraries. HAS ANYBODY MANAGED TO COMPILE AN AMIGA LIBRARY WITH MANX 5.0D??????? (I guess I'm still hoping that somebody will tell me that I made a silly misstake ;-) -- ########################################################## # Michael Jansson | \_/ # Internet: mij@IDA.LIU.SE | V _|_ # UUCP: uunet!liuida!mij | | Absolut Software| # BITNET: mij@SELIUIDA | ~~~