Link to libatomic

[..]
/usr/bin/ld: lib/Pass/CMakeFiles/obj.MLIRPass.dir/Pass.cpp.o: in function `std::__atomic_base<bool>::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 <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2022-10-09 07:33:28 +03:00
parent 4469d76e34
commit 642f2f6a51
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB

View File

@ -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 <davidlt@rivosinc.com> - 15.0.0-3.1.riscv64
- Link to libatomic
* Sat Oct 08 2022 David Abdurachmanov <davidlt@rivosinc.com> - 15.0.0-3.0.riscv64
- Disable LTO on riscv64