Open nbuwe opened 11 months ago
To narrow it down a bit, -O1
is ok, -Os
fails.
So the failure being related to frames was a broad hint and, indeed, -fno-optimize-sibling-calls
helps. But the time to load the world and to do --runAutomaticTests
is significantly worse for -Os -fno-optimize-sibling-calls
than for -O1
.
I wonder how much the higher -O levels above -O1 are actually buying us.
I'm having issues getting NetBSD Sparc to run on Qemu (I don't have Sparc hardware anymore) but I'll have a look at this as soon as I get it running.
Beware that sparc needs a few tweaks, that I think I mentioned in the PR
.mul
in vm/src/sparc/prims/asmPrims_sparc.S
b/c v8 stub on NetBSD doesn't follow the .mul
ABI (#152) that nothing in the gcc generated code relies on, but Self does. I should probably do a PR that provides one for the very unlikely case that someone runs it on v7 and do a v8 multiplication otherwiseUSE_JEMALLOC=no
) with an additional implementation of __je_sallocx
used by true_size_of_malloced_obj
in vm/src/any/runtime/allocation.cpp
(it pokes in malloc internals, so no easy way to provide it out of band)
reldbg build defaults to
-O2
and on NetBSD/sparc with gcc (nb2 20230710) 10.5.0 the VM getsSIGBUS
when trying to load the world:Telling reldbg to use more conservative
-Og
results in the VM that seems to work ok and passes the tests.Unfortunately, I currently don't have time to debug this further or to binary-search for the
-f
optimization that is not in-Og
but is in-O2
that triggers this.