From 642f2f6a51a0827dafd52399f82561a6309e6b34 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Sun, 9 Oct 2022 07:33:28 +0300 Subject: [PATCH] Link to libatomic [..] /usr/bin/ld: lib/Pass/CMakeFiles/obj.MLIRPass.dir/Pass.cpp.o: in function `std::__atomic_base::compare_exchange_strong(bool&, bool, std::memory_order, std::memory_order)': /usr/include/c++/12/bits/atomic_base.h:560: undefined reference to `__atomic_compare_exchange_1' /usr/bin/ld: /usr/include/c++/12/bits/atomic_base.h:560: undefined reference to `__atomic_compare_exchange_1' /usr/bin/ld: /usr/include/c++/12/bits/atomic_base.h:560: undefined reference to `__atomic_compare_exchange_1' /usr/bin/ld: /usr/include/c++/12/bits/atomic_base.h:560: undefined reference to `__atomic_compare_exchange_1' [..] Signed-off-by: David Abdurachmanov --- mlir.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mlir.spec b/mlir.spec index 138106e..35aa92f 100644 --- a/mlir.spec +++ b/mlir.spec @@ -11,7 +11,7 @@ Name: mlir Version: %{mlir_version}%{?rc_ver:~rc%{rc_ver}} -Release: 3.0.riscv64%{?dist} +Release: 3.1.riscv64%{?dist} Summary: Multi-Level Intermediate Representation Overview License: Apache-2.0 WITH LLVM-exception @@ -60,8 +60,12 @@ MLIR development files. # remove all but keep mlir find ../* -maxdepth 0 ! -name '%{name}' -exec rm -rf {} + - %build + +%ifarch riscv64 +export LDFLAGS="%__global_ldflags -Wl,--no-as-needed -latomic -Wl,--as-needed" +%endif + %cmake -GNinja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_SKIP_RPATH=ON \ @@ -123,6 +127,9 @@ export LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{_libdir}/cmake/mlir %changelog +* Sun Oct 09 2022 David Abdurachmanov - 15.0.0-3.1.riscv64 +- Link to libatomic + * Sat Oct 08 2022 David Abdurachmanov - 15.0.0-3.0.riscv64 - Disable LTO on riscv64