Swift Static Binary Fails with "Unable to obtain Swift runtime path" on Custom Filesystem Layout

Since this is a static executable, a more practical solution may be possible: if one declares their own Paths.o with the three symbols it exports (swift_getRuntimeLibraryPath etc), it should be possible to replace the function calls in the stdlib without needing to rebuild it. IIRC there’s some finicky aspects like link order, there was another Forums post about something similar a few months ago which might be worth digging up.

EDIT: found it, see:

The idea would be similar (and if interposing the stdlib turns out to be hard, another solution would be to replace musl readlink)

2 Likes