[Bug 51051] Build fails when LTO is enabled