@rjd324
A separate directory like SOBJS:clib4/ isn't required, nor any changes in the compiler/linker (ld) and the loader (elf.library), just make sure any .so using clib4 has "clib4" in it's soname, for example use -soname libSDL_gfx_clib4.so.23 instead of -soname libSDL_gfx.so.23 (newlib) when building libSDL_gfx.so.
Although most developers ignored it, and created a linux/windows like .so/.dll hell instead, there
never must be any soft links in SOBJS:
Instead it should be done the following way:
- In the SDK (newlib/lib, clib/lib, etc.) directory you have a libFOOBAR.so, which may be a soft link to the current version, build for example with -soname libFOOBAR.1.2.3.so (newlib) or -soname libFOOBAR.1.2.3_clib4.so (clib4) for version 1.2.3.
- In SOBJS: (and PROGDIR, PROGDIR:sobs) there
never is any libFOOBAR.so, and especially no libFOOBAR.so soft link to a specific version, but just the regular files libFOOBAR.1.2.3.so and libFOOBAR.1.2.3_clib4.so.
GCC/ld uses the (current) libFOOBAR.so version from the SDK:(newlib|clib4|ixemul|whatever)/lib directory when linking the executable. It never must use anything from SOBJS: instead for linking!
The loader/elf.library
doesn't use (SOBJS:|PROGDIR:|PROGDIR:Sobjs/)libFOOBAR.so when loading an executable linked with it, but uses the soname from it instead (libFOOBAR.1.2.3.so, libFOOBAR.1.2.3_clib4.so, libFOOBAR.1.2.3_ixemul.so, ...).
If it would be done correctly, as proposed and used by the OS4 development team about 20 years ago, there never would be any problems with different .so versions (different versions of the library, using different C libraries, etc.) of the same library as all of them in SOBJS: (and PROGDIR:, PROGDIR:Sobjs/) have a different file and soname.