From aae69bd6850318b0979842cd0bedd67e66b2a1c9 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Fri, 22 Mar 2019 17:07:37 +0800 Subject: [PATCH] Fix pthread missing in riscv toolchain --- biscuit/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/biscuit/CMakeLists.txt b/biscuit/CMakeLists.txt index 3a7fbd6..0cc6243 100644 --- a/biscuit/CMakeLists.txt +++ b/biscuit/CMakeLists.txt @@ -47,7 +47,11 @@ set(CMAKE_C_COMPILER ${PREFIX}gcc) set(CMAKE_RANLIB ${PREFIX}ranlib) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-pointer-to-int-cast -Wno-format -MMD -MP -O -g -fPIC -static -std=gnu99") set(CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS}) +if (${ARCH} STREQUAL riscv64) +set(CMAKE_C_LINK_FLAGS "${LINK_FLAGS}") # override default value to get rid of '-Wl,-search_paths_first -Wl,-headerpad_max_install_names' +else () set(CMAKE_C_LINK_FLAGS "${LINK_FLAGS} -pthread") # override default value to get rid of '-Wl,-search_paths_first -Wl,-headerpad_max_install_names' +endif () set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # override default value to get rid of '-rdynamic' on Linux if (KERNEL_HEADERS_DIR)