52 lines
1.7 KiB
Diff
52 lines
1.7 KiB
Diff
From a9dc984a35f0f522e3a1ec0d310facb3246a5d0f Mon Sep 17 00:00:00 2001
|
|
From: John Zimmermann <johnz@posteo.net>
|
|
Date: Fri, 25 Jan 2019 13:47:21 +0000
|
|
Subject: [PATCH] Fix Compilation against Musl libc
|
|
|
|
diff --git pal/shared/gpuopen/inc/posix/ddPosixPlatform.h pal/shared/gpuopen/inc/posix/ddPosixPlatform.h
|
|
index df54bfe..55d707c 100644
|
|
--- pal/shared/gpuopen/inc/posix/ddPosixPlatform.h
|
|
+++ pal/shared/gpuopen/inc/posix/ddPosixPlatform.h
|
|
@@ -72,6 +72,9 @@ static_assert(false, "Unknown platform detected")
|
|
#else
|
|
#define DD_AXIOMATICALLY_CANNOT_HAPPEN(expr) ((expr) ? DD_UNUSED(0) : __builtin_unreachable())
|
|
#endif
|
|
+#if defined(__linux__) && !defined(__GLIBC__)
|
|
+#include "rand48_r.h"
|
|
+#endif
|
|
|
|
namespace DevDriver
|
|
{
|
|
|
|
--- pal/shared/gpuopen/src/posix/ddPosixSocket.cpp 2019-03-01 15:31:04.000000000 +0100
|
|
+++ - 2019-03-04 15:42:00.789284605 +0100
|
|
@@ -34,12 +34,12 @@
|
|
#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
#include <sys/un.h>
|
|
-#include <sys/fcntl.h>
|
|
#include <netinet/in.h>
|
|
#include <netinet/tcp.h>
|
|
#include <netdb.h>
|
|
#include <arpa/inet.h>
|
|
|
|
+#include <fcntl.h>
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
--- pal/shared/gpuopen/CMakeLists.txt 2019-03-04 16:34:47.139749973 +0100
|
|
+++ - 2019-03-04 17:31:07.508510970 +0100
|
|
@@ -119,7 +119,10 @@
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
find_package(Threads REQUIRED)
|
|
target_link_libraries(${GPUOPEN_LIB_NAME} Threads::Threads)
|
|
-
|
|
+ check_symbol_exists(seed48_r stdlib.h HAVE_RAND48)
|
|
+ if(NOT HAVE_RAND48)
|
|
+ target_link_libraries(${GPUOPEN_LIB_NAME} rand48_r)
|
|
+ endif()
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|(Apple)?Clang)$")
|
|
target_compile_options(${GPUOPEN_LIB_NAME} PRIVATE
|
|
-fno-exceptions
|