Bug 111169

Summary: libmesa_util.a(u_queue.c.o): undefined reference to symbol 'pthread_setname_np@@GLIBC_2.12'
Product: Mesa Reporter: Vinson Lee <vlee>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: eric
Version: gitKeywords: bisected, regression
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2019-07-18 23:59:07 UTC
meson builddir -Ddri-drivers='' -Dbuild-tests=true -Dgallium-drivers=swrast -Dplatforms=x11 -Dvulkan-drivers=''

FAILED: src/mesa/state_tracker/tests/st_format_test 
c++  -o src/mesa/state_tracker/tests/st_format_test 'src/mesa/state_tracker/tests/st_format_test@exe/st_format.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,--start-group src/mesa/state_tracker/tests/libmesa_st_test_common.a src/gtest/libgtest.a src/mesa/libmesa_gallium.a src/compiler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a src/util/libmesa_util.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/mesa/libmesa_sse41.a src/mapi/shared-glapi/libglapi.so.0.0.0 src/gallium/auxiliary/libgallium.a -lz -lm -Wl,--end-group -ldrm -L/usr/lib/llvm-6.0/lib -lLLVM-6.0 -ldl -lm -lz -lm -lz -lm '-Wl,-rpath,$ORIGIN/../../../mapi/shared-glapi' -Wl,-rpath-link,src/mapi/shared-glapi  
/usr/bin/ld: src/util/libmesa_util.a(u_queue.c.o): undefined reference to symbol 'pthread_setname_np@@GLIBC_2.12'
Comment 1 Vinson Lee 2019-07-19 00:10:30 UTC
f8c27c277585141f2d2732732a8c64c7d40f0961 is the first bad commit
commit f8c27c277585141f2d2732732a8c64c7d40f0961
Author: Eric Anholt <eric@anholt.net>
Date:   Mon Jul 1 13:06:09 2019 -0700

    state_tracker: Move the format test out to be an actual unit test.
    
    We want errors in the table to show up as unit test failures in MRs.
    Also keeps unit test code out of the built drivers.
    
    Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
    Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>

:040000 040000 97a04f178ee7547d3edd8bf12cfeb187b84f557b a7de63dc1badfa11c5df3952e510ce0a8fe99421 M	src
bisect run success
Comment 2 Eric Engestrom 2019-07-19 14:11:42 UTC
What linker are you using to always see these undefined references to unused symbols?

This MR should fix it:
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1391

I'll make a proper fix replacing `libmesa_util` with `idep_mesautil` which should avoid this ever happening again.
Comment 3 Eric Engestrom 2019-07-19 22:07:41 UTC
Fixed by:

commit 0e34e1a0ce4741797451648ccad6e634eb4e7a37
Author: Eric Engestrom <eric.engestrom@intel.com>
Date:   Fri Jul 19 15:00:35 2019 +0100

    mesa/tests: add missing dep_thread
    
    Fixes: f8c27c277585141f2d27 ("state_tracker: Move the format test out to be an actual unit test.")
    Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    Tested-by: Vinson Lee <vlee@freedesktop.org>

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.