diff mbox

Fix building on musl-libc

Message ID CAOji9TBN=OaFNnhZxLuoQ8Ubq4vgaa45EkMoewBwp_npz5firg@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kylie McClain Jan. 20, 2016, 3:34 a.m. UTC
libdrm git master fails to compile due to undefined functions/constants
on musl libc. The attached patches fix it. (I've attached them rather than
included them in the message since gmail is really bad about ruining patch
formatting.)

I originally posted these to https://bugs.freedesktop.org/show_bug.cgi?id=93764
in a different form, and have modified them to Emil's comments on the
bugzilla entry.

commit 6ec5d220184e46135109923d252ae619068b7eb2
Author: Kylie McClain <somasis@exherbo.org>
Date:   Tue Jan 19 22:27:28 2016 -0500

    tests: Include poll.h rather than sys/poll.h

    sys/poll.h is a non-standard location of the poll.h header, and is
    incorrect on non-glibc libcs. poll.h, however, is defined in SUS (v2)
    and is more portable.

    http://pubs.opengroup.org/onlinepubs/007908799/xsh/poll.h.html

commit 6e7f12f1977bd13d10d99bc7826c54b692284c38
Author: Kylie McClain <somasis@exherbo.org>
Date:   Tue Jan 19 22:24:15 2016 -0500

    kms-steal-crtc: Make use of sys/select.h if available

    On systems using musl libc, FD_ZERO, FD_SET, select, etc. are defined
    in sys/select.h. This behavior is defined in IEEE Std 1003.1, 2000,
    http://pubs.opengroup.org/onlinepubs/009696899/basedefs/sys/select.h.html
    and fixes building kms-steal-crtc on musl libc systems.

Comments

Emil Velikov Jan. 26, 2016, 9:32 p.m. UTC | #1
On 20 January 2016 at 03:34, Kylie McClain <somasissounds@gmail.com> wrote:
> libdrm git master fails to compile due to undefined functions/constants
> on musl libc. The attached patches fix it. (I've attached them rather than
> included them in the message since gmail is really bad about ruining patch
> formatting.)
>
> I originally posted these to https://bugs.freedesktop.org/show_bug.cgi?id=93764
> in a different form, and have modified them to Emil's comments on the
> bugzilla entry.
>
> commit 6ec5d220184e46135109923d252ae619068b7eb2
> Author: Kylie McClain <somasis@exherbo.org>
> Date:   Tue Jan 19 22:27:28 2016 -0500
>
>     tests: Include poll.h rather than sys/poll.h
>
>     sys/poll.h is a non-standard location of the poll.h header, and is
>     incorrect on non-glibc libcs. poll.h, however, is defined in SUS (v2)
>     and is more portable.
>
>     http://pubs.opengroup.org/onlinepubs/007908799/xsh/poll.h.html
>
> commit 6e7f12f1977bd13d10d99bc7826c54b692284c38
> Author: Kylie McClain <somasis@exherbo.org>
> Date:   Tue Jan 19 22:24:15 2016 -0500
>
>     kms-steal-crtc: Make use of sys/select.h if available
>
>     On systems using musl libc, FD_ZERO, FD_SET, select, etc. are defined
>     in sys/select.h. This behavior is defined in IEEE Std 1003.1, 2000,
>     http://pubs.opengroup.org/onlinepubs/009696899/basedefs/sys/select.h.html
>     and fixes building kms-steal-crtc on musl libc systems.

Thanks for the patches Kyle. I've scooped the poll.h one and picked a
slightly more extensive fix for the other issue by Raj.

-Emil
diff mbox

Patch

From 6ec5d220184e46135109923d252ae619068b7eb2 Mon Sep 17 00:00:00 2001
From: Kylie McClain <somasis@exherbo.org>
Date: Tue, 19 Jan 2016 22:27:28 -0500
Subject: [PATCH 2/2] tests: Include poll.h rather than sys/poll.h

sys/poll.h is a non-standard location of the poll.h header, and is
incorrect on non-glibc libcs. poll.h, however, is defined in SUS (v2)
and is more portable.

http://pubs.opengroup.org/onlinepubs/007908799/xsh/poll.h.html
---
 tests/modetest/modetest.c | 2 +-
 tests/vbltest/vbltest.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 22e3e81..375b64a 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -53,7 +53,7 @@ 
 #include <string.h>
 #include <strings.h>
 #include <errno.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/time.h>
 
 #include "xf86drm.h"
diff --git a/tests/vbltest/vbltest.c b/tests/vbltest/vbltest.c
index 1833321..a4c8247 100644
--- a/tests/vbltest/vbltest.c
+++ b/tests/vbltest/vbltest.c
@@ -35,7 +35,7 @@ 
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/time.h>
 
 #include "xf86drm.h"
-- 
2.7.0