错误梗概:
clang++: /home/hongleili/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Target/X86/X86FloatingPoint.cpp:1641: void {anonymous}::FPS::handleSpecialFP(llvm::MachineBasicBlock::iterator&): Assertion `(1 << getFPReg(MI.getOperand(I)) & STDefs) == 0 && "Operands with constraint \"f\" cannot overlap with defs"' failed.
详细出错信息:
[ 62%] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.ilogb.dir/ilogb.cpp.o
[ 62%] Built target libc.src.math.generic.ilogb
Scanning dependencies of target libc.src.math.generic.nextafterl
[ 62%] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextafterl.dir/nextafterl.cpp.o
[ 62%] Built target libc.src.math.generic.nextafterl
Scanning dependencies of target libc.src.math.x86_64.cos
[ 62%] Building CXX object libc/src/math/x86_64/CMakeFiles/libc.src.math.x86_64.cos.dir/cos.cpp.o
clang++: /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Target/X86/X86FloatingPoint.cpp:1641: void {anonymous}::FPS::handleSpecialFP(llvm::MachineBasicBlock::iterator&): Assertion `(1 << getFPReg(MI.getOperand(I)) & STDefs) == 0 && "Operands with constraint \"f\" cannot overlap with defs"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/./bin/clang++ --target=x86_64-unknown-linux-gnu -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/runtimes/runtimes-bins/libc/include -I/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/libc -I/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/runtimes/runtimes-bins/libc -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -g -O2 -fpie -ffreestanding -DLLVM_LIBC_PUBLIC_PACKAGING -o CMakeFiles/libc.src.math.x86_64.cos.dir/cos.cpp.o -c /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/libc/src/math/x86_64/cos.cpp
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/libc/src/math/x86_64/cos.cpp'.
4. Running pass 'X86 FP Stackifier' on function '@cos'
#0 0x000055e42f08af56 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Support/Unix/Signals.inc:565:0
#1 0x000055e42f08b00d PrintStackTraceSignalHandler(void*) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Support/Unix/Signals.inc:632:0
#2 0x000055e42f088cc1 llvm::sys::RunSignalHandlers() /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Support/Signals.cpp:97:0
#3 0x000055e42f08a7b0 llvm::sys::CleanupOnSignal(unsigned long) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Support/Unix/Signals.inc:361:0
#4 0x000055e42efb760e (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Support/CrashRecoveryContext.cpp:76:0
#5 0x000055e42efb7b29 CrashRecoverySignalHandler(int) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Support/CrashRecoveryContext.cpp:390:0
#6 0x00007ffbab59c980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
#7 0x00007ffbaa24de87 raise /build/glibc-uZu3wS/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#8 0x00007ffbaa24f7f1 abort /build/glibc-uZu3wS/glibc-2.27/stdlib/abort.c:81:0
#9 0x00007ffbaa23f3fa __assert_fail_base /build/glibc-uZu3wS/glibc-2.27/assert/assert.c:89:0
#10 0x00007ffbaa23f472 (/lib/x86_64-linux-gnu/libc.so.6+0x30472)
#11 0x000055e42d4a0eb5 (anonymous namespace)::FPS::handleSpecialFP(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Target/X86/X86FloatingPoint.cpp:1640:0
#12 0x000055e42d49d5c4 (anonymous namespace)::FPS::processBasicBlock(llvm::MachineFunction&, llvm::MachineBasicBlock&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Target/X86/X86FloatingPoint.cpp:462:0
#13 0x000055e42d49ce8e (anonymous namespace)::FPS::runOnMachineFunction(llvm::MachineFunction&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Target/X86/X86FloatingPoint.cpp:375:0
#14 0x000055e42de7f189 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/CodeGen/MachineFunctionPass.cpp:72:0
#15 0x000055e42e4d508e llvm::FPPassManager::runOnFunction(llvm::Function&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/IR/LegacyPassManager.cpp:1439:0
#16 0x000055e42e4d5337 llvm::FPPassManager::runOnModule(llvm::Module&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/IR/LegacyPassManager.cpp:1485:0
#17 0x000055e42e4d575f (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/IR/LegacyPassManager.cpp:1554:0
#18 0x000055e42e4d081f llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/IR/LegacyPassManager.cpp:542:0
#19 0x000055e42e4d5fe9 llvm::legacy::PassManager::run(llvm::Module&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/IR/LegacyPassManager.cpp:1682:0
#20 0x000055e42f4ce441 (anonymous namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/CodeGen/BackendUtil.cpp:1499:0
#21 0x000055e42f4cf600 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/CodeGen/BackendUtil.cpp:1660:0
#22 0x000055e43081d7f8 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/CodeGen/CodeGenAction.cpp:334:0
#23 0x000055e4326604ec clang::ParseAST(clang::Sema&, bool, bool) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/Parse/ParseAST.cpp:178:0
#24 0x000055e42fe2ee8f clang::ASTFrontendAction::ExecuteAction() /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/Frontend/FrontendAction.cpp:1058:0
#25 0x000055e43081a1fe clang::CodeGenAction::ExecuteAction() /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/CodeGen/CodeGenAction.cpp:1045:0
#26 0x000055e42fe2e758 clang::FrontendAction::Execute() /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/Frontend/FrontendAction.cpp:955:0
#27 0x000055e42fd6c890 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/Frontend/CompilerInstance.cpp:974:0
#28 0x000055e42ffc590e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278:0
#29 0x000055e42bdcf948 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/tools/driver/cc1_main.cpp:246:0
#30 0x000055e42bdc4240 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/tools/driver/driver.cpp:338:0
#31 0x000055e42fc4c641 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const::'lambda'()::operator()() const /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/Driver/Job.cpp:405:0
#32 0x000055e42fc4cc52 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const::'lambda'()>(long) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/include/llvm/ADT/STLExtras.h:178:0
#33 0x000055e42efabc1e llvm::function_ref<void ()>::operator()() const /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/include/llvm/ADT/STLExtras.h:200:0
#34 0x000055e42efb7d29 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/llvm/lib/Support/CrashRecoveryContext.cpp:426:0
#35 0x000055e42fc4c84c clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/Driver/Job.cpp:405:0
#36 0x000055e42fbfdcc8 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/Driver/Compilation.cpp:196:0
#37 0x000055e42fbfe044 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/Driver/Compilation.cpp:249:0
#38 0x000055e42fc0da78 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/lib/Driver/Driver.cpp:1556:0
#39 0x000055e42bdc51b2 main /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/clang/tools/driver/driver.cpp:505:0
#40 0x00007ffbaa230c87 __libc_start_main /build/glibc-uZu3wS/glibc-2.27/csu/../csu/libc-start.c:344:0
#41 0x000055e42bdc286a _start (/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/./bin/clang+++0x332b86a)
clang-13: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 13.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/./bin
clang-13: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/cos-67a1aa.cpp
clang-13: note: diagnostic msg: /tmp/cos-67a1aa.sh
clang-13: note: diagnostic msg:
********************
libc/src/math/x86_64/CMakeFiles/libc.src.math.x86_64.cos.dir/build.make:81: recipe for target 'libc/src/math/x86_64/CMakeFiles/libc.src.math.x86_64.cos.dir/cos.cpp.o' failed
make[5]: *** [libc/src/math/x86_64/CMakeFiles/libc.src.math.x86_64.cos.dir/cos.cpp.o] Error 134
CMakeFiles/Makefile2:25272: recipe for target 'libc/src/math/x86_64/CMakeFiles/libc.src.math.x86_64.cos.dir/all' failed
make[4]: *** [libc/src/math/x86_64/CMakeFiles/libc.src.math.x86_64.cos.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make[3]: *** [all] Error 2
runtimes/CMakeFiles/runtimes.dir/build.make:130: recipe for target 'runtimes/runtimes-stamps/runtimes-build' failed
make[2]: *** [runtimes/runtimes-stamps/runtimes-build] Error 2
CMakeFiles/Makefile2:156261: recipe for target 'runtimes/CMakeFiles/runtimes.dir/all' failed
make[1]: *** [runtimes/CMakeFiles/runtimes.dir/all] Error 2
Makefile:170: recipe for target 'all' failed
make: *** [all] Error 2
其中,/tmp/cos-67a1aa.cpp
Scanning dependencies of target libc.src.math.generic.ilogb
#ifdef LLVM_LIBC_PUBLIC_PACKAGING
#define LLVM_LIBC_FUNCTION(type, name, arglist) \
LLVM_LIBC_FUNCTION_ATTR decltype(__llvm_libc::name) \
__##name##_impl__ __asm__(#name); \
decltype(__llvm_libc::name) name [[gnu::alias(#name)]]; \
type __##name##_impl__ arglist
#else
# 29 "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/libc/src/__support/common.h"
#define LLVM_LIBC_FUNCTION(type, name, arglist) type name arglist
#endif
# 31 "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/libc/src/__support/common.h"
namespace __llvm_libc {
namespace internal {
constexpr bool same_string(char const *lhs, char const *rhs) {
for (; *lhs || *rhs; ++lhs, ++rhs)
if (*lhs != *rhs)
return false;
return true;
}
} // namespace internal
} // namespace __llvm_libc
// LLVM_LIBC_IS_DEFINED checks whether a particular macro is defined.
// Usage: constexpr bool kUseAvx = LLVM_LIBC_IS_DEFINED(__AVX__);
//
// This works by comparing the stringified version of the macro with and without
// evaluation. If FOO is not undefined both stringifications yield "FOO". If FOO
// is defined, one stringification yields "FOO" while the other yields its
// stringified value "1".
#define LLVM_LIBC_IS_DEFINED(macro) \
!__llvm_libc::internal::same_string( \
LLVM_LIBC_IS_DEFINED__EVAL_AND_STRINGIZE(macro), #macro)
#define LLVM_LIBC_IS_DEFINED__EVAL_AND_STRINGIZE(s) #s
#endif // LLVM_LIBC_SUPPORT_COMMON_H
# 56 "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/libc/src/__support/common.h"
# 11 "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/libc/src/math/x86_64/cos.cpp" 2
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(double, cos, (double x)) {
double result;
__asm__ __volatile__("fcos" : "=t"(result) : "f"(x));
return result;
}
} // namespace __llvm_libc
/tmp/cos-67a1aa.sh
# Crash reproducer for clang version 13.0.0
# Driver args: "--driver-mode=g++" "--target=x86_64-unknown-linux-gnu" "-D" "_DEBUG" "-D" "__STDC_CONSTANT_MACROS" "-D" "__STDC_FORMAT_MACROS" "-D" "__STDC_LIMIT_MACROS" "-I" "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/runtimes/runtimes-bins/libc/include" "-I" "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/libc" "-I" "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/runtimes/runtimes-bins/libc" "-fPIC" "-fno-semantic-interposition" "-fvisibility-inlines-hidden" "-Werror=date-time" "-Werror=unguarded-availability-new" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wmissing-field-initializers" "-Wimplicit-fallthrough" "-Wcovered-switch-default" "-Wno-noexcept-type" "-Wnon-virtual-dtor" "-Wdelete-non-virtual-dtor" "-Wsuggest-override" "-Wno-comment" "-Wstring-conversion" "-Wmisleading-indentation" "-g" "-O2" "-fpie" "-ffreestanding" "-D" "LLVM_LIBC_PUBLIC_PACKAGING" "-o" "CMakeFiles/libc.src.math.x86_64.cos.dir/cos.cpp.o" "-c" "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/libc/src/math/x86_64/cos.cpp"
# Original command: "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/bin/clang-13" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "--mrelax-relocations" "-disable-free" "-main-file-name" "cos.cpp" "-mrelocation-model" "pic" "-pic-level" "1" "-pic-is-pie" "-mframe-pointer=none" "-fmath-errno" "-fno-rounding-math" "-mconstructor-aliases" "-ffreestanding" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-debug-info-kind=constructor" "-dwarf-version=4" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/runtimes/runtimes-bins/libc/src/math/x86_64" "-resource-dir" "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/lib/clang/13.0.0" "-D" "_DEBUG" "-D" "__STDC_CONSTANT_MACROS" "-D" "__STDC_FORMAT_MACROS" "-D" "__STDC_LIMIT_MACROS" "-I" "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/runtimes/runtimes-bins/libc/include" "-I" "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/libc" "-I" "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/runtimes/runtimes-bins/libc" "-D" "LLVM_LIBC_PUBLIC_PACKAGING" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/x86_64-linux-gnu/c++/7.5.0" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/backward" "-internal-isystem" "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/lib/clang/13.0.0/include" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../x86_64-linux-gnu/include" "-internal-externc-isystem" "/usr/include/x86_64-linux-gnu" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-O2" "-Werror=date-time" "-Werror=unguarded-availability-new" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wmissing-field-initializers" "-Wimplicit-fallthrough" "-Wcovered-switch-default" "-Wno-noexcept-type" "-Wnon-virtual-dtor" "-Wdelete-non-virtual-dtor" "-Wsuggest-override" "-Wno-comment" "-Wstring-conversion" "-Wmisleading-indentation" "-fdeprecated-macro" "-fdebug-compilation-dir=/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/runtimes/runtimes-bins/libc/src/math/x86_64" "-ferror-limit" "19" "-fvisibility-inlines-hidden" "-fgnuc-version=4.2.1" "-fcxx-exceptions" "-fexceptions" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "CMakeFiles/libc.src.math.x86_64.cos.dir/cos.cpp.o" "-x" "c++" "/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/libc/src/math/x86_64/cos.cpp"
"/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/bin/clang-13" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "--mrelax-relocations" "-disable-free" "-main-file-name" "cos.cpp" "-mrelocation-model" "pic" "-pic-level" "1" "-pic-is-pie" "-mframe-pointer=none" "-fmath-errno" "-fno-rounding-math" "-mconstructor-aliases" "-ffreestanding" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-debug-info-kind=constructor" "-dwarf-version=4" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/runtimes/runtimes-bins/libc/src/math/x86_64" "-D" "_DEBUG" "-D" "__STDC_CONSTANT_MACROS" "-D" "__STDC_FORMAT_MACROS" "-D" "__STDC_LIMIT_MACROS" "-D" "LLVM_LIBC_PUBLIC_PACKAGING" "-O2" "-Werror=date-time" "-Werror=unguarded-availability-new" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wmissing-field-initializers" "-Wimplicit-fallthrough" "-Wcovered-switch-default" "-Wno-noexcept-type" "-Wnon-virtual-dtor" "-Wdelete-non-virtual-dtor" "-Wsuggest-override" "-Wno-comment" "-Wstring-conversion" "-Wmisleading-indentation" "-fdeprecated-macro" "-fdebug-compilation-dir=/home/hanmeimei/ex/llvmProj/llvm-project-llvmorg-13.0.0/buildClangALL/runtimes/runtimes-bins/libc/src/math/x86_64" "-ferror-limit" "19" "-fvisibility-inlines-hidden" "-fgnuc-version=4.2.1" "-fcxx-exceptions" "-fexceptions" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-x" "c++" "cos-67a1aa.cpp"
导致出现错误的原因待查。
先不编译libc,改称如下编译方式:
cmake -S llvm -B buildALL -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/home/hanmeimei/local/llvm_14_all -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind;openmp" -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;cross-project-tests;libc;libclc;lld;lldb;openmp;polly;pstl"
参考链接:
[llvm-bugs] [Bug 51421] New: LLVM libc fails to build in 13.0-rc1 (mail-archive.com)
[llvm-dev] [Release-testers] 13.0.0-rc1 has been tagged
二,hsa-runtime64 是什么?
hsa-runtime64 是什么?