fix @assert for use during sysimg build, and use it
fix #3544