Remember that there is a bug in Gentoo's upgrade of mesa-17.1.10 software

Keywords: Linux Makefile

Recently, I encountered a problem upgrading Gentoo, and there was a compilation error upgrading the media LIBS / mesa package

media-libs/mesa-17.1.10

I'm upgrading from mesa-17.0.6. An error is reported when compiling. The error information is as follows

/bin/sh ../../../libtool  --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -DPACKAGE_NAME=\"Mesa\" -DPACKAGE_TARNAME=\"mesa\" -DPACKAGE_VERSION=\"17.1.10\" -DPACKAGE_STRING=\"Mesa\ 17.1.10\" -DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi\?product=Mesa\" -DPACKAGE_URL=\"\" -DPACKAGE=\"mesa\" -DVERSION=\"17.1.10\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DYYTEXT_POINTER=1 -DHAVE___BUILTIN_BSWAP32=1 -DHAVE___BUILTIN_BSWAP64=1 -DHAVE___BUILTIN_CLZ=1 -DHAVE___BUILTIN_CLZLL=1 -DHAVE___BUILTIN_CTZ=1 -DHAVE___BUILTIN_EXPECT=1 -DHAVE___BUILTIN_FFS=1 -DHAVE___BUILTIN_FFSLL=1 -DHAVE___BUILTIN_POPCOUNT=1 -DHAVE___BUILTIN_POPCOUNTLL=1 -DHAVE___BUILTIN_UNREACHABLE=1 -DHAVE_FUNC_ATTRIBUTE_CONST=1 -DHAVE_FUNC_ATTRIBUTE_FLATTEN=1 -DHAVE_FUNC_ATTRIBUTE_FORMAT=1 -DHAVE_FUNC_ATTRIBUTE_MALLOC=1 -DHAVE_FUNC_ATTRIBUTE_PACKED=1 -DHAVE_FUNC_ATTRIBUTE_PURE=1 -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL=1 -DHAVE_FUNC_ATTRIBUTE_UNUSED=1 -DHAVE_FUNC_ATTRIBUTE_VISIBILITY=1 -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT=1 -DHAVE_FUNC_ATTRIBUTE_WEAK=1 -DHAVE_FUNC_ATTRIBUTE_ALIAS=1 -DMAJOR_IN_SYSMACROS=1 -DHAVE_DLADDR=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -I. -I/var/tmp/portage/media-libs/mesa-17.1.10/work/mesa-17.1.10/src/gallium/auxiliary    -I/var/tmp/portage/media-libs/mesa-17.1.10/work/mesa-17.1.10/src/loader -I../../../src/compiler/nir -I/var/tmp/portage/media-libs/mesa-17.1.10/work/mesa-17.1.10/src/gallium/auxiliary/util -I/var/tmp/portage/media-libs/mesa-17.1.10/work/mesa-17.1.10/include -I/var/tmp/portage/media-libs/mesa-17.1.10/work/mesa-17.1.10/src -I/var/tmp/portage/media-libs/mesa-17.1.10/work/mesa-17.1.10/src/gallium/include -I/var/tmp/portage/media-libs/mesa-17.1.10/work/mesa-17.1.10/src/gallium/auxiliary -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DNDEBUG -DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_XLOCALE_H -DHAVE_SYS_SYSCTL_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_STRTOD_L -DHAVE_DLOPEN -DHAVE_DL_ITERATE_PHDR -DHAVE_POSIX_MEMALIGN -DHAVE_LIBDRM -DGLX_USE_DRM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DHAVE_X11_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_WAYLAND_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_DRI3 -DENABLE_SHADER_CACHE -DHAVE_MINCORE -DHAVE_LLVM=0x0500 -DMESA_LLVM_VERSION_PATCH=0  -fvisibility=hidden -Werror=pointer-arith -Werror=vla -I/usr/include/libdrm -I/usr/lib64/llvm/5/include   -DLLVM_BUILD_GLOBAL_ISEL -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -march=native -O2 -pipe -Wall -std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-math-errno -fno-trapping-math  -c -o gallivm/lp_bld_tgsi_info.lo /var/tmp/portage/media-libs/mesa-17.1.10/work/mesa-17.1.10/src/gallium/auxiliary/gallivm/lp_bld_tgsi_info.c
make[4]: *** [Makefile:2337: gallivm/lp_bld_misc.lo] Error 1

We can't see much specific information here. Using makeopts=j1, we get more detailed error information

gentoo ~ # makeopts=j1 emerge -av mesa

/var/tmp/portage/media-libs/mesa-17.1.10/work/mesa-17.1.10/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp: In member function 'virtual void DelegatingJITMemoryManager::deregisterEHFrames(uint8_t*, uint64_t, size_t)':
/var/tmp/portage/media-libs/mesa-17.1.10/work/mesa-17.1.10/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp:346:56: error: no matching function for call to 'llvm::RTDyldMemoryManager::deregisterEHFrames(uint8_t*&, uint64_t&, size_t&)'
          mgr()->deregisterEHFrames(Addr, LoadAddr, Size);
                                                        ^
In file included from /usr/lib64/llvm/5/include/llvm/ExecutionEngine/SectionMemoryManager.h:20:0,
                 from /var/tmp/portage/media-libs/mesa-17.1.10/work/mesa-17.1.10/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp:64:
/usr/lib64/llvm/5/include/llvm/ExecutionEngine/RTDyldMemoryManager.h:73:8: note: candidate: virtual void llvm::RTDyldMemoryManager::deregisterEHFrames()
   void deregisterEHFrames() override;

You can see the compilation error caused by llvm. Baidu found that this is the bug of mesa-17.1.10. The specific link is here
Bug 640650 - media-libs/mesa-17.1.10 - .../work/mesa-17.1.10/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp:346:56: error: no matching function for call to 'llvm::RTDyldMemoryManager::deregisterEHFrames(uint8_t*&, uint64_t&, size_t&)' At present, mesa-17.1.10 doesn't support llvm5.0-fuck
It's impossible not to upgrade the mesa. In case of package dependency, it will be troublesome. So we can only compromise and solve the problem of canceling the use of llvm when emergent mesa is finished. Let's wait for gentoo to officially solve the problem later.

echo "media-libs/mesa-17.1.10 -llvm" > /etc/portage/package.use/mesa

Then upgrade the system.

Posted by Nicholas on Tue, 05 May 2020 18:59:59 -0700