Fix haiku and illumos x64 builds (#131700)