void-packages/srcpkgs/amdvlk/patches/musl.patch
2019-06-11 13:21:50 +02:00

50 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-06-06 14:52:37.000000000 +0200
+++ - 2019-06-10 19:23:05.932195923 +0200
@@ -72,6 +72,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()
endif()
### Build Defines ######################################################################################################