<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 --- - Run-time link error in swrast_dri.so"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=70766">70766</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Run-time link error in swrast_dri.so
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

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

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

        <tr>
          <th>Reporter</th>
          <td>ahartmetz@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>Other
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I actually have a card supported by the radeonsi driver, but, probably due to
the error reported here, hardware-supported 3D is not available under X. I
think the error here would also apply to radeonsi if Mesa attempted to load it.

When I run glxinfo, I get:

name of display: :0
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /opt/xorg/lib/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /opt/xorg/lib/dri/swrast_dri.so
libGL error: dlopen /opt/xorg/lib/dri/swrast_dri.so failed
(/opt/xorg/lib/dri/swrast_dri.so: undefined symbol: _ZTIN4llvm11raw_ostreamE)
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  0
  Major opcode of failed request:  153 (GLX)
  Minor opcode of failed request:  26 (X_GLXMakeContextCurrent)
  Serial number of failed request:  33
  Current serial number in output stream:  33


The demangled name of "_ZTIN4llvm11raw_ostreamE" is "typeinfo for
llvm::raw_ostream". LLVM is compiled without RTTI. Mesa has a class that
inherits llvm::raw_ostream and is compiled without -fno-rtti. That might be the
code that triggers the problem:

src/gallium/auxiliary/gallivm/lp_bld_debug.cpp:
class raw_debug_ostream :
   public llvm::raw_ostream
{


I experimentally patched Mesa like so:

mesa$ git diff
diff --git a/src/gallium/auxiliary/Makefile.am
b/src/gallium/auxiliary/Makefile.am
index 2d2d8d4..d961243 100644
--- a/src/gallium/auxiliary/Makefile.am
+++ b/src/gallium/auxiliary/Makefile.am
@@ -10,7 +10,7 @@ AM_CFLAGS = \
        $(GALLIUM_CFLAGS) \
        $(VISIBILITY_CFLAGS)

-AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
+AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS) -fno-rtti 

 libgallium_la_SOURCES = \
        $(C_SOURCES) \
@@ -23,7 +23,7 @@ AM_CFLAGS += \

 AM_CXXFLAGS += \
        $(GALLIUM_CFLAGS) \
-       $(LLVM_CXXFLAGS)
+       $(LLVM_CXXFLAGS) -fno-rtti 

 libgallium_la_SOURCES += \
        $(GALLIVM_SOURCES) \

and recompiled.
That seemed to fix the problem for me:

$ glxinfo
name of display: :0
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /opt/xorg/lib/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /opt/xorg/lib/dri/swrast_dri.so
libGL: Can't open configuration file /home/horst/.drirc: No such file or
directory.
libGL: Can't open configuration file /home/horst/.drirc: No such file or
directory.
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 
    GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 
    GLX_SGIX_pbuffer, GLX_SGI_make_current_read
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
(...)


My configure invocation, extracted from config.status, is:

'./configure'  '--prefix=/opt/xorg' '--with-egl-platforms=x11,drm'
'--enable-gbm' '--enable-shared-glapi' '--enable-glx-tls' '--enable-gles1'
'--enable-gles2' '-disable-xvmc'
'--with-gallium-drivers=r300,r600,svga,swrast,radeonsi'
'PKG_CONFIG_PATH=/opt/xorg/share/pkgconfig:/opt/xorg/lib/pkgconfig:/opt/kde4/lib/x86_64-linux-gnu/pkgconfig:/opt/kde4/lib/pkgconfig'


Both LLVM and Mesa versions are very current, maybe two hours old at the time
of this writing.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>