Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 689768 - x11-base/xorg-server-1.20.5 - In file included from dumb_bo.c:40: /usr/include/xf86drm.h:40:10: fatal error: drm.h: No such file or directory
Summary: x11-base/xorg-server-1.20.5 - In file included from dumb_bo.c:40: /usr/includ...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-13 10:14 UTC by Rolf Eike Beer
Modified: 2019-09-23 17:53 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (x11-base_xorg-server-1.20.5_use_oxYDK.xz,29.92 KB, application/x-xz)
2019-07-13 10:14 UTC, Rolf Eike Beer
Details
0001-configure-Set-libdrm-flags-correctly-for-modesetting.patch (0001-configure-Set-libdrm-flags-correctly-for-modesetting.patch,884 bytes, text/plain)
2019-09-23 15:43 UTC, Alexander Tsoy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Eike Beer 2019-07-13 10:14:43 UTC
Created attachment 582746 [details]
build.log

In file included from dumb_bo.c:40:
/usr/include/xf86drm.h:40:10: fatal error: drm.h: No such file or directory
 #include <drm.h>
          ^~~~~~~
compilation terminated.
make[5]: *** [Makefile:755: dumb_bo.lo] Error 1
make[5]: *** Waiting for unfinished jobs....
drmmode_display.c:42:10: fatal error: drm_fourcc.h: No such file or directory
 #include <drm_fourcc.h>
          ^~~~~~~~~~~~~~
compilation terminated.
In file included from dri2.c:42:
driver.h:31:10: fatal error: drm.h: No such file or directory
 #include <drm.h>
          ^~~~~~~
compilation terminated.
make[5]: *** [Makefile:755: drmmode_display.lo] Error 1
make[5]: *** [Makefile:755: dri2.lo] Error 1
In file included from driver.c:63:
driver.h:31:10: fatal error: drm.h: No such file or directory
 #include <drm.h>
          ^~~~~~~
compilation terminated.


Portage 2.3.62 (python 3.6.5-final-0, default/linux/hppa/17.0, gcc-8.3.0, glibc-2.28-r6, 5.0.10 parisc64)
=================================================================
System uname: Linux-5.0.10-parisc64-PA8800_-Mako-with-gentoo-2.6
KiB Mem:     8231368 total,    268420 free
KiB Swap:    4194300 total,   4187132 free
Timestamp of repository gentoo: Sat, 13 Jul 2019 00:15:01 +0000
Head commit of repository gentoo: b071a044059b008fea94b5af02326ef2b0d28992
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.31.1 p7) 2.31.1
app-shells/bash:          4.4_p23-r1::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.5.4-r1::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.14.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.38.3-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r6::gentoo
sys-devel/gcc:            8.3.0-r1::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.14-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: no
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 

ACCEPT_KEYWORDS="hppa"
ACCEPT_LICENSE="@FREE"
CBUILD="hppa2.0-unknown-linux-gnu"
CFLAGS="-O2 -pipe -march=2.0"
CHOST="hppa2.0-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/qmail/alias /var/qmail/control /var/spool/torque"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=2.0"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS=""
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS=""
GENTOO_MIRRORS="ftp://castor.sf-tec.de/ ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl berkdb big-endian bzip2 cli crypt cups cxx firefox foomaticdb fortran gdbm gpm hppa iconv imlib ipv6 libwww ncurses nls nptl openmp pam pcre readline spell ssl tcpd unicode xattr zlib" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="fbdev dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Matt Turner gentoo-dev 2019-07-30 01:49:16 UTC
drm.h and drm_fourcc.h are provided by sys-kernel/linux-headers. Does your linux-headers installation not have these files?
Comment 2 Rolf Eike Beer 2019-08-24 18:06:07 UTC
The files are there:

/usr/include/libdrm/drm.h
/usr/include/libdrm/drm_fourcc.h
/usr/include/drm/drm.h
/usr/include/drm/drm_fourcc.h

But the compile command did not include any of the subdirectories in the include paths.
Comment 3 Alexander Tsoy 2019-09-23 13:05:19 UTC
I can reproduce this with USE="minimal -udev". Compile command doesn't include "-I/usr/include/libdrm" in this case. From configure.ac:

if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then
    if test "x$DRM" = xyes; then
        AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support])
        PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
    fi
fi


$ pkg-config --cflags libdrm
-I/usr/include/libdrm
Comment 4 Alexander Tsoy 2019-09-23 13:36:26 UTC
(In reply to Alexander Tsoy from comment #3)
...
> if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes ||
> test "x$CONFIG_UDEV_KMS" = xyes; then
>     if test "x$DRM" = xyes; then
>         AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support])
>         PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
>     fi
> fi

and later:

    if test "x$DRM" = xyes; then
        XORG_DRIVER_MODESETTING=yes
    fi

So we are building modesetting driver (which needs drm headers) even with USE=minimal, because ebuild pass --enable-libdrm to configure unconditionally.
Comment 5 Alexander Tsoy 2019-09-23 14:09:54 UTC
And USE="minimal -udev -xorg" builds fine, because modesetting driver is not built in this case.
Comment 6 Piotr Karbowski gentoo-dev 2019-09-23 14:13:56 UTC
This is more like a oxrg-server build system issue. You cannot really build xorg-server without libdrm, as it includes xf86drm.h in lnx_platform.c and the header is part of x11-libs/libdrm.

Looks to me like the autotools should use pkg-config to find libdrm even if there's no UDEV enabled.
Comment 7 Alexander Tsoy 2019-09-23 14:24:36 UTC
(In reply to Piotr Karbowski from comment #6)
> You cannot really build xorg-server without libdrm, as it includes xf86drm.h
> in lnx_platform.c and the header is part of x11-libs/libdrm.
The code in lnx_platform.c depends on udev support (XSERVER_PLATFORM_BUS macro).
Comment 8 Alexander Tsoy 2019-09-23 14:31:12 UTC
So I think the real problem here is modesetting driver which cannot be disabled separetely from libdrm and xorg.
Comment 9 Alexander Tsoy 2019-09-23 15:43:42 UTC
Created attachment 590686 [details]
0001-configure-Set-libdrm-flags-correctly-for-modesetting.patch

Attached patch fixed this issue for me.
Comment 10 Piotr Karbowski gentoo-dev 2019-09-23 17:53:37 UTC
Would you kindly send that upstream? Ideally they will pull it in and we will get it with new release.