diff --git a/CMakeLists.txt b/CMakeLists.txt index a1fae72e7..a70cbd61f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,6 +147,10 @@ else() option(CPPTHREADS "C++11 threads" ON) endif() +if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") + SET(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,wxneeded") +endif() + # Development branch features # # Option Description Def. Condition Otherwise diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index 98907f07a..e48cb1f3e 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -54,6 +54,10 @@ # include #endif +#ifdef Q_OS_OPENBSD +# include +#endif + #if 0 static QByteArray buf; #endif @@ -804,8 +808,10 @@ plat_set_thread_name(void *thread, const char *name) char truncated[16]; # endif strncpy(truncated, name, sizeof(truncated) - 1); -# ifdef Q_OS_DARWIN +# if defined(Q_OS_DARWIN) pthread_setname_np(truncated); +# elif defined(Q_OS_OPENBSD) + pthread_set_name_np(thread ? *((pthread_t *) thread) : pthread_self(), truncated); # else pthread_setname_np(thread ? *((pthread_t *) thread) : pthread_self(), truncated); # endif