UnixLib with the Castle tools

John Tytgat John.Tytgat at aaug.net
Thu Feb 16 14:05:26 PST 2006

In message <7e802cfa4d.pittdj+ at pittdj.plus.com>
          David Pitt <pittdj at pittdj.co.uk> wrote:

> In message <38f903fa4d.Jo at hobbes.bass-software.com>
>           John Tytgat <John.Tytgat at aaug.net> wrote:
> > These GCC symbols are normally found in the libgcc library.  I really
> > wouldn't recommend link a GCC compiled UnixLib with Norcroft object
> > files because their float argument passing is differnt.  Something I
> > worked around in the libscl stubs we have.
> I have had another look at this and I think a misunderstanding may 
> have got into the works. I am not compiling against the CLib then 
> linking with UnixLib. The UnixLib was in use throughout for both 
> phases. The error file above only shows Linker errors, there where no 
> compilation errors.

I did understand that but the problem is that the UnixLib you're using
is compiled with GCC and its ABI is the, let's say, GCC APCS-32 version.
One would assume this is the same as Norcroft is using but it turns out
that there are differences : at one point I introduced
__UNIXLIB_NORCROFT_BUILD feature to deal with this difference but I now see
this is nowhere used anymore in the UnixLib source.  So either my memory is
failing, either that particular Norcroft support has gone quietly away.

The float difference I mentioned above is that when you have float 
function arguments Norcroft really passes float while GCC passes double
arguments.  So as soon as you call an UnixLib (which is compiled with
GCC) function from code compiled with Norcroft, you will hit this float
problem.  The scenario I was talking about was the reverse, GCC compiled
code talking to a library, SharedClibrary via stubs mechanism, compiled
with Norcroft.

Actually this is also an issue when trying to use StubsG with GCC.

> All I did was to remove all the default C: entries for Includes and 
> Libraries from !CC and then enter the UnixLib pointers as per the 
> instructions.

If you want to persue this, you really need to build UnixLib with Norcroft
but I'm pretty sure that even with the UnixLib build recipe "Building"
(!UnixLib.Docs.ReadMe of the unixlibsrc.zip file) you will have to fix
things here and there.  I haven't done that myself for quite some time and
I don't think there is someone else who recently did this.

IMHO, it is time to pull the plug of Norcroft support in UnixLib source
code base.

John Tytgat, in his comfy chair at home                                 BASS
John.Tytgat at aaug.net                             ARM powered, RISC OS driven

More information about the gcc mailing list