self
self copied to clipboard
Sparc: Don't use `%g7` in the JIT compiled code
Self JIT compiler on sparc emits code that uses %g7
register. But that register is reserved for the use by the system and is commonly used by the ELF TLS (thread local storage).
This actually happens even though Self does not use pthreads, b/c jemalloc, the default malloc on NetBSD, does use TLS, and JIT code clobbers it and malloc crashes. The kludge I used while making the sparc port compile again was to use a different malloc implementation.