Issue |
144630
|
Summary |
[lld-link] bug, maybe. clang_rt.builtins-x86_64.lib will not auto link wen use function "__builtin_cpu_supports"
|
Labels |
new issue
|
Assignees |
|
Reporter |
Eternalni
|
platform : winodws x86_64
my code:
if (__builtin_cpu_supports("avx"))
std::cin >> s3.a;
else
std::cin >> s3.b;
build error message:
C:\Windows\system32\cmd.exe /C "cd . && D:\a2\cmake\compilers\win\x64\LLVM\bin\clang++.exe --target=x86_64-pc-windows-msvc -nostartfiles -nostdlib -mcx16 -O0 -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd -g -Xclang -gcodeview -fuse-ld=lld -Xlinker /subsystem:console -fuse-ld=lld-link CMakeFiles/a2.dir/main.cpp.obj -o a2.exe -Xlinker /MANIFEST:EMBED -Xlinker /implib:a2.lib -Xlinker /pdb:a2.pdb -Xlinker /version:0.0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames && cd ."
lld-link: error: undefined symbol: **__cpu_model**
note: LLVM\bin\ is not in system environment path
add "target_link_libraries("${EXECUTABLE_TARGET}" PRIVATE **clang_rt.builtins-x86_64**)" in CMakeLists.txt, then build success.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs