Compilng DRM fails: implicit declaration of S_ISCHR() and fstat()
Submitted by Dilian
Assigned to Chris Wilson @ickle
Link to original bug (#106047)
Description
With 1.15.12 doing
./configure --enable-xml --enable-glesv2 --enable-glesv3 --enable-xlib-xcb --enable-tee --enable-drm
prints
cairo (version 1.15.12 [snapshot]) will be compiled with:
The following surface backends:
Image: yes (always builtin)
Recording: yes (always builtin)
Observer: yes (always builtin)
Mime: yes (always builtin)
Tee: yes
XML: yes
Xlib: yes
Xlib Xrender: yes
Qt: no (disabled, use --enable-qt to enable)
Quartz: no (requires CoreGraphics framework)
Quartz-image: no (disabled, use --enable-quartz-image to enable)
XCB: yes
Win32: no (requires a Win32 platform)
OS2: no (disabled, use --enable-os2 to enable)
CairoScript: yes
PostScript: yes
PDF: yes
SVG: yes
OpenGL: no (disabled, use --enable-gl to enable)
OpenGL ES 2.0: yes
OpenGL ES 3.0: yes
BeOS: no (disabled, use --enable-beos to enable)
DirectFB: no (disabled, use --enable-directfb to enable)
OpenVG: no (disabled, use --enable-vg to enable)
DRM: yes
Cogl: no (disabled, use --enable-cogl to enable)
The following font backends:
User: yes (always builtin)
FreeType: yes
Fontconfig: yes
Win32: no (requires a Win32 platform)
Quartz: no (requires CoreGraphics framework)
The following functions:
PNG functions: yes
GLX functions: no (not required by any backend)
WGL functions: no (not required by any backend)
EGL functions: yes
X11-xcb functions: yes
XCB-shm functions: yes
The following features and utilities:
cairo-trace: yes
cairo-script-interpreter: yes
And the following internal features:
pthread: yes
gtk-doc: no
gcov support: no
symbol-lookup: no (requires bfd)
test surfaces: no (disabled, use --enable-test-surfaces to enable)
ps testing: no (requires libspectre)
pdf testing: yes
svg testing: no (requires librsvg-2.0 >= 2.35.0)
--- The Xlib/XCB functions feature is still under active development and is
--- included in this release only as a preview. It does NOT fully work yet
--- and incompatible changes may yet be made to Xlib/XCB functions specific
--- API.
--- The DRM surface backend feature is still under active development and is
--- included in this release only as a preview. It does NOT fully work yet
--- and incompatible changes may yet be made to DRM surface backend specific
--- API.
--- The OpenGLESv2 surface backend feature is still under active development
--- and is included in this release only as a preview. It does NOT fully work
--- yet and incompatible changes may yet be made to OpenGLESv2 surface
--- backend specific API.
--- The OpenGLESv3 surface backend feature is still under active development
--- and is included in this release only as a preview. It does NOT fully work
--- yet and incompatible changes may yet be made to OpenGLESv3 surface
--- backend specific API.
--- The tee surface backend feature is still under active development and is
--- included in this release only as a preview. It does NOT fully work yet
--- and incompatible changes may yet be made to tee surface backend specific
--- API.
--- The xml surface backend feature is still under active development and is
--- included in this release only as a preview. It does NOT fully work yet
--- and incompatible changes may yet be made to xml surface backend specific
--- API.
and doing make
emits:
Makefile:1502: warning: overriding recipe for target 'recheck'
Makefile:1140: warning: ignoring old recipe for target 'recheck'
make all-recursive
make[1]: Entering directory '/src/gnome/cairo-1.15.12'
Makefile:1502: warning: overriding recipe for target 'recheck'
Makefile:1140: warning: ignoring old recipe for target 'recheck'
Making all in src
make[2]: Entering directory '/src/gnome/cairo-1.15.12/src'
make all-am
make[3]: Entering directory '/src/gnome/cairo-1.15.12/src'
CC cairo-drm.lo
In file included from ./cairo-reference-count-private.h:40:0,
from ./cairo-types-private.h:45,
from ./cairo-error-private.h:43,
from ./cairoint.h:74,
from drm/cairo-drm.c:33:
drm/cairo-drm.c: In function ‘_device_finish’:
drm/cairo-drm.c:86:36: warning: passing argument 1 of ‘_cairo_atomic_ptr_cmpxchg_impl’ from incompatible pointer type [-Wincompatible-pointer-types]
if (_cairo_atomic_ptr_cmpxchg (&_cairo_drm_default_device,
^
./cairo-atomic-private.h:145:34: note: in definition of macro ‘_cairo_atomic_ptr_cmpxchg’
_cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
^
./cairo-atomic-private.h:138:1: note: expected ‘void **’ but argument is of type ‘cairo_drm_device_t ** {aka struct _cairo_drm_device **}’
_cairo_atomic_ptr_cmpxchg_impl(void **x, void *oldv, void *newv)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drm/cairo-drm.c: At top level:
drm/cairo-drm.c:106:5: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
_device_flush,
^~~~~~~~~~~~~
drm/cairo-drm.c:106:5: note: (near initialization for ‘_cairo_drm_device_backend.flush’)
drm/cairo-drm.c: In function ‘cairo_drm_device_get_for_fd’:
drm/cairo-drm.c:267:9: error: implicit declaration of function ‘fstat’ [-Werror=implicit-function-declaration]
if (fstat (fd, &st) < 0 || ! S_ISCHR (st.st_mode)) {
^~~~~
drm/cairo-drm.c:267:34: error: implicit declaration of function ‘S_ISCHR’; did you mean ‘S_IFCHR’? [-Werror=implicit-function-declaration]
if (fstat (fd, &st) < 0 || ! S_ISCHR (st.st_mode)) {
^~~~~~~
S_IFCHR
drm/cairo-drm.c: At top level:
drm/cairo-drm.c:390:1: fatal error: opening dependency file .deps/cairo-drm.Tpo: Permission denied
}
^
cc1: some warnings being treated as errors
compilation terminated.
make[3]: *** [Makefile:2424: cairo-drm.lo] Error 1
make[3]: Leaving directory '/src/gnome/cairo-1.15.12/src'
make[2]: *** [Makefile:1962: all] Error 2
make[2]: Leaving directory '/src/gnome/cairo-1.15.12/src'
make[1]: *** [Makefile:910: all-recursive] Error 1
make[1]: Leaving directory '/src/gnome/cairo-1.15.12'
make: *** [Makefile:761: all] Error 2
Edited by Emmanuele Bassi