New user problems with OSLib

Mark Beerling beerling at freenet.de
Wed Dec 31 18:12:20 GMT 2008


In message <e3a7591650.Jo at hobbes.bass-software.com>
          John Tytgat <John.Tytgat at aaug.net> wrote:

> In message <5aa9441650.freenet at beerling.freenet.de>
>           Mark Beerling <beerling at freenet.de> wrote:

>> Hallo Everyone
>> 
>> this Christmas holiday I wanted to do something useful so I decided to
>> convert one of my programs from Acorns/Castles C/C++ compiler to the
>> GCC compiler and to use OSLib.
>> 
>> I downloaded OSLib V6.9 with OSLibSupport and the !Dustbin program as
>> an example. I'm currently using GCC Version 3.4.4 Release 3 under ROS
>> 4.39.

> Any reason why you don't use 3.4.6 Release 3 ? Otherwise you seem to
> miss 2 years of bug fixes.

Yes. I started off with 3.4.6 Release 3 but got the problem described. 
So I moved back a generation to 3.4.4 Release 3 to confirm that it 
wasn't a compiler issue.

>> I've managed to change the source of my program so that the program
>> compiles with OSLib & GCC.
>> 
>> Problem #1
>> ==========
>> 
>> In order to get the program to compile I had to change the header file
>> 'Systypes' in OSLibSupport.h as follows:
>> 
>> Line 81:
>> commented out
>> // typedef os_error _kernel_oserror;  // from kernel.h

> I'm not so sure commenting out is the best fix.  The actual code around
> this is:

>> // old _kernel stuff
>> #if !defined( _kernel_h )
>>  typedef os_error _kernel_oserror;  // from kernel.h
>> #endif

> So there is a test on _kernel_h.  Oddly enough, the Norcroft kernel.h
> files I have seem to use __kernel.h as dbl include guard and the GCCSDK's
> libscl kernel.h uses __KERNEL_H.

> So this is perhaps better (assuming _kernel_h was once used in the past
> as well):

> #if !defined( _kernel_h ) && !defined( __kernel_h ) && !defined( __KERNEL_H )

> but it feels like a gross hack.

Done this - it works fine. Thanks.


>> 
>> The version 6.90 has the required events_* headers, but the functions
>> are not in the library.

> This was a OSLib 6.80/6.90 release error.  We had at one point an
> OSLibSupport released without the Event.o object file.  Tony fixed this
> around May 2007 for the 6.90.  Please update your OSLibSupport32 from
> <URL:http://sourceforge.net/project/showfiles.php?group_id=51230>.

Downloaded this version which has the missing functions. My program 
links & runs with this library. Thanks again.

> But note that __arm_alloca_longjump is a GCC generated label by its ARM
> backend to deal with alloca calls made before a longjump is used in the
> code and that's one of the several gotchas when mixing object files made
> with GCC and Acorn C together.  So I would recommend to use only either
> GCC or either Acorn C for compiling & linking the complete project.

Now using the GCC compiler so it isn't an issue.

> And when you use GCC, use the gcc driver program to do the linking instead
> of calling drlink yourself.  Something like:
> gcc -mlibscl -o !RunImage obj1.o obj2.o OSLibSupport:o.OSLibSupport32
> OSLib:o.OSLib32

Done this.

> Thanks for the feedback,
> John.

Thanks for you help ... I can now plod on with debugging my program.

Regards


-- 
Mark Beerling



More information about the oslib-user mailing list