From db7bd1baa945b89f11e8c4ac426e7cb6e25e6cb1 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Mon, 26 Aug 2019 16:54:12 -0700 Subject: [PATCH] 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::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 --- clang.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang.spec b/clang.spec index 4129b8d..d338cd8 100644 --- a/clang.spec +++ b/clang.spec @@ -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