[Mesa-dev] [PATCH 09/15] i965: Build the driver into a shared mesa_dri_drivers.so .

Chad Versace chad.versace at linux.intel.com
Thu Oct 24 19:23:08 CEST 2013


On 10/23/2013 11:31 AM, Eric Anholt wrote:
> Chad Versace <chad.versace at linux.intel.com> writes:
>
>> On 10/11/2013 06:03 PM, Eric Anholt wrote:
>>> Previously, we've split things such that mesa core is in libdricore,
>>> exposing the whole Mesa core interface in the global namespace, and the
>>> i965_dri.so code all links against that.  Along with polluting application
>>> namespace terribly, it requires extra PLT indirections and prevents LTO.
>>>
>>> Instead, we can build all of the driver contents into the same .so with
>>> just a few symbols exposed to be referenced from the actual driver .so
>>> file, allowing LTO and reducing our exposed symbol count massively.
>>>
>>> FPS improvement on GLB2.7 with INTEL_NO_HW=1: 2.61061% +/- 1.16957% (n=50)
>>> (without LTO, just the PLT reductions from this commit)
>>>
>>> v2: Set a global driverAPI variable so loaders don't have to update to
>>>       createNewScreen2() (though they may want to for thread safety).
>>>
>>> Reviewed-by: Matt Turner <mattst88 at gmail.com> (v1)
>>> ---
>>>    configure.ac                                  | 29 +++++++++++---
>>>    src/mesa/drivers/dri/Makefile.am              | 54 ++++++++++++++++++++++++++-
>>>    src/mesa/drivers/dri/common/Makefile.am       |  3 ++
>>>    src/mesa/drivers/dri/common/dri_util.c        | 19 +++++++++-
>>>    src/mesa/drivers/dri/common/dri_util.h        |  2 +-
>>>    src/mesa/drivers/dri/common/megadriver_stub.c | 41 ++++++++++++++++++++
>>>    src/mesa/drivers/dri/i965/Makefile.am         | 27 +++-----------
>>>    src/mesa/drivers/dri/i965/intel_screen.c      | 18 +++++++--
>>>    src/mesa/drivers/dri/i965/intel_screen.h      |  2 +
>>>    9 files changed, 162 insertions(+), 33 deletions(-)
>>>    create mode 100644 src/mesa/drivers/dri/common/megadriver_stub.c
>>>
>>
>>
>>
>>> +# Add a link to allow setting LD_LIBRARY_PATH/LIBGL_DRIVERS_PATH to /lib of the build tree.
>>> +all-local: mesa_dri_drivers.la
>>> +	$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
>>> +	$(AM_V_GEN)ln -f .libs/mesa_dri_drivers.so \
>>> +			 $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.so;
>>> +	$(AM_V_GEN)for i in $(MEGADRIVERS); do \
>>> +		ln -f $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.so \
>>> +		      $(top_builddir)/$(LIB_DIR)/$$i; \
>>> +	done;
>>> +
>>> +# hardlink each megadriver instance, but don't actually have
>>> +# mesa_dri_drivers.so in the set of final installed files.
>>> +install-data-hook:
>>> +	for i in $(MEGADRIVERS); do \
>>> +		ln -f $(dridir)/mesa_dri_drivers.so \
>>> +		      $(dridir)/$$i; \
>>> +	done;
>>> +	$(RM) -f $(dridir)/mesa_dri_drivers.so
>>> +	$(RM) -f $(dridir)/mesa_dri_drivers.la
>>> +
>>> +endif
>>
>>
>> This hunk breaks `make install` for me. I'm doing an out-of-tree build and
>> installing to --prefix=/usr. Here's the error:
>>
>> make[7]: Entering directory `/home/chad/exp/makepkg/abs/mesa/src/src/mesa/drivers/dri'
>> for i in  i965_dri.so    ; do \
>>           ln -f /usr/lib/xorg/modules/dri/mesa_dri_drivers.so \
>>                 /usr/lib/xorg/modules/dri/$i; \
>> done;
>> ln: failed to access '/usr/lib/xorg/modules/dri/mesa_dri_drivers.so': No such file or directory
>>
>> It seems that the Makefile never install mesa_dri_drivers.so to $(dridir), but
>> then tries to ln it. I don't speak autotools, so I don't see how to fix this.
>
> I can't tell what might have happened from this trimmed log.  I did an
> out of tree build, and mesa_dri_drivers.so gets successfully installed
>  From the install-data-am target that leads to the install-data-hook
> being done afterwards.  I've tried with big and small -j.

I'm using Archlinux. That may be the differentiating factor.

I'll reproduce today and send you a full log and more details.
Maybe we can fix it over irc.



More information about the mesa-dev mailing list