UnixLib developer notes:

Building
~~~~~~~~

A set of build options specifying which parts of UnixLib are to be included,
which runtime sanity checks needs to be done, etc are specified at
libunixlib/include/unixlib/buildoptions.h.


Testcases
~~~~~~~~~

It is always good to expand on relevant testcases when refactoring/fixing
code so that we check for possible regressions.  Such testcases are stored
in the subdirectory 'libunixlib/test' and when you make an additional
subdirectory there, don't forget to adapt configure.ac's AC_OUTPUT statement
(last line).

These testcases are built & run (using QEMU) in
builddir/cross-gcc/arm-unknown-riscos/{./,fpu/scl/,fpu/scl/module/}libunixlib
directory:

[ Setup 'User-mode emulation' QEMU, see http://www.riscos.info/index.php/QEMU ]

  $ source gccsdk-params
  $ cd builddir/cross-gcc/arm-unknown-riscos/libunixlib
  $ PATH=$GCCSDK_INSTALL_ENV/bin:<path-to-builddir>/installed-buildtools-for-gcc/bin:$PATH make check


Calling conventions
~~~~~~~~~~~~~~~~~~~

The implemented calling convention is APCS-32, i.e. an ARM ABI which allows
the same binary to be run on 26-bit and 32-bit ARM processors (non-thumb).

We noticed that there is a difference in APCS-32 ABI used by UnixLib and
Norcrof C compiler v5 (anyone having a formal specification ?):

  - float arguments: float and double arguments are passed via non-floating
    point registers.  GCCSDK/UnixLib assign one register for a float
    argument while Norcroft assigns two (so basically not making a difference
    between float and double argument.
    Note that a floating point return value is always done via floating point
    register F0.

This difference in APCS-32 implementation becomes important for the SCL stub
interface code as SCL assumes a Norcroft APCS-32 implementation so some float
argument juggling is sometimes needed.


Development
~~~~~~~~~~~

Start support for non-chunked stacks for AAPCS (build option
__UNIXLIB_CHUNKED_STACK).  Pthread support is currently broken for this
feature.

-EOF-

