RIsc_OSLib and compiling the rom.
Colin (478) 2433 posts |
I’ve been modifying Risc_OSLib and the changes work fine for programs compiled with the modified library but when I recompile the rom and run !edit for example I get the error: ‘Static data size in library and stub disagree’ which is an error message from risc_oslib.s.initmodule. Does anyone know how to resolve this? |
Colin (478) 2433 posts |
Hmmm no replies. I’ve tracked the problem down to a static variable I created in txt.c in RiscOSLib. If I remove the variable and recompile I don’t get the error. Anyone know if I need to manually record the extra static data size for the stubs somewhere? |
Ben Avison (25) 445 posts |
I think you’ve found it anyway, but it’s in rlib.s.rlibdata. A word of warning to anyone thinking of changing static data in the “kernel” or “clib” parts of the shared C library – think long and hard before doing so. The shared C library has to support all the software already out there that was linked with existing versions of the stubs. The amount of static data available for use by the shared library is fixed by the stubs, you can’t add any more except indirectly (e.g. using a word of static data to point at a heap block). There is some space available in kernel.s.k_data and clib.s.cl_spare which can be reduced to make space for new variables, but it’s very limited in size and should be used very sparingly. You’re slightly less constrained with the “rlib” part because the only time this is used as a shared library is during ROM builds, and the only clients are the ROM applications. However, if you do change the C library, you will need to force the ROM applications to be re-linked because the stubs have changed the amount of static data they reserve. |
Colin (478) 2433 posts |
Excellent. Thanks for the reply. I managed to compile the rom by |