[compiler] Prevent empty weak function stubs from being removed