The ebuild x11-base/x11-drm-99999999 build doesn't complete because of "dristat" and an undeclared symbol CLOCK_MONOTONIC. Reproducible: Always Steps to Reproduce: 1. add x11 overlay 2. emerge =x11-drm-99999999 Actual Results: It fails when compiling "dristat". make -j2 LINUXDIR=/usr/src/linux dristat Makefile:245: warning: overriding commands for target `install' Makefile:225: warning: ignoring old commands for target `install' cc -march=athlon-xp -O2 -pipe -g -ansi -pedantic -DPOSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -I. -I../../.. -I../libdrm dristat.c -o dristat In file included from ../libdrm/xf86drm.h:40, from dristat.c:33: ./drm.h:241: warning: comma at end of enumerator list ./drm.h:495: warning: comma at end of enumerator list ./drm.h:501: warning: ISO C90 does not support 'long long' ./drm.h:907: warning: comma at end of enumerator list In file included from ../libdrm/xf86drm.h:40, from dristat.c:33: ./drm.h:1170: warning: ISO C forbids forward references to 'enum' types In file included from dristat.c:36: ../libdrm/xf86drm.c: In function 'drmUpdateDrawableInfo': ../libdrm/xf86drm.c:1499: warning: ISO C90 does not support 'long long' ../libdrm/xf86drm.c: In function 'drmWaitVBlank': ../libdrm/xf86drm.c:1903: error: 'CLOCK_MONOTONIC' undeclared (first use in this function) ../libdrm/xf86drm.c:1903: error: (Each undeclared identifier is reported only once ../libdrm/xf86drm.c:1903: error: for each function it appears in.) make: *** [dristat] Error 1 * * ERROR: x11-base/x11-drm-99999999 failed. * Call stack: * ebuild.sh, line 49: Called src_compile * environment, line 3886: Called src_compile_os * environment, line 3932: Called src_compile_linux * environment, line 3926: Called die * The specific snippet of code: * emake LINUXDIR="${KERNEL_DIR}" dristat || die "Building dristat failed."; * The die message: * Building dristat failed. Expected Results: x11-drm built successfully. I've tried undoing the three last commits to the git repository which added the symbol CLOCK_MONOTONIC. Of course, with these changes gone, all is built fine again. The commits: http://cgit.freedesktop.org/mesa/drm/commit/?id=f4f76a6894b40abd77f0ffbf52972127608b9bca http://cgit.freedesktop.org/mesa/drm/commit/?id=ca37077fb78b69a00500827f1db12b70affa1514 http://cgit.freedesktop.org/mesa/drm/commit/?id=badc63464cbd64606c6dff9ea561a787d072fd5f emerge --info: Portage 2.2_rc20 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.28-gentoo i686) ================================================================= System uname: Linux-2.6.28-gentoo-i686-AMD_Athlon-tm-_XP_2400+-with-glibc2.0 Timestamp of tree: Mon, 12 Jan 2009 09:15:01 +0000 app-shells/bash: 3.2_p39 dev-lang/python: 2.5.2-r7 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-xp -O2 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/X11/xkb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-march=athlon-xp -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="candy distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://ftp.rediris.es/mirror/gentoo/ http://trumpetti.atm.tut.fi/gentoo/" LANG="POSIX" LC_ALL="POSIX" LDFLAGS="-Wl,-O1" LINGUAS="es es_ES" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/layman/x11 /usr/local/portage" SYNC="rsync://oktan.ls.fi.upm.es/gentoo-portage" USE="3dnow X Xaw3d a52 aac acpi alsa bash-completion berkdb bluetooth branding bzip2 cairo cddb cdr cli cracklib cscope dbus dga dri dvd dvdr dvdread emboss evo firefox flac ftp gif gnome gnome-keyring gstreamer gtk hal iconv isdnlog jpeg libnotify lzo mad matroska midi mikmod mmap mmx mng modplug mp3 mpeg msn mudflap musepack ncurses nls nptl nptlonly nsplugin offensive ogg opengl pam pcre pdf perl pic png ppds pppd python qt3support quicktime readline reflection samba sdl session slang spl sse ssl startup-notification suid svg symlink sysfs tcpd theora threads tiff truetype unicode usb vorbis win32codecs wmf x264 x86 xml xorg xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 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" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="es es_ES" USERLAND="GNU" VIDEO_CARDS="radeon" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
here is my correspondence with commiter: > Hi > > f4f76a6894b40abd77f0ffbf52972127608b9bca commit to mesa/drm breaks > compilation on gentoo system. > > see attached build log. > > i have linux-headers-2.6.28 (aka kernel headers) > and glibc-2.9_p20081201 (with gentoo patches). > > maybe something wrong with gentoo patches. I can send time.h and > sys/time.h files to you for check. Looks like it builds initially: ... libtool: compile: i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I. -I../shared-core -march=native -O2 -pipe -fomit-frame-pointer -MT xf86drmSL.lo -MD -MP -MF .deps/xf86drmSL.Tpo -c xf86drmSL.c -o xf86drmSL.o if /bin/sh ../libtool --mode=compile i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I. -I../shared-core -march=native -O2 -pipe -fomit-frame-pointer -MT xf86drmMode.lo -MD -MP -MF ".deps/xf86drmMode.Tpo" \ -c -o xf86drmMode.lo `test -f 'xf86drmMode.c' || echo './'`xf86drmMode.c; \ then mv -f ".deps/xf86drmMode.Tpo" ".deps/xf86drmMode.Plo"; \ else rm -f ".deps/xf86drmMode.Tpo"; exit 1; \ fi libtool: compile: i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I. -I../shared-core -march=native -O2 -pipe -fomit-frame-pointer -MT xf86drmMode.lo -MD -MP -MF .deps/xf86drmMode.Tpo -c xf86drmMode.c -o xf86drmMode.o /bin/sh ../libtool --mode=link i686-pc-linux-gnu-gcc -I../shared-core -march=native -O2 -pipe -fomit-frame-pointer -o libdrm.la -rpath /usr/lib -version-number 2:4:0 -no-undefined xf86drm.lo xf86drmHash.lo xf86drmRandom.lo xf86drmSL.lo xf86drmMode.lo -lrt libtool: link: i686-pc-linux-gnu-ar cru .libs/libdrm.a xf86drm.o xf86drmHash.o xf86drmRandom.o xf86drmSL.o xf86drmMode.o libtool: link: i686-pc-linux-gnu-ranlib .libs/libdrm.a libtool: link: ( cd ".libs" && rm -f "libdrm.la" && ln -s "../libdrm.la" "libdrm.la" ) make[3]: Leaving directory `/var/tmp/portage/x11-base/x11-drm-99999999/work/drm/libdrm' ... Then the linux-core build fails (which I'd expect, you really shouldn't build that anymore on Linux) and then you see the CLOCK_GETTIME problem. And you script seems to fail too: ... /var/tmp/portage/x11-base/x11-drm-99999999/work/drm/linux-core... /var/tmp/portage/x11-base/x11-drm-99999999/temp/environment: line 3954: MODULESD_DRM.KO_ENABLED=yes: command not found /var/tmp/portage/x11-base/x11-drm-99999999/temp/environment: line 3954: MODULESD_RADEON.KO_ENABLED=yes: command not found ln: creating symbolic link `Module.symvers': File exists ... which might cause trouble. Oh and then it's the dristat program that fails to build... is that file missing a time.h include or maybe defining some incompatible gcc feature flags? -- Jesse Barnes, Intel Open Source Technology Center
maintainers: there is no metadata.xml for x11-drm in the x11 overlay. please add it - thanks.
After some work, I think I've found the problem. It's some kind of typo in linux-core/Makefile: "-DPOSIX_C_SOURCE=199309L" should be "-_DPOSIX_C_SOURCE=199309L" (note the underscore). Also, the LDFLAG "-lrt" is necessary for "clock_gettime". I don't know if this is somewhat related exclusively to Gentoo or upstream didn't test dristat compilation. Should upstream be notified?
Created attachment 178435 [details, diff] Updated patch with fixed define (-D_POSIX_C_SOURCE=199309L) and added flag (-lrt)
(In reply to comment #3) > After some work, I think I've found the problem. It's some kind of typo in > linux-core/Makefile: "-DPOSIX_C_SOURCE=199309L" should be > "-_DPOSIX_C_SOURCE=199309L" (note the underscore). Also, the LDFLAG "-lrt" is > necessary for "clock_gettime". I don't know if this is somewhat related > exclusively to Gentoo or upstream didn't test dristat compilation. Should > upstream be notified? > Well, reviewing my previous comment I've seen a mistake: the new define should be "-D_POSIX_C_SOURCE=199309L". This mistake doesn't affect the proposed patch.
a bit more my correspondence On Friday, January 16, 2009 10:54 am Rion wrote: > > Jesse Barnes пишет: >> > > On Tuesday, January 13, 2009 11:21 pm Rion wrote: >>> > >> Hi, Jesse! >>> > >> >>> > >> can you look at last comments here >>> > >> >>> > >> http://bugs.gentoo.org/show_bug.cgi?id=254649 ? >> > > >> > > Did you figure this out yet? It looked like that bug ended up with a >> > > resolution at the end... > > > > resolution is additional patch which fixes some things in original > > Makefile. > > > > one of them is: > > > > -PRGCFLAGS = $(CFLAGS) -g -ansi -pedantic -DPOSIX_C_SOURCE=199309L \ > > +PRGCFLAGS = $(CFLAGS) -g -ansi -pedantic -D_POSIX_C_SOURCE=199309L \ > > > > probably should be fixed in upstream, isn't it? > > > > i don't sure about other things. Yeah, please post the patch to dri-devel for review & commit. Thanks, -- Jesse Barnes, Intel Open Source Technology Center -------------------------------------------- so can somebody more appreciative post there?
(In reply to comment #6) > a bit more my correspondence > > [...] > Yeah, please post the patch to dri-devel for review & commit. > > Thanks, > -- Jesse Barnes, Intel Open Source Technology Center > > > > > > -------------------------------------------- > so can somebody more appreciative post there? > I've posted the patch to dri-devel but it seems that this bug is related to Gentoo packaging of x11-drm. Here is the message [ http://sourceforge.net/mailarchive/message.php?msg_name=20090118232203.07bfb9a6%40daedalus.pq.iki.fi ] from dri-devel: > in my Gentoo box, "dristat", from "mesa/drm", fails to build because of > an incorrect define in linux-core/Makefile: "-DPOSIX_C_SOURCE=199309L" > should be "-D_POSIX_C_SOURCE=199309L". Also, "-lrt" is needed in the > linking stage. > > This problem was filed as a bug [1] to Gentoo's bugzilla but I think > that it should be fixed at this level. > [1] http://bugs.gentoo.org/show_bug.cgi?id=254649 Please, fix your build system to use the right Makefile, which is tests/Makefile. {dri,drm}stat are built with libdrm. This is purely a Gentoo packaging bug. See http://cgit.freedesktop.org/mesa/drm/commit/?id=27fae006853647ad0087067adc4eaa8d4ed4594a ------------------------------------------------------ The commit referred in the message is a total clean up of linux-core/Makefile, may be making unnecessary the current patch for x11-drm in Portage (x11-drm-99999999-gentoo-0.2.tar.bz2).
I don't yet have access to the overlay. Once I get it, I can fix the ebuild there for the changes they've made.
I had to comment 3 lines in order to make it build: EPATCH_SUFFIX="patch" epatch ${PATCHDIR} emake LINUXDIR="${KERNEL_DIR}" dristat || die "Building dristat failed." emake LINUXDIR="${KERNEL_DIR}" drmstat || die "Building drmstat failed." Now it builds and installs fine.
the patch fails to apply: ***** 002_all_misc-makefile-fixes.patch ***** ============================================= PATCH COMMAND: patch -p0 -g0 -E --no-backup-if-mismatch < /var/tmp/paludis/x11-base-x11-drm-99999999/work/patch/002_all_misc-makefile-fixes.patch ============================================= can't find file to patch at input line 4 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff -urN drm.orig/linux-core/Makefile drm/linux-core/Makefile |--- drm.orig/linux-core/Makefile 2005-05-02 23:36:46.000000000 -0400 |+++ drm/linux-core/Makefile 2005-05-02 23:42:00.000000000 -0400 -------------------------- No file to patch. Skipping patch. 2 out of 2 hunks ignored ============================================= PATCH COMMAND: patch -p1 -g0 -E --no-backup-if-mismatch < /var/tmp/paludis/x11-base-x11-drm-99999999/work/patch/002_all_misc-makefile-fixes.patch ============================================= patching file linux-core/Makefile Hunk #1 FAILED at 245. Hunk #2 FAILED at 263. 2 out of 2 hunks FAILED -- saving rejects to file linux-core/Makefile.rej ============================================= PATCH COMMAND: patch -p2 -g0 -E --no-backup-if-mismatch < /var/tmp/paludis/x11-base-x11-drm-99999999/work/patch/002_all_misc-makefile-fixes.patch ============================================= can't find file to patch at input line 4 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff -urN drm.orig/linux-core/Makefile drm/linux-core/Makefile |--- drm.orig/linux-core/Makefile 2005-05-02 23:36:46.000000000 -0400 |+++ drm/linux-core/Makefile 2005-05-02 23:42:00.000000000 -0400 -------------------------- No file to patch. Skipping patch. 2 out of 2 hunks ignored ============================================= PATCH COMMAND: patch -p3 -g0 -E --no-backup-if-mismatch < /var/tmp/paludis/x11-base-x11-drm-99999999/work/patch/002_all_misc-makefile-fixes.patch ============================================= missing header for unified diff at line 4 of patch can't find file to patch at input line 4 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff -urN drm.orig/linux-core/Makefile drm/linux-core/Makefile |--- drm.orig/linux-core/Makefile 2005-05-02 23:36:46.000000000 -0400 |+++ drm/linux-core/Makefile 2005-05-02 23:42:00.000000000 -0400 -------------------------- No file to patch. Skipping patch. 2 out of 2 hunks ignored ============================================= PATCH COMMAND: patch -p4 -g0 -E --no-backup-if-mismatch < /var/tmp/paludis/x11-base-x11-drm-99999999/work/patch/002_all_misc-makefile-fixes.patch ============================================= missing header for unified diff at line 4 of patch can't find file to patch at input line 4 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff -urN drm.orig/linux-core/Makefile drm/linux-core/Makefile |--- drm.orig/linux-core/Makefile 2005-05-02 23:36:46.000000000 -0400 |+++ drm/linux-core/Makefile 2005-05-02 23:42:00.000000000 -0400 -------------------------- No file to patch. Skipping patch. 2 out of 2 hunks ignored and i don't really think that this patch is needed if eutoreconf is corectly run before configuring.
Please see the patch I provided late last week in bug 255647, to be applied against the x11 overlay. It now builds the x11-drm modules with no patches and has split the programs into their own package (x11-apps/drm-progs).
*** Bug 255170 has been marked as a duplicate of this bug. ***
(In reply to comment #11) > Please see the patch I provided late last week in bug 255647, to be applied > against the x11 overlay. > > It now builds the x11-drm modules with no patches and has split the programs > into their own package (x11-apps/drm-progs). > Thanks, now all the apps build fine, including the new ebuild drm-progs. The bug is fixed, at least for me.
could this patch be changed in the overlay until it's fixed upstream? Thanks Michael
*** This bug has been marked as a duplicate of bug 255647 ***
Created attachment 207303 [details, diff] need patch