[Mesa-dev] [PATCH 2/2] megadriver: explicitly link against glapi, link with -no-undefined

Frank Henigman fjhenigman at google.com
Thu Oct 30 18:11:22 PDT 2014


I was too hasty with my "Tested-by."  While it worked in a
shared-glapi configuration, it broke the build with the following:

./configure --prefix=/usr --build=x86_64-pc-linux-gnu
--host=x86_64-cros-linux-gnu --mandir=/usr/share/man
--infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
--localstatedir=/var/lib --libdir=/usr/lib64
--disable-dependency-tracking --disable-option-checking
--with-driver=dri --disable-glu --disable-glut --without-demos
--enable-texture-float --disable-dri3 --disable-llvm-shared-libs
--enable-glx --enable-llvm-gallium --disable-egl --disable-gbm
--disable-gles1 --disable-gles2 --disable-shared-glapi
--disable-gallium --enable-debug --enable-glx-tls --enable-asm
--disable-xlib-glx --enable-dri --with-dri-drivers=i965
--with-gallium-drivers=

the output is:
...
make[5]: Entering directory
`/build/lumpy/tmp/portage/media-libs/mesa-10.3-r11/work/Mesa-10.3/src/mesa/drivers/dri'
  CXXLD  mesa_dri_drivers.la
../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):glapi_getproc.c:static_functions:
error: undefined reference to 'glAreTexturesResidentEXT'
../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):glapi_getproc.c:static_functions:
error: undefined reference to 'glDeleteTexturesEXT'
...

On Thu, Oct 30, 2014 at 5:20 PM, Frank Henigman <fjhenigman at google.com> wrote:
> This lets me remove a dlopen("libglapi.so") hack from chrome, and
> avoid adding one to waffle, yay.
> I suspect a lot people were forced into the dlopen hack, a quick
> search found a few, see
> https://bugs.freedesktop.org/show_bug.cgi?id=57702
>
> Tested-by: Frank Henigman <fjhenigman at google.com>
>
> On Sat, Oct 25, 2014 at 11:21 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> From: Jon TURNEY <jon.turney at dronecode.org.uk>
>>
>> Currently the dri modules contain unresolved glapi symbols which were
>> provided by xserver 1.14 and older. Since 1.15 the xserver does not
>> provide them and mesa's glapi is the only provider.
>>
>> As discussed with Adam Jackson, the new (linked against glapi) dri
>> modules should still work with older xserver, so let's fix this.
>>
>> Thus way no library provided by mesa is provides libraries with
>> unresolved symbols :)
>>
>> v2 [Emil Velikov]
>>  - Rebase on top of master, reword commit message.
>>  - Use tabs instead of spaces in makefile.
>>
>> Cc: Adam Jackson <ajax at redhat.com>
>> Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>> ---
>>  src/mesa/drivers/dri/Makefile.am | 19 +++++++++++++++----
>>  1 file changed, 15 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/Makefile.am b/src/mesa/drivers/dri/Makefile.am
>> index 2009da9..6075f71 100644
>> --- a/src/mesa/drivers/dri/Makefile.am
>> +++ b/src/mesa/drivers/dri/Makefile.am
>> @@ -51,10 +51,15 @@ driinclude_HEADERS = $(top_srcdir)/include/GL/internal/dri_interface.h
>>  nodist_EXTRA_mesa_dri_drivers_la_SOURCES = dummy.cpp
>>  mesa_dri_drivers_la_SOURCES =
>>  mesa_dri_drivers_la_LDFLAGS = \
>> -        -module -avoid-version -shared -shrext .so \
>> -        $(BSYMBOLIC) \
>> -        $(GC_SECTIONS) \
>> -        $()
>> +       -shared \
>> +       -shrext .so \
>> +       -module \
>> +       -no-undefined \
>> +       -avoid-version \
>> +       $(BSYMBOLIC) \
>> +       $(GC_SECTIONS) \
>> +       $(LD_NO_UNDEFINED) \
>> +       $()
>>  mesa_dri_drivers_la_LIBADD = \
>>          ../../libmesa.la \
>>          common/libmegadriver_stub.la \
>> @@ -63,6 +68,12 @@ mesa_dri_drivers_la_LIBADD = \
>>          $(DRI_LIB_DEPS) \
>>          $()
>>
>> +if HAVE_SHARED_GLAPI
>> +mesa_dri_drivers_la_LIBADD += $(top_builddir)/src/mapi/shared-glapi/libglapi.la
>> +else
>> +mesa_dri_drivers_la_LIBADD += $(top_builddir)/src/mapi/glapi/libglapi.la
>> +endif
>> +
>>  if NEED_MEGADRIVER
>>  dri_LTLIBRARIES = mesa_dri_drivers.la
>>
>> --
>> 2.1.2
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list