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

faild build musl aarch64 target with -frounding-math #133

Closed
SquallATF opened this issue Feb 16, 2020 · 6 comments
Closed

faild build musl aarch64 target with -frounding-math #133

SquallATF opened this issue Feb 16, 2020 · 6 comments

Comments

@SquallATF
Copy link
Contributor

clang -std=c99 -nostdinc -ffreestanding -frounding-math -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I./arch/aarch64 -I./arch/generic -Iobj/src/internal -I./src/include -I./src/internal -Iobj/include -I./include  -Os -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -Qunused-arguments  -fPIC -c -o obj/src/complex/casinf.lo src/complex/casinf.c
fatal error: error in backend: Cannot select: 0x1fbd190: f32 = truncate 0x1fba1b0
  0x1fba1b0: f64,ch = strict_fsub nofpexcept 0x1f276f8, ConstantFP:f64<1.000000e+00>, 0x1fba0e0
    0x1fba148: f64 = ConstantFP<1.000000e+00>
    0x1fba0e0: f64,ch = strict_fp_extend nofpexcept 0x1f276f8, 0x1fba078
      0x1fba078: f32,ch = strict_fmul nofpexcept 0x1f276f8, 0x1fb9fa8, 0x1fba010
        0x1fb9fa8: f32,ch = strict_fsub nofpexcept 0x1f276f8, 0x1fb9e08, 0x1fb9ed8
          0x1fb9e08: f32,ch = CopyFromReg 0x1f276f8, Register:f32 %0
            0x1fb9da0: f32 = Register %0
          0x1fb9ed8: f32,ch = CopyFromReg 0x1f276f8, Register:f32 %1
            0x1fb9e70: f32 = Register %1
        0x1fba010: f32,ch = strict_fadd nofpexcept 0x1f276f8, 0x1fb9e08, 0x1fb9ed8
          0x1fb9e08: f32,ch = CopyFromReg 0x1f276f8, Register:f32 %0
            0x1fb9da0: f32 = Register %0
          0x1fb9ed8: f32,ch = CopyFromReg 0x1f276f8, Register:f32 %1
            0x1fb9e70: f32 = Register %1
In function: casinf
Stack dump:
0.      Program arguments: clang -std=c99 -nostdinc -ffreestanding -frounding-math -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I./arch/aarch64 -I./arch/generic -Iobj/src/internal -I./src/include -I./src/internal -Iobj/include -I./include -Os -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -Qunused-arguments -fPIC -c -o obj/src/complex/casinf.lo src/complex/casinf.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'src/complex/casinf.c'.
4.      Running pass 'AArch64 Instruction Selection' on function '@casinf'
 #0 0x00007fad433ce8fd PrintStackTraceSignalHandler(void*) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xc368fd)
 #1 0x00007fad433cc6ae llvm::sys::RunSignalHandlers() (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xc346ae)
 #2 0x00007fad433cdbbd llvm::sys::CleanupOnSignal(unsigned long) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xc35bbd)
 #3 0x00007fad4331d9ea (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xb859ea)
 #4 0x00007fad4331d98b (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xb8598b)
 #5 0x00007fad433c998e (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xc3198e)
 #6 0x0000000000210ff1 (/opt/cross/aarch64-unknown-linux-gnu/bin/clang-10+0x210ff1)
 #7 0x00007fad433285c7 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xb905c7)
 #8 0x00007fad433286a0 llvm::report_fatal_error(llvm::StringRef, bool) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xb906a0)
 #9 0x00007fad43a3df49 (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0x12a5f49)
#10 0x00007fad43a3d645 (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0x12a5645)
#11 0x00007fad4481372f (anonymous namespace)::AArch64DAGToDAGISel::Select(llvm::SDNode*) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0x207b72f)
#12 0x00007fad43a35fbc llvm::SelectionDAGISel::DoInstructionSelection() (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0x129dfbc)
#13 0x00007fad43a3565c llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0x129d65c)
#14 0x00007fad43a34d3a llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0x129cd3a)
#15 0x00007fad43a32656 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0x129a656)
#16 0x00007fad436a31ae llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xf0b1ae)
#17 0x00007fad434e1d36 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xd49d36)
#18 0x00007fad434e1fb3 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xd49fb3)
#19 0x00007fad434e2471 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xd4a471)
#20 0x00007fad4172bb84 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream> >) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libclang-cpp.so.10git+0x1794b84)
#21 0x00007fad419c074c clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libclang-cpp.so.10git+0x1a2974c)
#22 0x00007fad40b29c63 clang::ParseAST(clang::Sema&, bool, bool) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libclang-cpp.so.10git+0xb92c63)
#23 0x00007fad41e8d487 clang::FrontendAction::Execute() (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libclang-cpp.so.10git+0x1ef6487)
#24 0x00007fad41e29881 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libclang-cpp.so.10git+0x1e92881)
#25 0x00007fad41ef3e47 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libclang-cpp.so.10git+0x1f5ce47)
#26 0x0000000000210bee cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/cross/aarch64-unknown-linux-gnu/bin/clang-10+0x210bee)
#27 0x000000000020edc1 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) (/opt/cross/aarch64-unknown-linux-gnu/bin/clang-10+0x20edc1)
#28 0x00007fad41b66122 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, bool*) const::$_1>(long) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libclang-cpp.so.10git+0x1bcf122)
#29 0x00007fad4331d967 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libLLVM-10git.so+0xb85967)
#30 0x00007fad41b65750 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, bool*) const (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libclang-cpp.so.10git+0x1bce750)
#31 0x00007fad41b34d81 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libclang-cpp.so.10git+0x1b9dd81)
#32 0x00007fad41b352ba clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) const (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libclang-cpp.so.10git+0x1b9e2ba)
#33 0x00007fad41b4d99b clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) (/opt/cross/aarch64-unknown-linux-gnu/bin/../lib/libclang-cpp.so.10git+0x1bb699b)
#34 0x000000000020e710 main (/opt/cross/aarch64-unknown-linux-gnu/bin/clang-10+0x20e710)
#35 0x00007fad3f829b97 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#36 0x000000000020bfaa _start (/opt/cross/aarch64-unknown-linux-gnu/bin/clang-10+0x20bfaa)
clang-10: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 10.0.0 (https://github.com/llvm/llvm-project.git da883d2c3b2fcf4977f2bbac11012da804655919)
Target: aarch64-openwrt-linux-musl
Thread model: posix
InstalledDir: /opt/cross/aarch64-unknown-linux-gnu/bin
clang-10: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-10: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-10: note: diagnostic msg: /tmp/casinf-f7b816.c
clang-10: note: diagnostic msg: /tmp/casinf-f7b816.sh
clang-10: note: diagnostic msg:

********************

casinf-f7b816.zip

@zmodem
Copy link
Collaborator

zmodem commented Feb 17, 2020

This seems to fail on the 10.x branch, but not master (I used 377b0e2).

I'll try to bisect to see what made it stop crashing on master..

@zmodem
Copy link
Collaborator

zmodem commented Feb 17, 2020

Seems it was fixed by 258d8dd. I'll follow up on the code review for that: https://reviews.llvm.org/D73201

@SquallATF
Copy link
Contributor Author

I have cherry-pick 258d8dd , but still build crash at another file.

clang -std=c99 -nostdinc -ffreestanding -frounding-math -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I./arch/aarch64 -I./arch/generic -Iobj/src/internal -I./src/include -I./src/internal -Iobj/include -I./include  -Os -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -Qunused-arguments  -fPIC -c -o obj/src/complex/catan.lo src/complex/catan.c
clang: /home/squallatf/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:2420: llvm::SDValue (anonymous namespace)::SelectionDAGLegalize::ExpandLegalINT_TO_FP(llvm::SDNode *, llvm::SDValue &): Assertion `!isSigned && "Legalize cannot Expand SINT_TO_FP for i64 yet"' failed.
Stack dump:
0.      Program arguments: clang -std=c99 -nostdinc -ffreestanding -frounding-math -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I./arch/aarch64 -I./arch/generic -Iobj/src/internal -I./src/include -I./src/internal -Iobj/include -I./include -Os -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -Qunused-arguments -fPIC -c -o obj/src/complex/catan.lo src/complex/catan.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'src/complex/catan.c'.
4.      Running pass 'AArch64 Instruction Selection' on function '@catan'
 #0 0x00007f2276cc5ce7 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/squallatf/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:11
 #1 0x00007f2276cc5dd9 PrintStackTraceSignalHandler(void*) /home/squallatf/llvm-project/llvm/lib/Support/Unix/Signals.inc:625:1
 #2 0x00007f2276cc472b llvm::sys::RunSignalHandlers() /home/squallatf/llvm-project/llvm/lib/Support/Signals.cpp:67:5     #3 0x00007f2276cc560e llvm::sys::CleanupOnSignal(unsigned long) /home/squallatf/llvm-project/llvm/lib/Support/Unix/Signals.inc:362:1
 #4 0x00007f2276b38ec8 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) /home/squallatf/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:77:20
 #5 0x00007f2276b3914e CrashRecoverySignalHandler(int) /home/squallatf/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:383:1
 #6 0x00007f22741a3890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #7 0x00007f226de86e97 raise /build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #8 0x00007f226de88801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #9 0x00007f226de7839a __assert_fail_base /build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
#10 0x00007f226de78412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
#11 0x00007f227783f2f8 (anonymous namespace)::SelectionDAGLegalize::ExpandLegalINT_TO_FP(llvm::SDNode*, llvm::SDValue&) /home/squallatf/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:2425:11
#12 0x00007f2277821c7e (anonymous namespace)::SelectionDAGLegalize::ExpandNode(llvm::SDNode*) /home/squallatf/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:2970:12
#13 0x00007f227781ee6b (anonymous namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*) /home/squallatf/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1253:11
#14 0x00007f227781d6db llvm::SelectionDAG::Legalize() /home/squallatf/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:4800:13
#15 0x00007f2277a03834 llvm::SelectionDAGISel::CodeGenAndEmitDAG() /home/squallatf/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:926:3
#16 0x00007f2277a0263f llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, bool&) /home/squallatf/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:737:1
#17 0x00007f2277a020a4 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /home/squallatf/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:0:7
#18 0x00007f22779ff2e1 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/squallatf/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:503:3
#19 0x00007f22797a2488 (anonymous namespace)::AArch64DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/squallatf/llvm-project/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:54:5
#20 0x00007f2277373b57 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/squallatf/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:73:8
#21 0x00007f2276f3347c llvm::FPPassManager::runOnFunction(llvm::Function&) /home/squallatf/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1481:23
#22 0x00007f2276f338a5 llvm::FPPassManager::runOnModule(llvm::Module&) /home/squallatf/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1517:16
#23 0x00007f2276f34024 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/squallatf/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1582:23
#24 0x00007f2276f33b48 llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/squallatf/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1694:16
#25 0x00007f2276f345c1 llvm::legacy::PassManager::run(llvm::Module&) /home/squallatf/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1725:3
#26 0x00007f22722de13b (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream> >) /home/squallatf/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:913:3
#27 0x00007f22722da4ab clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream> >) /home/squallatf/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1550:5
#28 0x00007f22727b836c clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /home/squallatf/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:335:7
#29 0x00007f2270803f8e clang::ParseAST(clang::Sema&, bool, bool) /home/squallatf/llvm-project/clang/lib/Parse/ParseAST.cpp:178:12
#30 0x00007f227306a382 clang::ASTFrontendAction::ExecuteAction() /home/squallatf/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1045:1
#31 0x00007f22727b3340 clang::CodeGenAction::ExecuteAction() /home/squallatf/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1177:1
#32 0x00007f2273069d58 clang::FrontendAction::Execute() /home/squallatf/llvm-project/clang/lib/Frontend/FrontendAction.cpp:940:7
#33 0x00007f2273008373 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/squallatf/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:965:23
#34 0x00007f2273146da0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/squallatf/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:290:8
#35 0x0000000000235bc8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/squallatf/llvm-project/clang/tools/driver/cc1_main.cpp:240:13
#36 0x00000000002289f2 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) /home/squallatf/llvm-project/clang/tools/driver/driver.cpp:328:5
#37 0x00007f2272befaa8 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, bool*) const::$_1::operator()() const /home/squallatf/llvm-project/clang/lib/Driver/Job.cpp:417:34
#38 0x00007f2272befa75 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, bool*) const::$_1>(long) /home/squallatf/llvm-project/llvm/include/llvm/ADT/STLExtras.h:108:5
#39 0x00007f2276b39429 llvm::function_ref<void ()>::operator()() const /home/squallatf/llvm-project/llvm/include/llvm/ADT/STLExtras.h:125:5
#40 0x00007f2276b38cb4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) /home/squallatf/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:419:3
#41 0x00007f2272bef256 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, bool*) const /home/squallatf/llvm-project/clang/lib/Driver/Job.cpp:417:7
#42 0x00007f2272b9ba22 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const /home/squallatf/llvm-project/clang/lib/Driver/Compilation.cpp:182:7
#43 0x00007f2272b9bc0b clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) const /home/squallatf/llvm-project/clang/lib/Driver/Compilation.cpp:233:13
#44 0x00007f2272bb5fce clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) /home/squallatf/llvm-project/clang/lib/Driver/Driver.cpp:1480:7      #45 0x00000000002283cf main /home/squallatf/llvm-project/clang/tools/driver/driver.cpp:496:9
#46 0x00007f226de69b97 __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#47 0x00000000002273fa _start (/opt/cross/aarch64-unknown-linux-gnu/bin/clang-10+0x2273fa)
clang-10: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 10.0.0 (https://github.com/llvm/llvm-project.git 2a6fbb0c039857a394c1890c4957f34a1c5f700c)
Target: aarch64-openwrt-linux-musl
Thread model: posix
InstalledDir: /opt/cross/aarch64-unknown-linux-gnu/bin
clang-10: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-10: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-10: note: diagnostic msg: /tmp/catan-3cdc6c.c
clang-10: note: diagnostic msg: /tmp/catan-3cdc6c.sh
clang-10: note: diagnostic msg:

********************
Segmentation fault

catan-3cdc6c.zip

@zmodem
Copy link
Collaborator

zmodem commented Feb 18, 2020

Thank you for sharing the repro.
That one was fixed by 0bb9a27
This is one of the commits listed by John here: https://reviews.llvm.org/D73201#1880487 and I will try to get them all onto the 10.x branch.

Can you share instructions for building musl with -frounding-math so that I can verify that this fixes all issues?

@SquallATF
Copy link
Contributor Author

SquallATF commented Feb 19, 2020

musl default configure will use -frounding-math default if compiler supported.

CC=clang ./configure --prefix=/usr --build=x86_64-unkown-linux-gnu --host=aarch64-unkown-linux-musl --target=aarch64-unkown-linux-musl

I have cherry-pick all commits listed in https://reviews.llvm.org/D73201#1880487 and I can build musl successful.

@zmodem
Copy link
Collaborator

zmodem commented Feb 19, 2020

Excellent, thank you! Let's close this then.

@zmodem zmodem closed this as completed Feb 19, 2020
trevor-m pushed a commit to trevor-m/llvm-project that referenced this issue Apr 20, 2023
This reverts commit 997f33c. Breaks check-mlir

******************** TEST 'MLIR :: IR/attribute.mlir' FAILED ********************
Script:
--
: 'RUN: at line 1';   mlir-opt llvm-project/mlir/test/IR/attribute.mlir -split-input-file -verify-diagnostics | /FileCheck llvm-project/mlir/test/IR/attribute.mlir
--
Exit Code: 1

Command Output (stderr):
--
llvm-project/mlir/test/IR/attribute.mlir split at line llvm#1:19:3: error: unexpected error: 'test.int_attrs' op requires attribute 'index_attr'
  "test.int_attrs"() {
  ^
llvm-project/mlir/test/IR/attribute.mlir split at line llvm#120:6:3: error: unexpected error: 'test.int_attrs' op requires attribute 'index_attr'
  "test.int_attrs"() {
  ^
llvm-project/mlir/test/IR/attribute.mlir split at line llvm#120:5:6: error: expected error "'si32_attr' failed to satisfy constraint: 32-bit signed integer attribute" was not produced
  // expected-error @+1 {{'si32_attr' failed to satisfy constraint: 32-bit signed integer attribute}}
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm-project/mlir/test/IR/attribute.mlir split at line llvm#133:5:3: error: unexpected error: 'test.int_attrs' op requires attribute 'index_attr'
  "test.int_attrs"() {
  ^
llvm-project/mlir/test/IR/attribute.mlir split at line llvm#133:4:6: error: expected error "'ui32_attr' failed to satisfy constraint: 32-bit unsigned integer attribute" was not produced
  // expected-error @+1 {{'ui32_attr' failed to satisfy constraint: 32-bit unsigned integer attribute}}
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm-project/mlir/test/IR/attribute.mlir:9:12: error: CHECK: expected string not found in input
 // CHECK: any_i32_attr = 5 : ui32
           ^
<stdin>:3:1: note: scanning from here
module {
^
<stdin>:21:28: note: possible intended match here
 "test.non_negative_int_attr"() {i32attr = 5 : i32, i64attr = 10 : i64} : () -> ()
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