From 59a1531649fe0a8de38191771d0b12decfdea072 Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Tue, 31 Oct 2017 21:31:15 +0100 Subject: [PATCH 1/2] fix OSX compile - link `xmr-stak-backend` to `xmrstak_cuda_backend` to solve missing symboles --- CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 595631d..4a1da75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -429,9 +429,7 @@ if(CUDA_FOUND) ) endif() target_link_libraries(xmrstak_cuda_backend ${CUDA_LIBRARIES}) - if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - target_link_libraries(xmrstak_cuda_backend xmr-stak-backend) - endif() + target_link_libraries(xmrstak_cuda_backend xmr-stak-backend) endif() # compile AMD backend @@ -444,9 +442,7 @@ if(OpenCL_FOUND) ${OPENCLSRCFILES} ) target_link_libraries(xmrstak_opencl_backend ${OpenCL_LIBRARY} ) - if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - target_link_libraries(xmrstak_opencl_backend xmr-stak-backend) - endif() + target_link_libraries(xmrstak_opencl_backend xmr-stak-backend) endif() # compile final binary From 56706805b4a4910151c4e0eab8bef7d7d0bf4d8d Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Wed, 1 Nov 2017 08:53:40 +0100 Subject: [PATCH 2/2] add `CMAKE_POSITION_INDEPENDENT_CODE` fix `/usr/bin/ld: bin/libxmr-stak-backend.a(jconf.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC` --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a1da75..09b7c13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,6 +358,8 @@ endif() include_directories(BEFORE .) +set (CMAKE_POSITION_INDEPENDENT_CODE TRUE) + if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") # remove warnings that f_open() is not save and f_open_s should be used add_definitions(-D_CRT_SECURE_NO_DEPRECATE)