russellallen / self

Making the world safe for objects
http://selflanguage.org
707 stars 76 forks source link

Sparc: Don't use `%g7` in the JIT compiled code #149

Open nbuwe opened 1 year ago

nbuwe commented 1 year ago

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.