Add runtime support for building thunks