fix test builds on some platforms (cherry picked from commit 1b7f32838557a4805029cfb17710148a948b11bf)