diff --git a/srcpkgs/amdvlk/patches/musl.patch b/srcpkgs/amdvlk/patches/musl.patch index 493c08ff174..d0aa958dd15 100644 --- a/srcpkgs/amdvlk/patches/musl.patch +++ b/srcpkgs/amdvlk/patches/musl.patch @@ -1,119 +1,51 @@ -diff --git pal/shared/gpuopen/CMakeLists.txt pal/shared/gpuopen/CMakeLists.txt -index 592d556..8b73198 100644 ---- pal/shared/gpuopen/CMakeLists.txt -+++ pal/shared/gpuopen/CMakeLists.txt -@@ -179,6 +179,10 @@ if(UNIX) - src/posix/ddPosixSocket.cpp - src/socketMsgTransport.cpp - ) -+ check_symbol_exists(seed48_r stdlib.h HAVE_RAND48) -+ if(NOT HAVE_RAND48) -+ target_sources(gpuopen PRIVATE src/posix/ddRand48.c) -+ endif() - endif() - - ### Helper Classes ### +From a9dc984a35f0f522e3a1ec0d310facb3246a5d0f Mon Sep 17 00:00:00 2001 +From: John Zimmermann +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 2eed863..2aa57d0 100644 +index df54bfe..55d707c 100644 --- pal/shared/gpuopen/inc/posix/ddPosixPlatform.h +++ pal/shared/gpuopen/inc/posix/ddPosixPlatform.h -@@ -53,6 +53,10 @@ static_assert(false, "Unknown platform detected") - - #define DD_RESTRICT __restrict__ - +@@ -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 "ddRand48.h" ++#include "rand48_r.h" +#endif -+ + namespace DevDriver { - namespace Platform -diff --git pal/shared/gpuopen/inc/posix/ddRand48.h pal/shared/gpuopen/inc/posix/ddRand48.h -new file mode 100644 -index 0000000..5c1b628 ---- /dev/null -+++ pal/shared/gpuopen/inc/posix/ddRand48.h -@@ -0,0 +1,26 @@ -+#ifndef RAND48_H -+#define RAND48_H -+#ifdef __cplusplus -+extern "C" { -+#endif -+#include -+#include -+#include -+#include -+ -+struct drand48_data { -+ unsigned short __x[3]; -+ unsigned short __old_x[3]; -+ unsigned short __c; -+ unsigned short __init; -+ long long __a; -+}; -+ -+uint64_t __rand48_step(unsigned short *xi, unsigned short *lc); -+int jrand48_r(unsigned short s[3], struct drand48_data *buffer, long *result); -+int mrand48_r(struct drand48_data *buffer,long *result); -+int seed48_r(unsigned short *s, struct drand48_data *buffer); -+#ifdef __cplusplus -+} -+#endif -+#endif -diff --git pal/shared/gpuopen/src/posix/ddPosixSocket.cpp pal/shared/gpuopen/src/posix/ddPosixSocket.cpp -index d788c5f..42b2bc8 100644 ---- pal/shared/gpuopen/src/posix/ddPosixSocket.cpp -+++ pal/shared/gpuopen/src/posix/ddPosixSocket.cpp -@@ -34,7 +34,7 @@ + +--- 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 #include #include --#include -+#include - #include +-#include #include #include -diff --git pal/shared/gpuopen/src/posix/ddRand48.c pal/shared/gpuopen/src/posix/ddRand48.c -new file mode 100644 -index 0000000..c600dce ---- /dev/null -+++ pal/shared/gpuopen/src/posix/ddRand48.c -@@ -0,0 +1,38 @@ -+#include -+ -+uint64_t __rand48_step(unsigned short *xi, unsigned short *lc) -+{ -+ uint64_t a, x; -+ x = xi[0] | xi[1]+0U<<16 | xi[2]+0ULL<<32; -+ a = lc[0] | lc[1]+0U<<16 | lc[2]+0ULL<<32; -+ x = a*x + lc[3]; -+ xi[0] = x; -+ xi[1] = x>>16; -+ xi[2] = x>>32; -+ return x & 0xffffffffffffull; -+} -+ -+ -+int jrand48_r(unsigned short s[3], struct drand48_data *buffer, long *result) -+{ -+ *result = (int32_t)(__rand48_step(s, buffer->__x+3) >> 16); -+ return 0; -+} -+ -+int mrand48_r(struct drand48_data *buffer,long *result) -+{ -+ *result = jrand48_r(buffer->__x,buffer,result); -+ return 0; -+} -+ -+ -+int seed48_r(unsigned short *s, struct drand48_data *buffer) -+{ -+ memcpy(buffer->__old_x, buffer->__x, sizeof buffer->__x); -+ memcpy(buffer->__x, s, sizeof buffer->__x); -+ buffer->__c = 0; -+ buffer->__init = 1; -+ buffer->__a = 0; -+ return 0; -+} -+ + #include + #include + ++#include + #include + #include + #include + +--- 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 diff --git a/srcpkgs/amdvlk/template b/srcpkgs/amdvlk/template index 4374ef1a0de..443876f4b7a 100644 --- a/srcpkgs/amdvlk/template +++ b/srcpkgs/amdvlk/template @@ -1,11 +1,11 @@ # Template file for 'amdvlk' pkgname=amdvlk -version=2019.Q1.5 +version=2019.Q1.7 revision=1 -_llpc_commit=a1ee25169453ba909ba940d7d25e2739d2f453ed -_xgl_commit=dbabc93bc9c3a5a1e7e73672b3d4594b0611fa36 -_pal_commit=3bb2d4082ef9b95a114258a90c7044939a5f0638 -_llvm_commit=d3c2b9d104f0de0be59d914578a28275c8b4784d +_llpc_commit=8eecb4baef898f0a5b9902406626887c3646dbb6 +_xgl_commit=f2af4b0c33963842f544107d005f0a6c82ea513f +_pal_commit=e8a5acd90310871053a40015ebcea5b32391a824 +_llvm_commit=c7a5a5c3bac75699d45824523b4fcf045913413f _wsa_commit=f558403d3292039de4d17334e562bda58abfc72c create_wrksrc=yes build_wrksrc="xgl" @@ -25,14 +25,18 @@ distfiles="https://github.com/GPUOpen-Drivers/AMDVLK/archive/v-${version}.tar.gz https://github.com/GPUOpen-Drivers/pal/archive/${_pal_commit}.tar.gz https://github.com/GPUOpen-Drivers/llvm/archive/${_llvm_commit}.tar.gz https://github.com/GPUOpen-Drivers/wsa/archive/${_wsa_commit}.tar.gz" -checksum="337817144721afb14fb2ee8e040c500da3d49701d09de0fb64fc5a307eb4a0b0 - f93d7f23969316dc576ef7ffbdf0c21d9dd306ab8df5544a7c5f966f0dea9846 - 9be9dbe5a0b493e5d1a5839d62d3021f971400ef2fd0ac29b47b444be15dcc27 - 95bcc4905d80268d9324a09df16100704ecf571deaa2a9701040f8828d9f7015 - b8437e2ab9a192af534516c5b1bed4c975cbb77b4ff75a1d58cabc25dbcda80a +checksum="960675c121ec3d791cdd8c76455216f5fef2232aa23d3154a9298fa60b6f3d63 + fc9ea2c4ce1f1ff2840966a4ee83eef1cf6baad0ce213454705d9130a4292015 + cf6c521e0f66b96386e592d58aae2a61748d182cededbd5163fdbaa65ebcd915 + 9bf478a2a0594b4ccabd614941efd94cadd403b28ff232b6f33dce023c5e61f0 + 8eb29c137998ed12627ce765e91646481338173b9c9169aff7c1e378d0bbbb36 b23e9453fa7b14bb13157fb645936ec74b18b12cdef301758452a92b23f27705" nocross=yes +case $XBPS_TARGET_MACHINE in + *-musl) makedepends+=" rand48_r-devel" +esac + post_extract() { mv ${wrksrc}/AMDVLK-v-${version} ${wrksrc}/AMDVLK mv ${wrksrc}/xgl-${_xgl_commit} ${wrksrc}/xgl