<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [dri3] Building mesa fails with dri3 enabled"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=80848">80848</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>idr@freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[dri3] Building mesa fails with dri3 enabled
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>blocker
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>juhapekka.heikkila@gmail.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>git
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Drivers/DRI/i965
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I noticed building mesa with dri3 fails on my machine at linking stage. First
failing patch seems to be this one "loader: Use drirc device_id parameter 
in complement to DRI_PRIME" 3ecd9e1a93817180fa5b280e5fe11c903cca38ba

Complaints I get seems to be about xcb, my libxcb is build with default options
and libxcb git tree head is at 125135452a554e89e49448e2c1ee6658324e1095

* Options how I configured mesa:

PKG_CONFIG_PATH=/opt/lib/pkgconfig ./autogen.sh --prefix=/opt --enable-gles2 
--enable-gles1 --enable-shared-glapi --without-gallium-drivers --enable-64-bit 
--with-dri-drivers=i965

* Output from configure:

autoreconf2.50: Entering directory `.'
autoreconf2.50: configure.ac: not using Gettext
autoreconf2.50: running: aclocal -I m4
autoreconf2.50: configure.ac: tracing
autoreconf2.50: running: libtoolize --install --copy
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `bin'.
libtoolize: copying file `bin/config.guess'
libtoolize: copying file `bin/config.sub'
libtoolize: copying file `bin/install-sh'
libtoolize: copying file `bin/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
autoreconf2.50: running: /usr/bin/autoconf
autoreconf2.50: configure.ac: not using Autoheader
autoreconf2.50: running: automake --add-missing --copy --no-force
configure.ac:23: installing `bin/ar-lib'
configure.ac:53: installing `bin/compile'
configure.ac:15: installing `bin/missing'
src/egl/drivers/dri2/Makefile.am: installing `bin/depcomp'
autoreconf2.50: Leaving directory `.'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking how to run the C preprocessor... gcc -E
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking dependency style of gcc... gcc3
checking for gmake... no
checking for make... make
checking for python2... python2
checking for a sed that does not truncate output... /bin/sed
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to
x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain
format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared
libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared
libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for bison... bison -y
checking if bison is the parser generator... yes
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking if flex is the lexer generator... yes
checking for perl... /usr/bin/perl
checking for indent... cat
checking if compiling with clang... no
checking whether gcc version is sufficient... yes
checking for __builtin_bswap32... yes
checking for __builtin_bswap64... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking whether gcc supports -Werror=missing-prototypes... yes
checking whether gcc supports -fvisibility=hidden... yes
checking whether g++ supports -fvisibility=hidden... yes
checking whether C compiler accepts -msse4.1... yes
checking if ld supports -Bsymbolic... yes
checking whether ld supports --gc-sections... yes
checking if the linker supports version-scripts... yes
checking whether to enable assembly... yes, x86_64
checking for dlopen... no
checking for dlopen in -ldl... yes
checking for dladdr... no
checking for clock_gettime... yes
checking for posix_memalign... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... no
checking for LIBDRM... yes
checking for LIBUDEV... yes
checking for GLPROTO... yes
checking for DRI2PROTO... yes
checking for DRI3PROTO... yes
checking for PRESENTPROTO... yes
checking for XF86VIDMODE... yes
checking for DRIGL... yes
checking for EXPAT... yes
checking for INTEL... yes
checking for mincore... yes
checking for XCB_DRI2... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/egl/drivers/dri2/Makefile
config.status: creating src/egl/main/Makefile
config.status: creating src/egl/main/egl.pc
config.status: creating src/egl/wayland/Makefile
config.status: creating src/egl/wayland/wayland-drm/Makefile
config.status: creating src/egl/wayland/wayland-egl/Makefile
config.status: creating src/egl/wayland/wayland-egl/wayland-egl.pc
config.status: creating src/gallium/auxiliary/Makefile
config.status: creating src/gallium/auxiliary/pipe-loader/Makefile
config.status: creating src/gallium/drivers/Makefile
config.status: creating src/gallium/drivers/freedreno/Makefile
config.status: creating src/gallium/drivers/galahad/Makefile
config.status: creating src/gallium/drivers/i915/Makefile
config.status: creating src/gallium/drivers/identity/Makefile
config.status: creating src/gallium/drivers/ilo/Makefile
config.status: creating src/gallium/drivers/llvmpipe/Makefile
config.status: creating src/gallium/drivers/noop/Makefile
config.status: creating src/gallium/drivers/nouveau/Makefile
config.status: creating src/gallium/drivers/r300/Makefile
config.status: creating src/gallium/drivers/r600/Makefile
config.status: creating src/gallium/drivers/radeon/Makefile
config.status: creating src/gallium/drivers/radeonsi/Makefile
config.status: creating src/gallium/drivers/rbug/Makefile
config.status: creating src/gallium/drivers/softpipe/Makefile
config.status: creating src/gallium/drivers/svga/Makefile
config.status: creating src/gallium/drivers/trace/Makefile
config.status: creating src/gallium/state_trackers/Makefile
config.status: creating src/gallium/state_trackers/clover/Makefile
config.status: creating src/gallium/state_trackers/dri/Makefile
config.status: creating src/gallium/state_trackers/dri/drm/Makefile
config.status: creating src/gallium/state_trackers/dri/sw/Makefile
config.status: creating src/gallium/state_trackers/egl/Makefile
config.status: creating src/gallium/state_trackers/gbm/Makefile
config.status: creating src/gallium/state_trackers/glx/xlib/Makefile
config.status: creating src/gallium/state_trackers/omx/Makefile
config.status: creating src/gallium/state_trackers/osmesa/Makefile
config.status: creating src/gallium/state_trackers/vdpau/Makefile
config.status: creating src/gallium/state_trackers/vega/Makefile
config.status: creating src/gallium/state_trackers/xa/Makefile
config.status: creating src/gallium/state_trackers/xvmc/Makefile
config.status: creating src/gallium/targets/Makefile
config.status: creating src/gallium/targets/dri-swrast/Makefile
config.status: creating src/gallium/targets/dri/Makefile
config.status: creating src/gallium/targets/egl-static/Makefile
config.status: creating src/gallium/targets/gbm/Makefile
config.status: creating src/gallium/targets/libgl-xlib/Makefile
config.status: creating src/gallium/targets/omx/Makefile
config.status: creating src/gallium/targets/opencl/Makefile
config.status: creating src/gallium/targets/osmesa/Makefile
config.status: creating src/gallium/targets/osmesa/osmesa.pc
config.status: creating src/gallium/targets/pipe-loader/Makefile
config.status: creating src/gallium/targets/vdpau/Makefile
config.status: creating src/gallium/targets/xa/Makefile
config.status: creating src/gallium/targets/xa/xatracker.pc
config.status: creating src/gallium/targets/xvmc/Makefile
config.status: creating src/gallium/tests/trivial/Makefile
config.status: creating src/gallium/tests/unit/Makefile
config.status: creating src/gallium/winsys/Makefile
config.status: creating src/gallium/winsys/freedreno/drm/Makefile
config.status: creating src/gallium/winsys/i915/drm/Makefile
config.status: creating src/gallium/winsys/intel/drm/Makefile
config.status: creating src/gallium/winsys/nouveau/drm/Makefile
config.status: creating src/gallium/winsys/radeon/drm/Makefile
config.status: creating src/gallium/winsys/svga/drm/Makefile
config.status: creating src/gallium/winsys/sw/dri/Makefile
config.status: creating src/gallium/winsys/sw/fbdev/Makefile
config.status: creating src/gallium/winsys/sw/null/Makefile
config.status: creating src/gallium/winsys/sw/wayland/Makefile
config.status: creating src/gallium/winsys/sw/wrapper/Makefile
config.status: creating src/gallium/winsys/sw/xlib/Makefile
config.status: creating src/gbm/Makefile
config.status: creating src/gbm/main/gbm.pc
config.status: creating src/glsl/Makefile
config.status: creating src/glx/Makefile
config.status: creating src/glx/apple/Makefile
config.status: creating src/glx/tests/Makefile
config.status: creating src/gtest/Makefile
config.status: creating src/loader/Makefile
config.status: creating src/mapi/Makefile
config.status: creating src/mapi/es1api/Makefile
config.status: creating src/mapi/es1api/glesv1_cm.pc
config.status: creating src/mapi/es2api/Makefile
config.status: creating src/mapi/es2api/glesv2.pc
config.status: creating src/mapi/glapi/Makefile
config.status: creating src/mapi/glapi/gen/Makefile
config.status: creating src/mapi/glapi/tests/Makefile
config.status: creating src/mapi/shared-glapi/Makefile
config.status: creating src/mapi/shared-glapi/tests/Makefile
config.status: creating src/mapi/vgapi/Makefile
config.status: creating src/mapi/vgapi/vg.pc
config.status: creating src/mesa/Makefile
config.status: creating src/mesa/gl.pc
config.status: creating src/mesa/drivers/dri/dri.pc
config.status: creating src/mesa/drivers/dri/common/Makefile
config.status: creating src/mesa/drivers/dri/common/xmlpool/Makefile
config.status: creating src/mesa/drivers/dri/i915/Makefile
config.status: creating src/mesa/drivers/dri/i965/Makefile
config.status: creating src/mesa/drivers/dri/Makefile
config.status: creating src/mesa/drivers/dri/nouveau/Makefile
config.status: creating src/mesa/drivers/dri/r200/Makefile
config.status: creating src/mesa/drivers/dri/radeon/Makefile
config.status: creating src/mesa/drivers/dri/swrast/Makefile
config.status: creating src/mesa/drivers/osmesa/Makefile
config.status: creating src/mesa/drivers/osmesa/osmesa.pc
config.status: creating src/mesa/drivers/x11/Makefile
config.status: creating src/mesa/main/tests/Makefile
config.status: creating src/mesa/main/tests/hash_table/Makefile
config.status: executing depfiles commands
config.status: executing libtool commands

        prefix:          /opt
        exec_prefix:     ${prefix}
        libdir:          ${exec_prefix}/lib
        includedir:      ${prefix}/include

        OpenGL:          yes (ES1: yes ES2: yes)
        OpenVG:          no

        OSMesa:          no

        DRI platform:    drm
        DRI drivers:     i965 
        DRI driver dir:  ${libdir}/dri
        GLX:             DRI-based

        EGL:             yes
        EGL platforms:   x11
        EGL drivers:     builtin:egl_dri2

        llvm:            no

        Gallium:         no

        Shared libs:     yes
        Static libs:     no
        Shared-glapi:    yes

        CFLAGS:          -g -O2 -Wall -std=c99
-Werror=implicit-function-declaration -Werror=missing-prototypes
-fno-strict-aliasing -fno-builtin-memcmp -m64
        CXXFLAGS:        -g -O2 -Wall -fno-strict-aliasing -fno-builtin-memcmp
-m64
        Macros:          -DUSE_EXTERNAL_DXTN_LIB=1 -D_GNU_SOURCE -DHAVE_PTHREAD
-DUSE_X86_64_ASM -DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN -DHAVE_LIBDRM
-DGLX_USE_DRM -DHAVE_LIBUDEV -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING
-DHAVE_ALIAS -DHAVE_DRI3 -DHAVE_MINCORE

        PYTHON2:         python2

        Run 'make' to build Mesa



* Errors I get at "make install":

 /bin/bash ../../libtool   --mode=install /usr/bin/install -c   libGL.la
'/opt/lib'
libtool: install: warning: relinking `libGL.la'
libtool: install: (cd /home/jheikkil/workspace/mesamesa/mesa2/mesa/src/glx;
/bin/bash /home/jheikkil/workspace/mesamesa/mesa2/mesa/libtool  --silent --tag
CC --mode=relink gcc -I../../include -I../../include/GL/internal
-I../../src/loader -I../../src/mapi -I../../src/mapi/glapi -I../../src/mapi
-I../../src/mapi/glapi -fvisibility=hidden -DGLX_SHARED_GLAPI -DXF86VIDMODE
-D_REENTRANT -DDEFAULT_DRIVER_DIR=\"/opt/lib/dri\" -DUSE_EXTERNAL_DXTN_LIB=1
-D_GNU_SOURCE -DHAVE_PTHREAD -DUSE_X86_64_ASM -DHAVE_DLOPEN
-DHAVE_POSIX_MEMALIGN -DHAVE_LIBDRM -DGLX_USE_DRM -DHAVE_LIBUDEV
-DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DHAVE_DRI3
-DHAVE_MINCORE -I/opt/include -I/opt/include/libdrm -I/opt/include -g -O2 -Wall
-std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes
-fno-strict-aliasing -fno-builtin-memcmp -m64 -no-undefined -version-number 1:2
-Wl,-Bsymbolic -Wl,--gc-sections -Wl,--no-undefined -o libGL.la -rpath /opt/lib
libglx.la ../../src/mapi/glapi/libglapi.la
../../src/mapi/shared-glapi/libglapi.la -L/opt/lib -lXext -lXdamage -lXfixes
-lX11-xcb -lX11 -lxcb-glx -lxcb-dri2 -lxcb-dri3 -lxcb-present -lxcb-randr
-lxcb-xfixes -lxcb-render -lxcb-shape -lxcb-sync -lxcb -lxshmfence -lXxf86vm
-L/opt/lib -ldrm -lm -lpthread -ldl )
./.libs/libglx.a(dri3_glx.o): In function `dri3_flush_present_events':
/home/jheikkil/workspace/mesamesa/mesa2/mesa/src/glx/dri3_glx.c:953: undefined
reference to `xcb_poll_for_special_event'
./.libs/libglx.a(dri3_glx.o): In function `dri3_find_back':
/home/jheikkil/workspace/mesamesa/mesa2/mesa/src/glx/dri3_glx.c:1191: undefined
reference to `xcb_wait_for_special_event'
./.libs/libglx.a(dri3_glx.o): In function `dri3_wait_for_event':
/home/jheikkil/workspace/mesamesa/mesa2/mesa/src/glx/dri3_glx.c:433: undefined
reference to `xcb_wait_for_special_event'
./.libs/libglx.a(dri3_glx.o): In function `dri3_destroy_drawable':
/home/jheikkil/workspace/mesamesa/mesa2/mesa/src/glx/dri3_glx.c:296: undefined
reference to `xcb_unregister_for_special_event'
./.libs/libglx.a(dri3_glx.o): In function `dri3_update_drawable':
/home/jheikkil/workspace/mesamesa/mesa2/mesa/src/glx/dri3_glx.c:1000: undefined
reference to `xcb_register_for_special_xge'
/home/jheikkil/workspace/mesamesa/mesa2/mesa/src/glx/dri3_glx.c:1032: undefined
reference to `xcb_unregister_for_special_event'
collect2: error: ld returned 1 exit status
libtool: install: error: relink `libGL.la' with the above command before
installing it</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>