Some idea of how you are doing your link - which build environment, what flags are being passed, and so on - might make it possible to diagnose your difficulty, but we can't do anything with what you've posted so far.
Re: Linking error and memory bloating for .so file creation
I encountered this issue when linking arm 32-bit debug .so binary on Windows using ld from NDK 19c. And all was good when linking 64-bit binaries.
The reason was that resulting .so not-stripped file size was going above 2GB.
When this happens, ld included with NDK r19c starts writing to disk endlessly, fills the whole free disk space on the disk, and then hangs forever. Along the way it generates this "write: Function not implemented" error over and over again.
Proper error message is in order here, in my opinion.
Building Release build helps because it is smaller.
Building with lld helps because it generates smaller binaries.
In fact, after NDK 10e support of huge files is totally broken. objcopy and gdb just show Memory Exhausted, so we use gdb from 10e.
(Totally unrelated, but for our .so files, even small ones, lld in NDK 19c hangs randomly unless I add -no-threads).