Bug 75356 - pipe_loader_sw.c:64: undefined reference to `xlib_create_sw_winsys'
Summary: pipe_loader_sw.c:64: undefined reference to `xlib_create_sw_winsys'
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium blocker
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-02-22 08:07 UTC by Vinson Lee
Modified: 2014-02-24 14:59 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
pipe-loader: wrap pipe_loader_sw_probe_xlib within HAVE_PIPE_LOADER_XLIB (6.09 KB, patch)
2014-02-22 17:00 UTC, Emil Velikov
Details | Splinter Review

Description Vinson Lee 2014-02-22 08:07:59 UTC
mesa: 7770b026937948e1be3ed55f9ff97e6521c500df (master)

  CCLD     compute
../../../../src/gallium/auxiliary/pipe-loader/.libs/libpipe_loader_client.a(libpipe_loader_client_la-pipe_loader_sw.o): In function `pipe_loader_sw_probe_xlib':
mesa/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c:64: undefined reference to `xlib_create_sw_winsys'
Comment 1 Vinson Lee 2014-02-22 08:25:12 UTC
Build error can be produced with these steps.

$ ./autogen.sh --disable-dri3 --enable-gallium-tests --with-dri-drivers= --with-gallium-drivers=swrast
$ make
Comment 2 Vinson Lee 2014-02-22 08:31:47 UTC
cc3aeacab64a6928a903f1dbfeaa7c880a8de5a6 is the first bad commit
commit cc3aeacab64a6928a903f1dbfeaa7c880a8de5a6
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Mon Feb 10 20:19:20 2014 +0000

    pipe-loader: introduce pipe_loader_sw_probe_xlib helper
    
    Will be used in the upcoming patches.
    
    v2: handle xlib_create_sw_winsys failure, drop unneeded header
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)

:040000 040000 a8b0a9c269834a053eeaf2c8faa1ecd579eefe05 05fb82402e83068a0cdffd044863c2c9a106de87 M	src
bisect run success
Comment 3 Emil Velikov 2014-02-22 17:00:10 UTC
Created attachment 94574 [details] [review]
pipe-loader: wrap pipe_loader_sw_probe_xlib within HAVE_PIPE_LOADER_XLIB

The patch description does not directly relate to the build log, as I have chosen to fix the problem rather than putting ducktape over it. 

Note: The gallium/tests/trivial will segfault due to use of asserts over proper error handling.

Patch is working like a charm here, please give it a test as it's a bit more evasive than I would like.
-Emil
Comment 4 Christian Prochaska 2014-02-22 17:42:52 UTC
(In reply to comment #3)
> Created attachment 94574 [details] [review] [review]
> pipe-loader: wrap pipe_loader_sw_probe_xlib within HAVE_PIPE_LOADER_XLIB
> 
> The patch description does not directly relate to the build log, as I have
> chosen to fix the problem rather than putting ducktape over it. 
> 
> Note: The gallium/tests/trivial will segfault due to use of asserts over
> proper error handling.
> 
> Patch is working like a charm here, please give it a test as it's a bit more
> evasive than I would like.
> -Emil

With the following addition, it could also compile without X headers:

diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
index 78b465b..17c2874 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
@@ -31,7 +31,9 @@
 #include "util/u_dl.h"
 #include "sw/dri/dri_sw_winsys.h"
 #include "sw/null/null_sw_winsys.h"
+#ifdef HAVE_PIPE_LOADER_XLIB
 #include "sw/xlib/xlib_sw_winsys.h"
+#endif
 #include "target-helpers/inline_sw_helper.h"
 #include "state_tracker/drisw_api.h"
Comment 5 Emil Velikov 2014-02-24 14:59:52 UTC
Pushed to master

commit 3445e8bb921545f74e2b6a823d47fa29352e9262
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Feb 22 16:44:14 2014 +0000

    pipe-loader: wrap pipe_loader_sw_probe_xlib within HAVE_PIPE_LOADER_XLIB

    The above function implies using the the xlib winsys, which
    has additional library dependencies that should not be forced.

    Make the software xlib pipe loader optional thus avoid all
    the dependency hell. A user that wishes to use the particular
    pipe-loader would need to set the following within configure.ac.

     enable_gallium_xlib_loader=yes

    v2:
     - Wrap sw/xlib/xlib_sw_winsys.h to handle compilation on systems
    lacking X11 headers. Spotted by Christian Prochaska.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.