This currently does not link because fprintf, stderr and abort are missing on most platforms. But the code is there.