yaxunl added a comment. In D127142#3590874 <https://reviews.llvm.org/D127142#3590874>, @yaxunl wrote:
> In D127142#3571260 <https://reviews.llvm.org/D127142#3571260>, @MaskRay wrote: > >> In D127142#3570290 <https://reviews.llvm.org/D127142#3570290>, @yaxunl wrote: >> >>> If I use --rtlib=compiler-rt, does that also requires --unwindlib=unwindlib >>> ? >> >> No. --unwindlib=libunwind requires --rtlib=compiler-rt. --rtlib=compiler-rt >> is compatible with both --unwindlib=libgcc and --unwindlib=libunwind. > > If only use -rtlib=compiler-rt without changing unwind lib, I will get > missing symbol: > > [2022-06-16T20:05:28.644Z] ld.lld: error: undefined symbol: _Unwind_Resume > > [2022-06-16T20:05:28.644Z] >>> referenced by main.cpp > > [2022-06-16T20:05:28.644Z] >>> > CMakeFiles/MIOpenDriver.dir/main.cpp.o:(generate_skipahead_file()) > > [2022-06-16T20:05:28.644Z] >>> referenced by main.cpp > > [2022-06-16T20:05:28.644Z] >>> > CMakeFiles/MIOpenDriver.dir/main.cpp.o:(main) > > [2022-06-16T20:05:28.644Z] >>> referenced by main.cpp > > [2022-06-16T20:05:28.644Z] >>> > CMakeFiles/MIOpenDriver.dir/main.cpp.o:(std::function<void (float&, float, > bool&)> reduce::ReduceOpFn2<float>(miopenReduceTensorOp_t)) > > [2022-06-16T20:05:28.644Z] >>> referenced 1246 more times > > [2022-06-16T20:05:28.644Z] > > [2022-06-16T20:05:28.644Z] ld.lld: error: ../lib/libMIOpen.so.1.0.50300: > undefined reference to _Unwind_Resume [--no-allow-shlib-undefined] > > [2022-06-16T20:05:28.644Z] ld.lld: error: ../lib/libMIOpen.so.1.0.50300: > undefined reference to _Unwind_Backtrace [--no-allow-shlib-undefined] > > [2022-06-16T20:05:28.644Z] ld.lld: error: ../lib/libMIOpen.so.1.0.50300: > undefined reference to _Unwind_GetIP [--no-allow-shlib-undefined] > > [2022-06-16T20:05:28.644Z] clang-15: error: linker command failed with exit > code 1 (use -v to see invocation) If I use --rtlib=compiler-rt, do I have to explicitly add --unwindlib=libgcc or --unwindlib=libunwind? I suspect the linker is not linking the unwind library when -rtlib=compiler-rt is specified. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127142/new/ https://reviews.llvm.org/D127142 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits