[Mesa-dev] [PATCH 2/2] build: Don't overlink gallium xlib target

Vinson Lee vlee at freedesktop.org
Mon Sep 17 18:05:17 UTC 2018


On Mon, Sep 17, 2018 at 10:44 AM, Dylan Baker <dylan at pnwbakers.com> wrote:
> Currently gallium's xlib target will fail to link due to multiple
> definitions of all the symbols in libmesautil, this only shows up in
> autotools, and not in meson due to differences in the way that meson and
> autotools handle linking static archives into static archives. Autotools
> uses -Wl,--whole-archive implicitly, meson requires this behavior to be
> opted-into. The solution is just to remove libmesautils from the
> libgl-xlib target, since it will get all of those symbols form
> libmesagallium.
>
> I've dropped the link from meson as well, it doesn't seem to hurt
> anything and should make linking just a little faster.
>
> Fixes: 8396043f304bb2a752130230055605c5c966e89f
>        ("Replace uses of _mesa_bitcount with util_bitcount")
> Cc: Vinson Lee <vlee at freedesktop.org>
> Cc: Brain Paul <brianp at vmware.com>
> Cc: Sergii Romantsov<sergii.romantsov at globallogic.com>
> ---
>  src/gallium/targets/libgl-xlib/Makefile.am | 1 -
>  src/gallium/targets/libgl-xlib/meson.build | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/gallium/targets/libgl-xlib/Makefile.am b/src/gallium/targets/libgl-xlib/Makefile.am
> index dc7c6edfdb0..56d548e7c15 100644
> --- a/src/gallium/targets/libgl-xlib/Makefile.am
> +++ b/src/gallium/targets/libgl-xlib/Makefile.am
> @@ -62,7 +62,6 @@ lib at GL_LIB@_la_LIBADD = \
>         $(top_builddir)/src/mapi/glapi/libglapi.la \
>         $(top_builddir)/src/mesa/libmesagallium.la \
>         $(top_builddir)/src/gallium/auxiliary/libgallium.la \
> -       $(top_builddir)/src/util/libmesautil.la \
>         $(SHARED_GLAPI_LIB) \
>         $(GL_LIB_DEPS) \
>         $(CLOCK_LIB) \
> diff --git a/src/gallium/targets/libgl-xlib/meson.build b/src/gallium/targets/libgl-xlib/meson.build
> index 3d197ba7193..921f948ca3a 100644
> --- a/src/gallium/targets/libgl-xlib/meson.build
> +++ b/src/gallium/targets/libgl-xlib/meson.build
> @@ -49,7 +49,7 @@ libgl = shared_library(
>    link_depends : gallium_xlib_link_depends,
>    link_with : [
>      libxlib, libws_xlib, libglapi_static,
> -    libgallium, libmesa_util, libmesa_gallium, gallium_xlib_link_with,
> +    libgallium, libmesa_gallium, gallium_xlib_link_with,
>    ],
>    dependencies : [dep_thread, dep_clock, dep_unwind, driver_swrast, driver_swr],
>    install : true,
> --
> 2.19.0
>

Tested that this fixed the autotools build.

Tested-by: Vinson Lee <vlee at freedesktop.org>


More information about the mesa-dev mailing list