Chuyu-Team / VC-LTL

Shared to msvcrt.dll and optimize the C/C++ application file size.
Eclipse Public License 2.0
1.05k stars 204 forks source link

编译CEF时出现链接错误(感谢 大胸滴) #63

Closed mingkuang-Chuyu closed 4 years ago

mingkuang-Chuyu commented 4 years ago

错误信息

lld-link: error: undefined symbol: __guard_eh_cont_table
>>> referenced by libcmt.lib(loadcfg.obj):(_load_config_used)

lld-link: error: undefined symbol: __guard_eh_cont_count
>>> referenced by libcmt.lib(loadcfg.obj):(_load_config_used)
[14/31170] CXX obj/third_party/crashpad/crashpad/client/client/crashpad_client_win.obj
ninja: build stopped: subcommand failed.

工具链: VS2019 + 14.27.29110 + x64。

mingkuang-Chuyu commented 4 years ago

image

image

通过IDA查看微软编译的loadcfg.obj,在结合源代码可以分析得到 微软在编译时定义了 _CRT_LOADCFG_DISABLE_CET 宏。

因此 增加 _CRT_LOADCFG_DISABLE_CET 宏定义 重新编辑即可。

mingkuang-Chuyu commented 4 years ago

受影响的工具集,LLVM + 14.25、14.26、14.27

mingkuang-Chuyu commented 4 years ago

··· lld-link: error: undefined symbol: declspec(dllimport) std_init_once_complete

referenced by D:\Develop\CppLibrary\VC-LTL\VC\14.27.29110\include\mutex:543 libANGLE.lib(WorkerThread.obj):(public: __cdecl std::_Init_once_completer::~_Init_once_completer(void)) [6746/37022] ACTION //third_party/catapult/tracing:generate_about_tracing(//build/toolchain/win:win_clang_x64) ninja: build stopped: subcommand failed. ···

后面又发现这个问题……

mingkuang-Chuyu commented 4 years ago

__std_init_once_complete、__std_init_once_begin_initialize缺失问题只影响 14.27.29110 工具集。

mingkuang-Chuyu commented 4 years ago

查证是微软新增了别名,从这里复制了他的aliases文件,重新导入到工程。 https://github.com/microsoft/STL/tree/master/stl/aliases

此外还有一个 stl\xonce2.cpp 文件,对于的clr支持,也添加到了选项中。

mingkuang-Chuyu commented 4 years ago

4.1.1-Beta4已经修复