Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent using precompiled binary when vs toolchain is not matching #1951

Open
xq114 opened this issue Dec 29, 2021 · 4 comments
Open

prevent using precompiled binary when vs toolchain is not matching #1951

xq114 opened this issue Dec 29, 2021 · 4 comments

Comments

@xq114
Copy link
Contributor

xq114 commented Dec 29, 2021

描述讨论详情

目前的预编译包都是在vs2019环境下编译的,希望本地编译器为vs2022时默认不下载预编译包以避免兼容性问题

@waruqi
Copy link
Member

waruqi commented Dec 29, 2021

之前不是讨论的,说是 toolset 向下兼容的么。。#1513

现在 vs2022 的 toolset 不向下兼容低版本 toolset 编译的库了?

@waruqi
Copy link
Member

waruqi commented Dec 29, 2021

build-artifacts 我切到 2019/2022 去 build 了。。如果 toolset >= 14.30.30705 (2022) , 会优先选择高版本 toolset

@xq114
Copy link
Contributor Author

xq114 commented Dec 29, 2021

https://docs.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?view=msvc-170

Static libraries or object files compiled using the /GL (Whole program optimization) compiler switch or linked using /LTCG (Link-time code generation) aren't binary-compatible across versions, including minor version updates. All object files and libraries compiled using /GL and /LTCG must use exactly the same toolset for the compile and the final link. For example, code built by using /GL in the Visual Studio 2019 version 16.7 toolset can't be linked to code built by using /GL in the Visual Studio 2019 version 16.8 toolset. The compiler emits Fatal error C1047.

貌似开了链接优化的库不是跨版本兼容的

@waruqi
Copy link
Member

waruqi commented Dec 29, 2021

那就仅仅是 lto 的问题咯,这个咋探测区分。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants