Add -latomic to LDFLAGS

We failed to link due to missing -latomic

/usr/bin/ld: tools/extra/clangd/CMakeFiles/obj.clangDaemon.dir/ClangdLSPServer.cpp.o: in function `std::__atomic_base<bool>::exchange(bool, std::memory_order)':
/usr/include/llvm/Support/FormatVariadic.h:148: undefined reference to `__atomic_exchange_1'

Again -lpthread not -pthread used.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
This commit is contained in:
David Abdurachmanov 2019-08-26 16:54:12 -07:00
parent 37e90d4cf7
commit db7bd1baa9
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
1 changed files with 5 additions and 0 deletions

View File

@ -247,6 +247,11 @@ cd _build
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif
# Workaround for GCC issue
%ifarch riscv64
export LDFLAGS="${LDFLAGS} -latomic %{__global_ldflags}"
%endif
# -DCMAKE_INSTALL_RPATH=";" is a workaround for llvm manually setting the
# rpath of libraries and binaries. llvm will skip the manual setting
# if CAMKE_INSTALL_RPATH is set to a value, but cmake interprets this value