Merge pull request #2516 from pullmoll/intel-gpu-tools

intel-gpu-tools: better fix for musl
This commit is contained in:
Juan RP 2015-09-14 07:03:06 +02:00
commit deee4c42f5
3 changed files with 34 additions and 69 deletions

View File

@ -0,0 +1,32 @@
For musl libc instead of including <sys/ioctl.h>, which leads to
an error when redefining ioctl(3) and close(3), just define the
prototype for ioctl().
--- benchmarks/gem_exec_tracer.c 2015-08-17 18:38:30.000000000 +0200
+++ benchmarks/gem_exec_tracer.c 2015-09-13 17:03:34.768431063 +0200
@@ -32,7 +32,11 @@
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
+#if defined(__GLIBC__)
#include <sys/ioctl.h>
+#else
+int ioctl(int fd, unsigned long request, ...);
+#endif
#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>
--- tools/aubdump.c 2015-09-08 19:01:19.000000000 +0200
+++ tools/aubdump.c 2015-09-13 17:06:27.850430550 +0200
@@ -32,7 +32,11 @@
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
+#if defined(__GLIBC__)
#include <sys/ioctl.h>
+#else
+int ioctl(int fd, unsigned long request, ...);
+#endif
#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>

View File

@ -1,67 +0,0 @@
Do not redefine ioctl() and close(), conflicts with the libc declarations.
Fixes musl build.
--xtraeme
--- benchmarks/gem_exec_tracer.c.orig 2015-09-12 08:46:22.024640552 +0200
+++ benchmarks/gem_exec_tracer.c 2015-09-12 08:46:51.737733668 +0200
@@ -162,7 +162,7 @@ trace_del(uint32_t handle)
}
int
-close(int fd)
+myclose(int fd)
{
if (fd == drm_fd)
drm_fd = -1;
@@ -200,7 +200,7 @@ static int is_i915(int fd)
}
int
-ioctl(int fd, unsigned long request, ...)
+myioctl(int fd, unsigned long request, ...)
{
va_list args;
void *argp;
@@ -281,8 +281,8 @@ ioctl(int fd, unsigned long request, ...
static void __attribute__ ((constructor))
init(void)
{
- libc_close = dlsym(RTLD_NEXT, "close");
- libc_ioctl = dlsym(RTLD_NEXT, "ioctl");
+ libc_close = dlsym(RTLD_NEXT, "myclose");
+ libc_ioctl = dlsym(RTLD_NEXT, "myioctl");
fail_if(libc_close == NULL || libc_ioctl == NULL,
"failed to get libc ioctl or close\n");
}
--- tools/aubdump.c.orig 2015-09-12 08:45:16.921302516 +0200
+++ tools/aubdump.c 2015-09-12 08:45:51.750828746 +0200
@@ -398,7 +398,7 @@ remove_bo(int handle)
}
int
-close(int fd)
+myclose(int fd)
{
if (fd == drm_fd)
drm_fd = -1;
@@ -407,7 +407,7 @@ close(int fd)
}
int
-ioctl(int fd, unsigned long request, ...)
+myioctl(int fd, unsigned long request, ...)
{
va_list args;
void *argp;
@@ -532,8 +532,8 @@ init(void)
{
const char *args = getenv("INTEL_AUBDUMP_ARGS");
- libc_close = dlsym(RTLD_NEXT, "close");
- libc_ioctl = dlsym(RTLD_NEXT, "ioctl");
+ libc_close = dlsym(RTLD_NEXT, "myclose");
+ libc_ioctl = dlsym(RTLD_NEXT, "myioctl");
fail_if(libc_close == NULL || libc_ioctl == NULL,
"intel_aubdump: failed to get libc ioctl or close\n");

View File

@ -1,7 +1,7 @@
# Template file for 'intel-gpu-tools'
pkgname=intel-gpu-tools
version=1.12
revision=2
revision=3
build_style=gnu-configure
configure_args="--disable-tests"
hostmakedepends="pkg-config swig"
@ -11,7 +11,7 @@ short_desc="Tools for development and testing of the Intel DRM driver"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="MIT"
homepage="http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/"
distfiles="http://xorg.freedesktop.org/releases/individual/app/${pkgname}-${version}.tar.bz2"
distfiles="${XORG_SITE}/app/${pkgname}-${version}.tar.bz2"
checksum=143fe0ae4a52560b9c032aa7592fe8d36b1578abb873fa9b026a75acf7e38be3
lib32disabled=yes