Improve handling of library chunk stubs
There are a few times over the years where existing library chunks have been extended by adding new entries onto the end. However this is an unsafe thing to do, because older CLibs which don't support those entries will do one of the following:
- Fill the entries with branches to random addresses (pre-5.37)
- Fill the entries with branches to zero (5.37+, APCS-R)
- Fill the entries with random addresses within CLib (5.37+, APCS-32)
To solve these problems, I've decided to go with the safest approach possible:
- Add new library chunks containing all of the entries which had been added to existing chunks
- For the stubs, the troublesome entries are only available via the new chunks, and the chunks they used to be in have been shrunk to their original sizes
- For compatibility with programs built with old stubs, the CLib module supports the use of the troublesome entries by both the new chunks and their original chunks
- Updated the "Add new entries ..." text in the chunk entry files to discourage people from adding new entries
Programs built using these new stubs, which use the troublesome entries, will require the user to install a new CLib which supports the new chunks. Running against an old CLib will fail safely with an "Unknown library chunk" error.
The new chunks are set up as follows:
- Chunk 7 contains the C99 float/double math functions (63 entries)
- Chunk 8 contains the C99 complex math functions (50 entries)
- Chunk 9 contains the other functions which have been moved around (e.g. large file support, aligned allocs, _vswi) (24 entries)
CLib has also been fixed to throw a "Shared C library out of date" error if the client stubs are larger than the module can support, and the makefile has been brought more in line with GNUmakefile to help make future maintenance easier (GNUmakefile appeared to be a lot cleaner than the RISC OS Makefile).
Relevant forum thread: https://www.riscosopen.org/forum/forums/4/topics/17200
Requires RiscOS/Sources/Video/Render/SprExtend!6 (merged) (otherwise genyuvtabs might not run due to requiring the host to be running a CLib which provides chunk 7)