x86_64-gentoo-freebsd8.2-gcc -c -I../../../../include -I../../../../src/egl/main -I../../../../src/mapi -I../../../../src/gbm/main -I../../../../src/gbm/backends/dri -DDEFAULT_DRIVER_DIR=\"/usr/lib64/dri\" -I/usr/include/libdrm -DHAVE_X11_PLATFORM -D_THREAD_SAFE -w -O2 -march=nocona -mtune=nocona -pipe -fno-ivopts -ffast-math -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -fPIC -DUSE_X86_64_ASM -DTEXTURE_FLOAT_ENABLED -DHAVE_POSIX_MEMALIGN -DUSE_XCB -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DHAVE_ALIAS -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DHAVE_XCB_DRI2 -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN -fvisibility=hidden -D_EGL_MAIN=_eglBuiltInDriverDRI2 -DHAVE_SHARED_GLAPI platform_x11.c -o platform_x11.o platform_x11.c: In function 'dri2_initialize_x11_dri2': platform_x11.c:1000: error: 'O_CLOEXEC' undeclared (first use in this function) platform_x11.c:1000: error: (Each undeclared identifier is reported only once platform_x11.c:1000: error: for each function it appears in.) gmake[4]: *** [platform_x11.o] Error 1 gmake[4]: *** Waiting for unfinished jobs.... gmake[4]: Leaving directory `/var/tmp/portage/media-libs/mesa-7.11/work/Mesa-7.11/src/egl/drivers/dri2' gmake[3]: *** [subdirs] Error 1 gmake[3]: Leaving directory `/var/tmp/portage/media-libs/mesa-7.11/work/Mesa-7.11/src/egl/drivers' gmake[2]: *** [subdirs] Error 1 gmake[2]: Leaving directory `/var/tmp/portage/media-libs/mesa-7.11/work/Mesa-7.11/src/egl' gmake[1]: *** [subdirs] Error 1 gmake[1]: Leaving directory `/var/tmp/portage/media-libs/mesa-7.11/work/Mesa-7.11/src' gmake: *** [default] Error 1 emake failed
emerge --info Portage 2.2.0_alpha74 (default/bsd/fbsd/amd64/8.2, gcc-4.2.4, freebsd-lib-8.2-r1, 8.2-RELEASE amd64) ================================================================= System uname: FreeBSD-8.2-RELEASE-amd64-64bit-ELF Timestamp of tree: Sun, 13 Nov 2011 10:30:01 +0000 app-shells/bash: 4.2_p10 dev-lang/python: 2.7.2-r3, 3.2.2 dev-util/pkgconfig: 0.26 sys-apps/baselayout: 2.1 sys-apps/openrc: 0.9.4 sys-devel/autoconf: 2.68 sys-devel/automake: 1.9.6-r3, 1.11.1-r1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.2.4-r1 sys-devel/gcc-config: 1.5-r2 sys-devel/libtool: 2.4-r4 sys-devel/make: 3.82-r3 sys-freebsd/freebsd-lib: 8.2-r1 (virtual/os-headers) Repositories: gentoo x-portage Installed sets: ACCEPT_KEYWORDS="amd64 amd64-fbsd x86-fbsd ~amd64-fbsd ~x86-fbsd" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-gentoo-freebsd8.2" CFLAGS="-w -O2 -march=nocona -mtune=nocona -pipe" CHOST="x86_64-gentoo-freebsd8.2" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-w -O2 -march=nocona -mtune=nocona -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs chflags distlocks ebuild-locks fixlafiles news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="http://ftp.fsn.hu/pub/linux/distributions/gentoo/" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--allow-multiple-definition" LINGUAS="hu" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" 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/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X amd64-fbsd apng bzip2 cli cracklib crypt cxx dbus dri gif gmp iconv ipv6 java5 java6 jpeg kde lzma mmx modules multilib ncurses nptlonly optimization oss pam pcre png qt3support session sse sse2 sse3 sse4 sse4_1 ssl ssse3 strong-optimization symlink tcpd tftp threads tiff unicode usb wimax wps xorg zfs zlib" 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 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="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="FreeBSD" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="FreeBSD" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="hu" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="BSD" VIDEO_CARDS="nv" 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: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Either mesa is missing an include for FreeBSD, or O_CLOEXEC is not present on that version of FreeBSD.
(In reply to comment #2) > Either mesa is missing an include for FreeBSD, or O_CLOEXEC is not present on > that version of FreeBSD. O_CLOEXEC is not available (at least) on <=FreeBSD-8.x.
Reported to upstream. Refer the URL field.
Created attachment 304637 [details, diff] mesa-8.0.1-freebsd-cloexec.patch (In reply to comment #4) > Reported to upstream. Refer the URL field. Upstream denied to solve the problem.. :( O_CLOEXEC will come with FreeBSD-8.3/-9.0.. but until it will come, I'd like to have #ifdef O_CLOEXEC ... #else ... #endif patch for workaround (actual patch, attached) Any comment from x11 team?
Please submit this patch upstream to dri-devel mailing list for review. The report was closed without patch as no upstream developer wanted to work on fixing bugs for BSD.
glibc-2.5 doesn't have O_CLOEXEC. However, sys-kernel/linux-headers does provide it. I modified the ebuild to work for me by adding this line to src_prepare(): sed -i -e 's:<fcntl.h>:"asm-generic/fcntl.h":' src/egl/drivers/dri2/platform_x11.c || die
I just masked USE=egl for <FreeBSD-9.0 FreeBSD-9.0 or later has O_CLOEXEC.