[Bug 276330] graphics/mesa-libs: ld: error: version script assignment of 'global' to symbol 'XXX' failed: symbol not defined

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 14 Jan 2024 15:48:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276330

            Bug ID: 276330
           Summary: graphics/mesa-libs: ld: error: version script
                    assignment of 'global' to symbol 'XXX' failed: symbol
                    not defined
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: x11@FreeBSD.org
          Reporter: freebsd@oldach.net
          Assignee: x11@FreeBSD.org
             Flags: maintainer-feedback?(x11@FreeBSD.org)

It appears that the recent llvm17 in base breaks building graphics/mesa-libs:

FAILED: src/gallium/targets/dri/libgallium_dri.so
c++  -o src/gallium/targets/dri/libgallium_dri.so
src/gallium/targets/dri/libgallium_dri.so.p/target.c.o -Wl,--as-needed
-Wl,--no-undefined -Wl,-O1 -shared -fPIC -Wl,--start-group
-Wl,-soname,libgallium_dri.so -fstack-protector-strong -O2 -pipe
-fstack-protector-strong -fno-strict-aliasing
'-Wl,-rpath,$ORIGIN/../../../mapi/shared-glapi:/usr/local/lib'
-Wl,-rpath-link,/usr/obj/usr/ports/graphics/mesa-libs/work/mesa-23.3.3/_build/src/mapi/shared-glapi
-Wl,-rpath-link,/usr/local/lib src/gallium/frontends/dri/libdri.a
src/util/libmesa_util.a src/util/libmesa_util_sse41.a
src/util/blake3/libblake3.a src/c11/impl/libmesa_util_c11.a src/mesa/libmesa.a
src/compiler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a
src/compiler/nir/libnir.a src/compiler/libcompiler.a src/mesa/libmesa_sse41.a
src/compiler/spirv/libvtn.a src/gallium/auxiliary/libgalliumvl.a
src/gallium/auxiliary/libgallium.a src/mapi/shared-glapi/libglapi.so.0.0.0
src/gallium/auxiliary/pipe-loader/libpipe_loader_static.a
src/loader/libloader.a src/util/libxmlconfig.a
src/gallium/winsys/sw/null/libws_null.a src/gallium/winsys/sw/wrapper/libwsw.a
src/gallium/winsys/sw/dri/libswdri.a
src/gallium/winsys/sw/kms-dri/libswkmsdri.a src/gallium/drivers/r300/libr300.a
src/gallium/winsys/radeon/drm/libradeonwinsys.a -Wl,--build-id=sha1
-Wl,--gc-sections -Wl,--version-script
/usr/obj/usr/ports/graphics/mesa-libs/work/mesa-23.3.3/src/gallium/targets/dri/dri.sym
-Wl,--dynamic-list
/usr/obj/usr/ports/graphics/mesa-libs/work/mesa-23.3.3/src/gallium/targets/dri/../dri.dyn
/usr/local/lib/libdrm.so -pthread /usr/local/lib/libexpat.so /usr/lib/libz.so
-lm /usr/local/lib/libxcb-randr.so /usr/local/lib/libdrm_radeon.so
-Wl,--end-group
ld: error: version script assignment of 'global' to symbol
'nouveau_drm_screen_create' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol
'amdgpu_winsys_create' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol
'fd_drm_screen_create_renderonly' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol
'ac_init_shared_llvm_once' failed: symbol not defined
c++: error: linker command failed with exit code 1 (use -v to see invocation)
[ 93% 962/1031] cc -Isrc/glx/libglx.a.p -Isrc/glx -I../src/glx -Iinclude
-I../include -Isrc -I../src -Isrc/mapi/glapi -I../src/mapi/glapi -Isrc/loader
-I../src/loader -Isrc/mapi/glapi/gen -I/usr/local/include
-I/usr/local/include/libdrm -fvisibility=hidden -fdiagnostics-color=never
-DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c11
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
'-DPACKAGE_VERSION="23.3.3"'
'-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"'
-DHAVE_OPENGL=1 -DHAVE_OPENGL_ES_1=1 -DHAVE_OPENGL_ES_2=1 -DHAVE_R300
-DVIDEO_CODEC_VC1DEC=0 -DVIDEO_CODEC_H264DEC=0 -DVIDEO_CODEC_H264ENC=0
-DVIDEO_CODEC_H265DEC=0 -DVIDEO_CODEC_H265ENC=0 -DHAVE_X11_PLATFORM
-DHAVE_SURFACELESS_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_XCB_PLATFORM
-DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DGLX_INDIRECT_RENDERING
-DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DGLAPI_EXPORT_PROTO_ENTRY_POINTS=0
-DALLOW_KCMP -DETIME=ETIMEDOUT -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32
-DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL
-DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS
-DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL
-DHAVE___BUILTIN_UNREACHABLE -DHAVE___BUILTIN_TYPES_COMPATIBLE_P
-DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN
-DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE
-DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT
-DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT
-DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL
-DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN
-DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_UINT128 -DHAVE_REALLOCARRAY
-DHAVE_FMEMOPEN -D_GNU_SOURCE -DUSE_SSE41 -DHAVE___BUILTIN_IA32_CLFLUSHOPT
-DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DHAS_SCHED_H
-DHAS_SCHED_GETAFFINITY -DHAVE_SYS_SYSCTL_H -DHAVE_XLOCALE_H -DHAVE_ENDIAN_H
-DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_PTHREAD_NP_H -DHAVE_STRTOF
-DHAVE_MKOSTEMP -DHAVE_MEMFD_CREATE -DHAVE_FLOCK -DHAVE_STRTOK_R
-DHAVE_GETRANDOM -DHAVE_QSORT_S -DHAVE_POSIX_FALLOCATE -DHAVE_BSD_QSORT_R
-DHAVE_STRUCT_TIMESPEC -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE
-DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB
-DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_LIBDRM -DHAVE_LIBUDEV -DUSE_LIBELF
-DUSE_LIBGLVND=1 -DHAVE_DRI -DHAVE_DRI2 -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS
-DHAVE_DRISW_KMS -Werror=implicit-function-declaration
-Werror=missing-prototypes -Werror=return-type -Werror=empty-body
-Werror=incompatible-pointer-types -Werror=int-conversion
-Wimplicit-fallthrough -Wmisleading-indentation -Wno-missing-field-initializers
-fno-math-errno -fno-trapping-math -Qunused-arguments -fno-common
-Wno-microsoft-enum-value -Wno-unused-function -Werror=format -Wformat-security
-ffunction-sections -fdata-sections -Wno-unused-variable
-Wno-unused-but-set-variable -O2 -pipe -fstack-protector-strong
-fno-strict-aliasing -fPIC -D_THREAD_SAFE -pthread
'-DGL_LIB_NAME="libGLX_mesa.so.0"' -MD -MQ
src/glx/libglx.a.p/meson-generated_.._.._mapi_glapi_gen_indirect.c.o -MF
src/glx/libglx.a.p/meson-generated_.._.._mapi_glapi_gen_indirect.c.o.d -o
src/glx/libglx.a.p/meson-generated_.._.._mapi_glapi_gen_indirect.c.o -c
src/mapi/glapi/gen/indirect.c
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/graphics/mesa-libs
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/mesa-libs


This seems to be caused by
https://gitlab.freedesktop.org/mesa/mesa/-/issues/9825. Adding the suggested
-Wl,--undefined-version helps.

-- 
You are receiving this mail because:
You are the assignee for the bug.