-
- With FIOS2 and SceLibc stdio as the driving IO backends, cached reads are miles apart
- Random 4KiB is 48.9x faster using SceLibcPosix, and Reread 4MiB is, and I'm not kidding, over 4000x faster using SceLibcPosix. (Benchmark results in repo)
-
- No more guessing how much memory is necessary, simply add
unsigned int sceLibcHeapSize = -1; # Upper Limit for Extended Alloc (-1 is unrestricted) unsigned int sceLibcHeapExtendedAlloc = 1;
- No more guessing how much memory is necessary, simply add
-
- Surpx's built against SceLibcPosix's crt0_module.o will be able to utilize a shared heap. This means full Malloc support in modules and no new C runtime instance.
-
- Newlib is, let's face it, a mess when it comes to structure and iterations of features/fixes. I chose musl's structure to allow better readability and ease of development. Most features can be added with a single file, and building simply requires a VitaSDK installation
Until furthur improvements and integration, there are some extra steps to use this library instead of Newlib
-nostdlib -nostartfiles -nodefaultlibsflags need to be used to avoid linking Newlib- Link
crt0_main.ofor Eboots, andcrt0_module.ofor Suprx Modules (This does not support Skprx, obviously) - Remove
_newlib_heap_size_userand replace it withunsigned int sceLibcHeapSize - Bundle
SceLibcPosix.suprxinsce_module/SceLibcPosix.suprxin your VPK- If pthreads are needed (C++ or explicitly) link
pthread_stub_weak, bundlepthread.suprxinsce_module/pthread.suprx, and addSCE_USER_MODULE_LIST("app0:sce_module/pthread.suprx");anywhere in your source to ensure it is loaded on application startup.
- If pthreads are needed (C++ or explicitly) link
- Removing newlib means removing default links as well, so you'd need to restore them, at a minimum
target_link_libraries(myapp -nostdlib -nostartfiles -nodefaultlibs $ENV{VITASDK}/arm-vita-eabi/lib/crt0_main.o #crt0_module.o for suprx SceLibcPosix_stub_weak SceLibcExt_stub_weak SceFios2_stub_weak SceLibKernel_stub SceIofilemgr_stub SceKernelThreadMgr_stub SceProcessmgr_stub SceSysmem_stub SceRtc_stub gcc ) - You're good to go!
- Install VitaSDK
git clone https://github.com/SonicMastr/SceLibcPosix.git --recursecd SceLibcPosixcmake -B build -S . && cmake --build build && cmake --install build