Compile and linker fixes for OpenBSD
* link with wxneeded required for DYNAREC, in addition to being installed onto a filesystem with the wxallowed flag (like /usr/local on a default installation) * pthread_setname_np is pthread_set_name_np on OpenBSD
This commit is contained in:
@@ -147,6 +147,10 @@ else()
|
|||||||
option(CPPTHREADS "C++11 threads" ON)
|
option(CPPTHREADS "C++11 threads" ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||||
|
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,wxneeded")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Development branch features
|
# Development branch features
|
||||||
#
|
#
|
||||||
# Option Description Def. Condition Otherwise
|
# Option Description Def. Condition Otherwise
|
||||||
|
|||||||
@@ -54,6 +54,10 @@
|
|||||||
# include <sys/mman.h>
|
# include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef Q_OS_OPENBSD
|
||||||
|
# include <pthread_np.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static QByteArray buf;
|
static QByteArray buf;
|
||||||
#endif
|
#endif
|
||||||
@@ -804,8 +808,10 @@ plat_set_thread_name(void *thread, const char *name)
|
|||||||
char truncated[16];
|
char truncated[16];
|
||||||
# endif
|
# endif
|
||||||
strncpy(truncated, name, sizeof(truncated) - 1);
|
strncpy(truncated, name, sizeof(truncated) - 1);
|
||||||
# ifdef Q_OS_DARWIN
|
# if defined(Q_OS_DARWIN)
|
||||||
pthread_setname_np(truncated);
|
pthread_setname_np(truncated);
|
||||||
|
# elif defined(Q_OS_OPENBSD)
|
||||||
|
pthread_set_name_np(thread ? *((pthread_t *) thread) : pthread_self(), truncated);
|
||||||
# else
|
# else
|
||||||
pthread_setname_np(thread ? *((pthread_t *) thread) : pthread_self(), truncated);
|
pthread_setname_np(thread ? *((pthread_t *) thread) : pthread_self(), truncated);
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
Reference in New Issue
Block a user