libdrm: fix build with uclibc
PATCH 1/1 libdrm: fix build with uclibc
Fix 'O_CLOEXEC' undeclared error with uclibc
Signed-off-by Maxin B. John <[email protected]>
--- .../drm/libdrm/fix_O_CLOEXEC_undeclared.patch | 26 ++++++++++++++++++++++ meta/recipes-graphics/drm/libdrm_2.4.66.bb | 1 + 2 files changed, 27 insertions(+) create mode 100644 meta/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch
meta/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch new file +26 -0
@@ -0,0 +1,26 @@ +drmdevice.c: define _GNU_SOURCE + +Define _GNU_SOURCE to fix this build error with uclibc: + +libdrm-2.4.66/tests/drmdevice.c: In function 'main': +libdrm-2.4.66/tests/drmdevice.c:96:60: error: +'O_CLOEXEC' undeclared (first use in this function) +fd = open(devices[i]->nodes[j],O_RDONLY | O_CLOEXEC, 0); + +Upstream-Status: Pending + +Signed-off-by: Maxin B. John <[email protected]> +--- +diff -Naur libdrm-2.4.66-orig/tests/drmdevice.c libdrm-2.4.66/tests/drmdevice.c +--- libdrm-2.4.66-orig/tests/drmdevice.c 2016-02-22 18:20:35.623091574 +0200 ++++ libdrm-2.4.66/tests/drmdevice.c 2016-02-22 18:21:37.281320740 +0200 +@@ -21,6 +21,9 @@ + * + */ + ++#ifndef _GNU_SOURCE ++#define _GNU_SOURCE ++#endif + #include <stdio.h> + #include <stdlib.h> + #include <sys/stat.h>
meta/recipes-graphics/drm/libdrm_2.4.66.bb +1 -0
@@ -14,6 +14,7 @@ SRC_URI = "http://dri.freedesktop.org/libdrm/${BP}.tar.bz2 \ file://installtests.patch \ file://0001-tests-kms-steal-crtc-Include-sys-select.h.patch \ file://detect.patch \ + file://fix_O_CLOEXEC_undeclared.patch \ " SRC_URI[md5sum] = "c6809c48538d6e5999588832045ff014"
Signature · 1 line
2.4.0
Quoted 4 lines · Maxin B. John
++#ifndef
_GNU_SOURCE
++#define_GNU_SOURCE
++#endif
#including config.h is probably a better fix, as that already defines GNU_SOURCE.
Ross
Hi Ross,
Quoted 8 lines · Ross
Quoted 6 lines · Maxin B. John
++#ifndef
_GNU_SOURCE
++#define_GNU_SOURCE
++#endif#including
config.his probably a better fix, as that already definesGNU_SOURCE.
Yes, that looks better. Will send a v2.
Quoted 1 line
Ross