# building Mesa 21.2



## FrostKiwi (Jul 1, 2021)

I am very exciting to try out "Crocus", the new Gallium 3D Driver for older Intel Hardware.
I succesfully built and currently use other versions of Mesa by manually applying the patches from /usr/ports/graphics/mesa-dri/files.
This does not work anymore. After generating the build files with:
`meson .. -Dvulkan-drivers= -Ddri-drivers=i915 -Dgallium-drivers=crocus -Dllvm=disabled -Dgles1=disabled --buildtype release`
Building Mesa from git master now results in:

```
/include/c11/threads_posix.h:143:10: error: calling function 'pthread_cond_timedwait' requires holding mutex 'mtx' exclusively [-Werror,-Wthread-safety-analysis]
    rt = pthread_cond_timedwait(cond, mtx, abs_time);
```
With the full log of meson and ninja being here:
Log of meson and ninja

```
The Meson build system
Version: 0.58.1
Source dir: /usr/home/stride/builds/mesa
Build dir: /usr/home/stride/builds/mesa/build
Build type: native build
Program python found: YES (/usr/local/bin/python)
Project name: mesa
Project version: 21.2.0-devel
C compiler for the host machine: cc (clang 11.0.1 "FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)")
C linker for the host machine: cc ld.lld 11.0.1
C++ compiler for the host machine: c++ (clang 11.0.1 "FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)")
C++ linker for the host machine: c++ ld.lld 11.0.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found CMake: /usr/local/bin/cmake (3.20.3)
Run-time dependency clang found: NO (tried cmake)
Program python3 found: YES (/usr/local/bin/python3)
Fetching value of define "ETIME" :
Checking for function "bswap32" : YES
Checking for function "bswap64" : YES
Checking for function "clz" : YES
Checking for function "clzll" : YES
Checking for function "ctz" : YES
Checking for function "expect" : YES
Checking for function "ffs" : YES
Checking for function "ffsll" : YES
Checking for function "popcount" : YES
Checking for function "popcountll" : YES
Checking for function "unreachable" : YES
Checking for function "types_compatible_p" : YES
Compiler for C supports function attribute const: YES
Compiler for C supports function attribute flatten: YES
Compiler for C supports function attribute malloc: YES
Compiler for C supports function attribute pure: YES
Compiler for C supports function attribute unused: YES
Compiler for C supports function attribute warn_unused_result: YES
Compiler for C supports function attribute weak: YES
Compiler for C supports function attribute format: YES
Compiler for C supports function attribute packed: YES
Compiler for C supports function attribute returns_nonnull: YES
Compiler for C supports function attribute alias: YES
Compiler for C supports function attribute noreturn: YES
Compiler for C supports function attribute visibility:hidden: YES
Checking if "__uint128_t" compiles: YES
Compiler for C supports arguments -Werror=implicit-function-declaration: YES
Compiler for C supports arguments -Werror=missing-prototypes: YES
Compiler for C supports arguments -Werror=return-type: YES
Compiler for C supports arguments -Werror=empty-body: YES
Compiler for C supports arguments -Werror=incompatible-pointer-types: YES
Compiler for C supports arguments -Werror=int-conversion: YES
Compiler for C supports arguments -Wimplicit-fallthrough: YES
Compiler for C supports arguments -Werror=thread-safety: YES
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Compiler for C supports arguments -Wno-format-truncation: NO
Compiler for C supports arguments -fno-math-errno: YES
Compiler for C supports arguments -fno-trapping-math: YES
Compiler for C supports arguments -Qunused-arguments: YES
Compiler for C supports arguments -fno-common: YES
Compiler for C supports arguments -Werror=format: YES
Compiler for C supports arguments -Wformat-security: YES
Compiler for C++ supports arguments -Werror=return-type: YES
Compiler for C++ supports arguments -Werror=empty-body: YES
Compiler for C++ supports arguments -Wno-non-virtual-dtor: YES
Compiler for C++ supports arguments -Wno-missing-field-initializers: YES
Compiler for C++ supports arguments -Wno-format-truncation: NO
Compiler for C++ supports arguments -fno-math-errno: YES
Compiler for C++ supports arguments -fno-trapping-math: YES
Compiler for C++ supports arguments -Qunused-arguments: YES
Compiler for C++ supports arguments -flifetime-dse=1: NO
Compiler for C++ supports arguments -Werror=format: YES
Compiler for C++ supports arguments -Wformat-security: YES
Compiler for C supports arguments -Wno-override-init: YES
Compiler for C supports arguments -Wno-initializer-overrides: YES
Compiler for C supports arguments -Werror=pointer-arith: YES
Compiler for C++ supports arguments -Werror=pointer-arith: YES
Compiler for C supports arguments -Werror=gnu-empty-initializer: YES
Compiler for C++ supports arguments -Werror=gnu-empty-initializer: YES
Compiler for C supports arguments -Wmicrosoft-enum-value: YES
Library atomic found: NO
Checking if "GCC atomic builtins" with dependency -latomic links: YES
Checking if "GCC 64bit atomics" with dependency -latomic links: YES
Library ws2_32 found: NO
Header <sys/sysmacros.h> has symbol "major" : NO
Header <sys/mkdev.h> has symbol "major" : NO
Check usable header "sched.h" : YES
Checking for function "sched_getaffinity" : NO
Check usable header "sys/sysctl.h" : YES
Check usable header "xlocale.h" : YES
Check usable header "linux/futex.h" : NO
Check usable header "endian.h" : NO
Check usable header "dlfcn.h" : YES
Check usable header "execinfo.h" : YES
Check usable header "sys/shm.h" : YES
Check usable header "cet.h" : YES
Check usable header "pthread_np.h" : YES
Checking for function "strtof" : YES
Checking for function "mkostemp" : YES
Checking for function "timespec_get" : YES
Checking for function "memfd_create" : YES
Checking for function "random_r" : NO
Checking for function "flock" : YES
Checking for function "strtok_r" : YES
Checking for function "getrandom" : YES
Checking for function "qsort_r" : YES
Checking for function "qsort_s" : YES
Header <errno.h> has symbol "program_invocation_name" : NO
Checking for function "posix_memalign" : YES
Checking whether type "struct dirent" has member "d_type" : YES
Checking if "strtod has locale support" links: YES
Checking if "Bsymbolic" links: YES
Checking if "gc-sections" links: YES
Checking if "version-script" links: YES
Checking if "dynamic-list" links: YES
Compiler for C supports link arguments -Wl,--build-id=sha1: YES
Checking for function "dlopen" : YES
Checking for function "dladdr" with dependency not-found: YES
Checking for function "dl_iterate_phdr" : YES
Checking for function "clock_gettime" : YES
Found pkg-config: /usr/local/bin/pkg-config (1.7.4)
Run-time dependency zlib found: YES 1.2.11
Run-time dependency libzstd found: YES 1.5.0
Run-time dependency threads found: YES
Checking for function "pthread_setaffinity_np" with dependency threads: NO
Run-time dependency expat found: YES 2.4.1
Library m found: YES
Run-time dependency libdrm_intel found: YES 2.4.106
Run-time dependency libdrm found: YES 2.4.106
Run-time dependency valgrind found: NO (tried pkgconfig)
Program bison found: YES (/usr/local/bin/bison)
Program bison found: YES 3.7.6 (/usr/local/bin/bison)
Program flex found: YES (/usr/bin/flex)
Run-time dependency libunwind found: YES 1.5.0
Found pkg-config: /usr/local/bin/pkg-config (1.7.4)
Build-time dependency wayland-scanner found: YES 1.19.0
Program /usr/local/bin/wayland-scanner found: YES (/usr/local/bin/wayland-scanner)
Run-time dependency wayland-protocols found: YES 1.21
Run-time dependency wayland-client found: YES 1.19.0
Run-time dependency wayland-server found: YES 1.19.0
Run-time dependency wayland-egl-backend found: YES 3
Run-time dependency x11 found: YES 1.7.2
Run-time dependency xext found: YES 1.3.4
Run-time dependency xfixes found: YES 5.0.3
Run-time dependency xcb-glx found: YES 1.14
Run-time dependency xcb-shm found: YES 1.14
Run-time dependency xcb found: YES 1.14
Run-time dependency x11-xcb found: YES 1.7.2
Run-time dependency xcb-dri2 found: YES 1.14
Run-time dependency xcb-dri3 found: YES 1.14
Run-time dependency xcb-present found: YES 1.14
Run-time dependency xcb-sync found: YES 1.14
Run-time dependency xshmfence found: YES 1.3
Run-time dependency glproto found: YES 1.4.17
Run-time dependency dri2proto found: YES 2.8
Run-time dependency xxf86vm found: YES 1.1.4
Run-time dependency xcb-xfixes found: YES 1.14
Run-time dependency xcb-randr found: YES 1.14
Run-time dependency xrandr found: YES 1.5.2
Library sensors found: NO
Compiler for C supports link arguments -Wl,--gc-sections: YES
Compiler for C supports arguments -ffunction-sections: YES
Compiler for C supports arguments -fdata-sections: YES
Program nm found: YES (/usr/bin/nm)
Program symbols-check.py found: YES (/usr/bin/env python /usr/home/stride/builds/mesa/bin/symbols-check.py)
Program install_megadrivers.py found: YES (/usr/local/bin/python3.8 /usr/home/stride/builds/mesa/bin/install_megadrivers.py)
WARNING: Library target 'GLESv2' has 'name_prefix' set. Compilers may not find it from its '-lGLESv2' linker flag in the 'glesv2.pc' pkg-config file.
WARNING: Library target 'GLESv2' has 'name_prefix' set. Compilers may not find it from its '-lGLESv2' linker flag in the 'glesv2-uninstalled.pc' pkg-config file.
Program /usr/home/stride/builds/mesa/bin/install_megadrivers.py found: YES (/usr/local/bin/python3.8 /usr/home/stride/builds/mesa/bin/install_megadrivers.py)
Checking for function "mincore" : YES
Program /usr/home/stride/builds/mesa/bin/install_megadrivers.py found: YES (/usr/local/bin/python3.8 /usr/home/stride/builds/mesa/bin/install_megadrivers.py)
Message: Configuration summary:
       
        prefix:          /usr/local
        libdir:          lib
        includedir:      include
       
        OpenGL:          yes (ES1: no ES2: yes)
        OSMesa:          no
       
        DRI platform:    drm
        DRI drivers:     i915
        DRI driver dir:  /usr/local/lib/dri
       
        GLX:             DRI-based
       
        EGL:             yes
        EGL drivers:     builtin:egl_dri2 builtin:egl_dri3
        GBM:             yes
        EGL/Vulkan/VL platforms:   x11 wayland surfaceless drm
       
        Vulkan drivers:  no
       
        llvm:            no
       
        Gallium drivers: crocus
        Gallium st:      mesa
        HUD lmsensors:   no
       
        Shared-glapi:    yes
       
        Perfetto:        no
        Perfetto ds:     auto

Build targets in project: 158

Option buildtype is: release [default: debugoptimized]
Found ninja-1.10.2 at /usr/local/bin/ninja

[1/1309] Generating git_sha1.h with a custom command
[2/1309] Generating driconf_static.h with a custom command
[3/1309] Generating u_format_table.c with a custom command (wrapped by meson to capture output)
[4/1309] Generating u_format_pack.h with a custom command (wrapped by meson to capture output)
[5/1309] Compiling C object src/util/libmesa_util.a.p/anon_file.c.o
[6/1309] Compiling C object src/util/format/libmesa_format.a.p/u_format.c.o
FAILED: src/util/format/libmesa_format.a.p/u_format.c.o
cc -Isrc/util/format/libmesa_format.a.p -Isrc/util/format -I../src/util/format -Iinclude -I../include -Isrc -I../src -Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../src/gallium/include -Isrc/gallium/auxiliary -I../src/gallium/auxiliary -fvisibility=hidden -fcolor-diagnostics -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c11 -O3 -ffunction-sections -fdata-sections -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="21.2.0-devel"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DHAVE_XCB_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -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 -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DHAS_SCHED_H -DHAVE_SYS_SYSCTL_H -DHAVE_XLOCALE_H -DHAVE_DLFCN_H -DHAVE_EXECINFO_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_PTHREAD_NP_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_QSORT_R -DHAVE_QSORT_S -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_LIBDRM -DMESA_EXECMEM -DHAVE_LIBUNWIND -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Werror=int-conversion -Wimplicit-fallthrough -Werror=thread-safety -Wno-missing-field-initializers -fno-math-errno -fno-trapping-math -Qunused-arguments -fno-common -Werror=format -Wformat-security -Wno-microsoft-enum-value -fPIC -Werror=pointer-arith -Werror=gnu-empty-initializer -MD -MQ src/util/format/libmesa_format.a.p/u_format.c.o -MF src/util/format/libmesa_format.a.p/u_format.c.o.d -o src/util/format/libmesa_format.a.p/u_format.c.o -c ../src/util/format/u_format.c
In file included from ../src/util/format/u_format.c:37:
In file included from ../src/util/u_cpu_detect.h:40:
In file included from ../src/util/u_thread.h:35:
In file included from ../include/c11/threads.h:66:
../include/c11/threads_posix.h:143:10: error: calling function 'pthread_cond_timedwait' requires holding mutex 'mtx' exclusively [-Werror,-Wthread-safety-analysis]
    rt = pthread_cond_timedwait(cond, mtx, abs_time);
         ^
../include/c11/threads_posix.h:155:13: error: calling function 'pthread_cond_wait' requires holding mutex 'mtx' exclusively [-Werror,-Wthread-safety-analysis]
    return (pthread_cond_wait(cond, mtx) == 0) ? thrd_success : thrd_error;
            ^
../include/c11/threads_posix.h:224:1: error: mutex 'mtx' is still held at the end of function [-Werror,-Wthread-safety-analysis]
}
^
../include/c11/threads_posix.h:223:13: note: mutex acquired here
    return (pthread_mutex_lock(mtx) == 0) ? thrd_success : thrd_error;
            ^
../include/c11/threads_posix.h:259:1: error: mutex 'mtx' is not held on every path through here [-Werror,-Wthread-safety-analysis]
}
^
../include/c11/threads_posix.h:242:10: note: mutex acquired here
    rt = pthread_mutex_timedlock(mtx, ts);
         ^
../include/c11/threads_posix.h:274:13: error: releasing mutex 'mtx' that was not held [-Werror,-Wthread-safety-analysis]
    return (pthread_mutex_unlock(mtx) == 0) ? thrd_success : thrd_error;
            ^
5 errors generated.
[7/1309] Compiling C object src/util/format/libmesa_format.a.p/meson-generated_.._u_format_table.c.o
FAILED: src/util/format/libmesa_format.a.p/meson-generated_.._u_format_table.c.o
cc -Isrc/util/format/libmesa_format.a.p -Isrc/util/format -I../src/util/format -Iinclude -I../include -Isrc -I../src -Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../src/gallium/include -Isrc/gallium/auxiliary -I../src/gallium/auxiliary -fvisibility=hidden -fcolor-diagnostics -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c11 -O3 -ffunction-sections -fdata-sections -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="21.2.0-devel"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DHAVE_XCB_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -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 -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DHAS_SCHED_H -DHAVE_SYS_SYSCTL_H -DHAVE_XLOCALE_H -DHAVE_DLFCN_H -DHAVE_EXECINFO_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_PTHREAD_NP_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_QSORT_R -DHAVE_QSORT_S -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_LIBDRM -DMESA_EXECMEM -DHAVE_LIBUNWIND -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Werror=int-conversion -Wimplicit-fallthrough -Werror=thread-safety -Wno-missing-field-initializers -fno-math-errno -fno-trapping-math -Qunused-arguments -fno-common -Werror=format -Wformat-security -Wno-microsoft-enum-value -fPIC -Werror=pointer-arith -Werror=gnu-empty-initializer -MD -MQ src/util/format/libmesa_format.a.p/meson-generated_.._u_format_table.c.o -MF src/util/format/libmesa_format.a.p/meson-generated_.._u_format_table.c.o.d -o src/util/format/libmesa_format.a.p/meson-generated_.._u_format_table.c.o -c src/util/format/u_format_table.c
In file included from src/util/format/u_format_table.c:41:
In file included from ../src/util/half_float.h:32:
In file included from ../src/util/u_cpu_detect.h:40:
In file included from ../src/util/u_thread.h:35:
In file included from ../include/c11/threads.h:66:
../include/c11/threads_posix.h:143:10: error: calling function 'pthread_cond_timedwait' requires holding mutex 'mtx' exclusively [-Werror,-Wthread-safety-analysis]
    rt = pthread_cond_timedwait(cond, mtx, abs_time);
         ^
../include/c11/threads_posix.h:155:13: error: calling function 'pthread_cond_wait' requires holding mutex 'mtx' exclusively [-Werror,-Wthread-safety-analysis]
    return (pthread_cond_wait(cond, mtx) == 0) ? thrd_success : thrd_error;
            ^
../include/c11/threads_posix.h:224:1: error: mutex 'mtx' is still held at the end of function [-Werror,-Wthread-safety-analysis]
}
^
../include/c11/threads_posix.h:223:13: note: mutex acquired here
    return (pthread_mutex_lock(mtx) == 0) ? thrd_success : thrd_error;
            ^
../include/c11/threads_posix.h:259:1: error: mutex 'mtx' is not held on every path through here [-Werror,-Wthread-safety-analysis]
}
^
../include/c11/threads_posix.h:242:10: note: mutex acquired here
    rt = pthread_mutex_timedlock(mtx, ts);
         ^
../include/c11/threads_posix.h:274:13: error: releasing mutex 'mtx' that was not held [-Werror,-Wthread-safety-analysis]
    return (pthread_mutex_unlock(mtx) == 0) ? thrd_success : thrd_error;
            ^
In file included from src/util/format/u_format_table.c:45:
../src/util/format/format_utils.h:82:38: warning: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Wimplicit-const-int-float-conversion]
      return _mesa_i64roundevenf(x * MAX_UINT(dst_bits));
                                   ~ ^~~~~~~~~~~~~~~~~~
../src/util/format/format_utils.h:38:40: note: expanded from macro 'MAX_UINT'
#define MAX_UINT(BITS) ((BITS) == 32 ? UINT32_MAX : ((1u << (BITS)) - 1))
                                       ^~~~~~~~~~
/usr/include/x86/_stdint.h:86:20: note: expanded from macro 'UINT32_MAX'
#define UINT32_MAX      0xffffffffU
                        ^~~~~~~~~~~
1 warning and 5 errors generated.
[8/1309] Generating format_srgb with a custom command (wrapped by meson to capture output)
ninja: build stopped: subcommand failed.
```

Anyone else happen to try to build mesa from git master?


----------



## Alexander88207 (Jul 1, 2021)

Hello,

if you are interested in a bleeding edge Mesa, you should try graphics/mesa-devel.


----------



## FrostKiwi (Jul 1, 2021)

Alexander88207 said:


> Hello,
> 
> if you are interested in a bleeding edge Mesa, you should try graphics/mesa-devel.


that package unforunately runs on Mesa 21.1, not including the new gallium driver and no gallium driver is configured to be build with that one either.
But thanks for the reference, I will try to use the patches from that package to get 21.2 running.


----------



## FrostKiwi (Jul 1, 2021)

I went through the patch files of mesa-devel and unfortunetly they do not address issues with include/c11/threads_posix.h:143:10
Seems The jump from 21.1 to 21.2 introduced much new stuff...


----------



## SirDice (Jul 2, 2021)

I would suggest contacting the maintainer of graphics/mesa-devel. I see there's been an update commited (adding an option for 'crocus') just yesterday, so he's definitely working on it. Just ask if there are plans for importing 21.2. 






						ports - FreeBSD ports tree
					






					cgit.freebsd.org


----------



## FrostKiwi (Jul 2, 2021)

SirDice said:


> I would suggest contacting the maintainer of graphics/mesa-devel. I see there's been an update commited (adding an option for 'crocus') just yesterday, so he's definitely working on it. Just ask if there are plans for importing 21.2.
> 
> 
> 
> ...


"expose crocus to replace i965"
*happy noises*

Thanks for the reference. Indeed, the package maintainer is propably the best person to ask on how to build and contribute back patches.


----------



## FrostKiwi (Jul 2, 2021)

The port itself works and is actually internally reported as Mesa 21.2, though the port refers to it as 21.1, since 21.2 did not release yet officially.
There are issues like image corruption and GPU Hangs, but that is Mesa related and I started addressing it in the mailing list: https://lists.freedesktop.org/archives/mesa-dev/2021-July/225438.html

Many thanks to the maintainer of this port, truly the bleeding edge of FBSD.


----------

