1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
8 SDESC[standard]= Mesa 3D Graphics Library
9 HOMEPAGE= https://www.mesa3d.org/
13 SITES[main]= https://mesa.freedesktop.org/archive/
14 ftp://ftp.freedesktop.org/pub/mesa/
15 DISTFILE[1]= mesa-23.1.9.tar.xz:main
17 SPKGS[standard]= complete
22 OPTIONS_AVAILABLE= X86_DRIVERS ARM_DRIVERS LLVMPIPE WAYLAND
23 OPTIONS_STANDARD= X86_DRIVERS ARM_DRIVERS LLVMPIPE
24 OPT_ON[freebsd]= LLVMPIPE//i386|x86_64
25 OPT_ON[aarch64]= ARM_DRIVERS
26 OPT_ON[linux]= LLVMPIPE//i386|x86_64
27 OPT_ON[x86_64]= X86_DRIVERS
28 OPT_ON[netbsd]= LLVMPIPE//i386|x86_64
29 OPT_ON[dragonfly]= LLVMPIPE//i386|x86_64
30 OPT_ON[i386]= X86_DRIVERS
31 OPT_ON[midnightbsd]= LLVMPIPE//i386|x86_64
33 BUILD_DEPENDS= libdrm:dev:standard
35 libelf:primary:standard
38 python-Mako:single:python_used
39 BUILDRUN_DEPENDS= libdrm:primary:standard
40 EXRUN[drivers]= mesa:primary:standard
41 libelf:primary:standard
43 USES= cpe bison gettext:build gmake meson pkgconfig zstd
44 zlib expat shebangfix solaris-funcs python:build
46 XORG_COMPONENTS= x11 xdamage xext xfixes xshmfence xxf86vm xv xrandr
49 LICENSE= MIT:primary CUSTOM1:primary CUSTOM2:primary
50 LICENSE_NAME= CUSTOM1:"Kronos License (MIT with modifications)"
51 CUSTOM2:"SGI Free Software License B"
52 LICENSE_FILE= MIT:{{WRKDIR}}/LICENSE_MIT
53 CUSTOM1:{{WRKDIR}}/LICENSE_KHRONOS
54 CUSTOM2:{{WRKDIR}}/LICENSE_SGI
55 LICENSE_AWK= MIT:"^$$"
57 LICENSE_SOURCE= MIT:{{WRKSRC}}/include/GL/gl.h
58 CUSTOM2:{{WRKSRC}}/src/glx/eval.c
62 FPC_EQUIVALENT= graphics/mesa-libs
63 MESON_ARGS= -Dplatforms=x11{{WAYPLAT}}
66 -Dgallium-drivers={{GALLIUM_DRIVERS:tW:tl:C/[[:space:]]/,/g}}
74 -Dvulkan-drivers={{VULKAN_DRIVERS:tW:tl:C/[[:space:]]/,/g}}
75 SHEBANG_FILES= src/gallium/*/*/*.py
76 src/gallium/tools/trace/*.py
77 src/gallium/drivers/svga/svgadump/svga_dump.py
78 src/mapi/glapi/gen/*.py
80 src/mesa/main/get_*.py
81 src/util/format_srgb.py
83 src/intel/genxml/gen_pack_header.py
84 SHEBANG_OLD_PYTHON= /usr/bin/env[[:space:]]python2
86 /bin/env[[:space:]]python
87 SOL_FUNCTIONS= dirfd:src/util/disk_cache.c
88 asprintf:src/util/anon_file.c
89 asprintf:src/mesa/drivers/dri/common/megadriver_stub.c
90 asprintf:src/loader/loader.c
91 asprintf:src/egl/main/eglcurrent.c
92 asprintf:src/util/u_string.h
93 asprintf:src/amd/common/ac_rtld.c
94 strnlen:src/util/ralloc.c
95 strnlen:src/mesa/main/errors.c
96 strndup:src/loader/loader.c
97 strndup:src/egl/drivers/dri2/platform_x11.c
98 strndup:src/gallium/drivers/r600/evergreen_compute.c
99 strndup:src/gallium/drivers/radeonsi/si_debug.c
101 CONFIGURE_ENV= ax_cv_check_cflags___Wno_initializer_overrides=no
103 INSTALL_TARGET= install-strip
104 INSTALL_REQ_TOOLCHAIN= yes
106 CFLAGS= -Wno-pointer-sign
107 VAR_OPSYS[sunos]= CPPFLAGS=-D__EXTENSIONS__=1
108 CPPFLAGS=-Wno-unused-function
109 CXXFLAGS=-Drestrict=__restrict__
110 CFLAGS=-D_POSIX_PTHREAD_SEMANTICS
111 CFLAGS=-DF_DUPFD_CLOEXEC=F_DUPFD
112 CFLAGS=-Wno-incompatible-pointer-types
115 MAKEFILE_LINE=MESON_ARGS+=-Dshader-cache=false
117 [ARM_DRIVERS].DESCRIPTION= Build drivers for aarch64 architecture
118 [ARM_DRIVERS].MAKEFILE_ON= GALLIUM_DRIVERS+=FREEDRENO
121 [X86_DRIVERS].DESCRIPTION= Build drivers for i386 and x86_64 architectures
122 [X86_DRIVERS].MAKEFILE_ON= GALLIUM_DRIVERS+=R300
123 GALLIUM_DRIVERS+=SVGA
124 VULKAN_DRIVERS+={{VULKAN_DRIVERS_X86}}
126 [WAYLAND].DESCRIPTION= Build Vulkan drivers for Wayland platform
127 [WAYLAND].BUILDRUN_DEPENDS_ON= wayland:primary:standard
128 [WAYLAND].BUILD_DEPENDS_ON= wayland-protocols:single:standard
129 python-Mako:single:python_default
131 [WAYLAND].MAKEFILE_ON= WAYPLAT=,wayland
132 VULKAN_DRIVERS+=INTEL
133 VULKAN_DRIVERS_X86+=RADEON
135 [LLVMPIPE].DESCRIPTION= Build LLVM-based drivers and libraries
136 [LLVMPIPE].BUILDRUN_DEPENDS_ON= llvm16:primary:standard
137 ocl-icd:primary:standard
138 [LLVMPIPE].BUILD_DEPENDS_ON= libclc:single:standard
139 opencl-headers:single:standard
141 llvm16:tools:standard
143 clang16:complete:standard
144 [LLVMPIPE].MAKEFILE_OFF= MESON_ARGS+=-Dgallium-opencl=disabled
145 [LLVMPIPE].MAKEFILE_ON= GALLIUM_LLVM_DRIVERS+=R600
146 GALLIUM_LLVM_DRIVERS+=RADEONSI
147 GALLIUM_DRIVERS+={{GALLIUM_LLVM_DRIVERS}}
148 MESON_ARGS+=-Dllvm=true
149 MESON_ARGS+=-Dgallium-va=enabled
150 MESON_ARGS+=-Dgallium-opencl=icd
151 MESON_ARGS+=-Dgallium-vdpau=enabled
152 [LLVMPIPE].RUN_DEPENDS_ON= clang16:dynlibs:standard
155 # qsort fixes for BSD break linux
156 ${RM} ${PATCHDIR}/patch-meson.build
159 ${RM} ${STAGEDIR}${PREFIX}/lib/libGL.so*
160 ${RM} ${STAGEDIR}${PREFIX}/include/GL/g*.h
161 ${RM} ${STAGEDIR}${PREFIX}/lib/pkgconfig/gl.pc
162 ${RM} -r ${STAGEDIR}${PREFIX}/include/KHR
163 ${INSTALL_DATA} ${FILESDIR}/01-freebsd.conf \
164 ${STAGEDIR}${PREFIX}/share/drirc.d
168 -e '/SYSCONFDIR/ s|/etc|${PREFIX}/etc|g' \
169 -e '/DATADIR/ s|/usr/share|${PREFIX}/share|g' \
170 ${WRKSRC}/src/util/xmlconfig.c
173 ${AWK} '/Copyright/,/DEALINGS/' ${WRKSRC}/include/GL/glext.h \
174 > ${WRKDIR}/LICENSE_KHRONOS
176 [FILE:1198:descriptions/desc.primary]
177 The Mesa project began as an open-source implementation of the OpenGL
178 specification - a system for rendering interactive 3D graphics.
180 Over the years the project has grown to implement more graphics APIs,
181 including OpenGL ES (versions 1, 2, 3), OpenCL, OpenMAX, VDPAU, VA API,
184 A variety of device drivers allows the Mesa libraries to be used in many
185 different environments ranging from software emulation to complete
186 hardware acceleration for modern GPUs.
188 Mesa ties into several other open-source projects: the Direct Rendering
189 Infrastructure and X.org to provide OpenGL support on Linux, FreeBSD
190 and other operating systems.
192 This package contains the Mesa OpenGL libraries for GLX and EGL clients.
193 These include libOSMesa, libEGL, libGL, and libglesv2 as well as utility
194 libraries libglapi and gbm. The OSMesa library is an Off-Screen version
195 of Mesa in order to do off-screen rendering in other packages like VTK.
196 Offscreen rendering is useful for a number of things, such as batch
197 processing, parallel processing, and remote processing.
199 This package also contains Mesa's libOpenCL implementation "Clover". It is
200 built upon GALLIUM and currently only supports Radeon GPUs.
203 [FILE:162:descriptions/desc.drivers]
204 This package contains the Mesa OpenGL libraries for GLX and EGL clients.
205 These include libEGL, libGL, and libglesv2 as well as utlity libraries
210 295ba27c28146ed09214e8ce79afa1659edf9d142decc3c91f804552d64f7510 18589464 mesa-23.1.9.tar.xz
213 [FILE:365:manifests/plist.primary]
214 %%LLVMPIPE-ON%%etc/OpenCL/vendors/mesa.icd
217 libMesaOpenCL.so.1.0.0
218 %%LLVMPIPE-ON%%lib/gallium-pipe/
232 libxatracker.so.2.5.0
235 [FILE:483:manifests/plist.drivers]
236 %%ARM_DRIVERS-ON%%lib/dri/
240 %%LLVMPIPE-ON%%lib/dri/
244 radeonsi_drv_video.so
245 %%LLVMPIPE-ON%%lib/vdpau/
248 libvdpau_r600.so.1.0.0
249 libvdpau_radeonsi.so.1
250 libvdpau_radeonsi.so.1.0
251 libvdpau_radeonsi.so.1.0.0
252 %%X86_DRIVERS-ON%%lib/dri/
259 00-mesa-defaults.conf
263 [FILE:334:manifests/plist.dev]
264 %%LLVMPIPE-ON%%lib/libMesaOpenCL.so
265 %%LLVMPIPE-ON%%lib/vdpau/
274 include/GL/internal/dri_interface.h
287 [FILE:2264:patches/patch-meson.build]
288 --- meson.build.orig 2023-10-04 13:53:02 UTC
290 @@ -121,7 +121,8 @@ with_any_opengl = with_opengl or with_gl
291 # Only build shared_glapi if at least one OpenGL API is enabled
292 with_shared_glapi = with_shared_glapi and with_any_opengl
294 -system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android'].contains(host_machine.system())
295 +system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly',
296 +'linux', 'sunos', 'android', 'midnightbsd'].contains(host_machine.system())
298 gallium_drivers = get_option('gallium-drivers')
299 if gallium_drivers.contains('auto')
300 @@ -1025,7 +1026,7 @@ else
303 # FreeBSD annotated <pthread.h> but Mesa isn't ready
304 - if not (cc.get_id() == 'clang' and host_machine.system() == 'freebsd')
305 + if not (cc.get_id() == 'clang' and ['freebsd', 'midnightbsd'].contains(host_machine.system()))
306 _trial_c += ['-Werror=thread-safety']
309 @@ -1287,34 +1288,34 @@ foreach f, prefix: functions_to_detect
313 - #define _GNU_SOURCE
316 - static int dcomp(const void *l, const void *r, void *t) { return 0; }
317 + static int dcomp(void *t, const void *l, const void *r) { return 0; }
319 int main(int ac, char **av) {
322 - qsort_r((void*)&arr[0], 1, 1, dcomp, t);
323 + qsort_r((void*)&arr[0], 1, 1, t, dcomp);
327 - name : 'GNU qsort_r')
328 - pre_args += '-DHAVE_GNU_QSORT_R'
329 + name : 'BSD qsort_r')
330 + pre_args += '-DHAVE_BSD_QSORT_R'
332 + #define _GNU_SOURCE
335 - static int dcomp(void *t, const void *l, const void *r) { return 0; }
336 + static int dcomp(const void *l, const void *r, void *t) { return 0; }
338 int main(int ac, char **av) {
341 - qsort_r((void*)&arr[0], 1, 1, t, dcomp);
342 + qsort_r((void*)&arr[0], 1, 1, dcomp, t);
346 - name : 'BSD qsort_r')
347 - pre_args += '-DHAVE_BSD_QSORT_R'
348 + name : 'GNU qsort_r')
349 + pre_args += '-DHAVE_GNU_QSORT_R'
352 if cc.has_header_symbol('time.h', 'struct timespec')
355 [FILE:227:patches/patch-src_amd_llvm_ac__llvm__build.h]
356 --- src/amd/llvm/ac_llvm_build.h.orig 2023-10-04 13:53:02 UTC
357 +++ src/amd/llvm/ac_llvm_build.h
371 [FILE:512:patches/patch-src_amd_vulkan_radv__device.c]
372 - Define CLOCK_MONOTONIC_RAW if missing
374 --- src/amd/vulkan/radv_device.c.orig 2023-10-04 13:53:02 UTC
375 +++ src/amd/vulkan/radv_device.c
376 @@ -443,6 +443,14 @@ radv_parse_force_vrs_config_file(const c
378 #define BUF_LEN ((10 * (sizeof(struct inotify_event) + NAME_MAX + 1)))
380 +#ifndef CLOCK_MONOTONIC_RAW
381 +# ifdef CLOCK_MONOTONIC_FAST
382 +# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
384 +# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
389 radv_notifier_thread_run(void *data)
393 [FILE:354:patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c]
394 - Define ETIME if missing
396 --- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig 2023-10-04 13:53:02 UTC
397 +++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
400 enum { VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024 };
403 +#define ETIME ETIMEDOUT
406 struct radv_amdgpu_ib {
407 struct radeon_winsys_bo *bo;
411 [FILE:544:patches/patch-src_egl_drivers_dri2_egl__dri2.c]
412 --- src/egl/drivers/dri2/egl_dri2.c.orig 2023-10-04 13:53:02 UTC
413 +++ src/egl/drivers/dri2/egl_dri2.c
414 @@ -918,11 +918,13 @@ dri2_setup_screen(_EGLDisplay *disp)
415 disp->Extensions.KHR_gl_texture_3D_image = EGL_TRUE;
418 +# ifndef __DragonFly__
419 if (dri2_dpy->image->base.version >= 8 &&
420 dri2_dpy->image->createImageFromDmaBufs) {
421 disp->Extensions.EXT_image_dma_buf_import = EGL_TRUE;
422 disp->Extensions.EXT_image_dma_buf_import_modifiers = EGL_TRUE;
430 [FILE:796:patches/patch-src_egl_drivers_dri2_platform__wayland.c]
431 --- src/egl/drivers/dri2/platform_wayland.c.orig 2023-10-04 13:53:02 UTC
432 +++ src/egl/drivers/dri2/platform_wayland.c
433 @@ -2014,12 +2014,14 @@ registry_handle_global_drm(void *data, s
434 if (strcmp(interface, wl_drm_interface.name) == 0) {
435 dri2_dpy->wl_drm_version = MIN2(version, 2);
436 dri2_dpy->wl_drm_name = name;
437 +#ifndef __DragonFly__
438 } else if (strcmp(interface, zwp_linux_dmabuf_v1_interface.name) == 0 && version >= 3) {
439 dri2_dpy->wl_dmabuf =
440 wl_registry_bind(registry, name, &zwp_linux_dmabuf_v1_interface,
441 MIN2(version, ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION));
442 zwp_linux_dmabuf_v1_add_listener(dri2_dpy->wl_dmabuf, &dmabuf_listener,
450 [FILE:281:patches/patch-src_egl_main_eglglobals.c]
451 --- src/egl/main/eglglobals.c.orig 2023-10-04 13:53:02 UTC
452 +++ src/egl/main/eglglobals.c
454 #include "util/macros.h"
455 #include "util/os_misc.h"
457 +#ifdef __DragonFly__
463 #include <sys/mman.h>
466 [FILE:3256:patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c]
467 Revert the following commit.
469 FreeBSD and DragonFly don't have the required render nodes.
473 From 69a1b9959e59653da262185c4e2cf57d24939b19 Mon Sep 17 00:00:00 2001
474 From: Emil Velikov <emil.l.velikov@gmail.com>
475 Date: Mon, 29 Jun 2015 12:36:45 +0100
476 Subject: pipe-loader: drop support for non-render node devices
478 Render nodes have been around for quite some time. Removing support via
479 the master/primary node allows us to clean up the conditional
480 compilation and simplify the build greatly.
482 For example currently we the pipe-loader, which explicitly links against
483 xcb and friends (for X auth) if found at compile-time. That
484 would cause problems as one will be forced to use X/xcb, even if it's a
485 headless system that is used for opencl.
487 v2: Clarify the linking topic in the commit message.
489 Cc: Tom Stellard <thomas.stellard@amd.com>
490 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
491 Reviewed-by: Francisco Jerez <currojerez@riseup.net>
494 --- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2023-10-04 13:53:02 UTC
495 +++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
496 @@ -199,6 +199,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa
500 +open_drm_minor(int minor)
502 + char path[PATH_MAX];
503 + snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor);
504 + return open(path, O_RDWR, 0);
508 open_drm_render_node_minor(int minor)
511 @@ -210,8 +218,15 @@ open_drm_render_node_minor(int minor)
513 pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
516 + int i, k, fd, num_render_node_devs;
520 + unsigned vendor_id;
522 + } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
524 + /* Look for render nodes first */
525 for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
526 i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
527 struct pipe_loader_device *dev;
528 @@ -225,6 +240,9 @@ pipe_loader_drm_probe(struct pipe_loader
532 + render_node_devs[j].vendor_id = dev->u.pci.vendor_id;
533 + render_node_devs[j].chip_id = dev->u.pci.chip_id;
538 @@ -234,6 +252,46 @@ pipe_loader_drm_probe(struct pipe_loader
542 + num_render_node_devs = j;
544 + /* Next look for drm devices. */
545 + for (i = 0; i < DRM_MAX_MINOR; i++) {
546 + struct pipe_loader_device *dev;
547 + boolean duplicate = FALSE;
548 + fd = open_drm_minor(i);
552 + if (!pipe_loader_drm_probe_fd(&dev, fd)) {
557 + /* Check to make sure we aren't already accessing this device via
560 + for (k = 0; k < num_render_node_devs; k++) {
561 + if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id &&
562 + dev->u.pci.chip_id == render_node_devs[k].chip_id) {
564 + dev->ops->release(&dev);
576 + dev->ops->release(&dev);
587 [FILE:357:patches/patch-src_gallium_auxiliary_renderonly_renderonly.c]
588 --- src/gallium/auxiliary/renderonly/renderonly.c.orig 2023-10-04 13:53:02 UTC
589 +++ src/gallium/auxiliary/renderonly/renderonly.c
591 #include "util/u_inlines.h"
592 #include "util/u_memory.h"
599 renderonly_scanout_destroy(struct renderonly_scanout *scanout,
600 struct renderonly *ro)
603 [FILE:403:patches/patch-src_gallium_drivers_llvmpipe_lp__scene.c]
604 --- src/gallium/drivers/llvmpipe/lp_scene.c.orig 2023-10-04 13:53:02 UTC
605 +++ src/gallium/drivers/llvmpipe/lp_scene.c
608 **************************************************************************/
611 +#define _OPENBSD_SOURCE
612 +#include <stdlib.h> /* for reallocarray */
614 #include "util/u_framebuffer.h"
615 #include "util/u_math.h"
616 #include "util/u_memory.h"
619 [FILE:360:patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c]
620 # define ETIME as ETIMEOUT same as in intel driver
622 --- src/gallium/drivers/vc4/vc4_bufmgr.c.orig 2023-10-04 13:53:02 UTC
623 +++ src/gallium/drivers/vc4/vc4_bufmgr.c
627 #include <xf86drmMode.h>
629 +#define ETIME ETIMEDOUT
632 #include "util/u_hash_table.h"
633 #include "util/u_memory.h"
636 [FILE:271:patches/patch-src_gallium_winsys_amdgpu_drm_amdgpu__cs.c]
637 --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c.orig 2023-10-04 13:53:02 UTC
638 +++ src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
641 #include "amd/common/sid.h"
649 static struct pipe_fence_handle *
652 [FILE:1012:patches/patch-src_intel_common_intel__measure.c]
653 --- src/intel/common/intel_measure.c.orig 2023-10-04 13:53:02 UTC
654 +++ src/intel/common/intel_measure.c
656 #include "util/u_debug.h"
657 #include "util/macros.h"
661 +mkfifoat(int fd, const char *path, mode_t mode)
663 + int er, curfd = -1, newfd = -1;
665 + /* Get our current directory then switch to the given one. */
667 + if (fd != AT_FDCWD) {
668 + if ((curfd = open(".", O_RDONLY, 0)) == -1)
670 + if (fchdir(fd) == -1)
674 + if ((newfd = mkfifo(path, mode)) == -1)
677 + /* This leaves the fifo if it fails. */
679 + if (curfd != -1 && fchdir(curfd) == -1)
686 + /* Ignore errors in close(2). */
700 static const struct debug_control debug_control[] = {
701 { "draw", INTEL_MEASURE_DRAW },
704 [FILE:1014:patches/patch-src_intel_compiler_brw__eu__validate.c]
705 --- src/intel/compiler/brw_eu_validate.c.orig 2023-10-04 13:53:02 UTC
706 +++ src/intel/compiler/brw_eu_validate.c
715 +memmem(const void *l, size_t l_len, const void *s, size_t s_len)
718 + const char *cl = (const char *)l;
719 + const char *cs = (const char *)s;
721 + /* we need something to compare */
722 + if (l_len == 0 || s_len == 0)
725 + /* "s" must be smaller or equal to "l" */
729 + /* special case where s_len == 1 */
731 + return memchr(l, (int)*cs, l_len);
733 + /* the last position where its possible to find "s" in "l" */
734 + last = (char *)cl + l_len - s_len;
736 + for (cur = (char *)cl; cur <= last; cur++)
737 + if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0)
744 /* We're going to do lots of string concatenation, so this should help. */
749 [FILE:954:patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp]
750 --- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig 2023-10-04 13:53:02 UTC
751 +++ src/intel/compiler/brw_fs_bank_conflicts.cpp
752 @@ -309,8 +309,13 @@ namespace {
753 const unsigned align = MAX2(sizeof(void *), __alignof__(vector_type));
754 const unsigned size = DIV_ROUND_UP(n, vector_width) * sizeof(vector_type);
757 + p = memalign(align, size);
758 + if (p == NULL) return NULL;
760 if (posix_memalign(&p, align, size))
764 return reinterpret_cast<vector_type *>(p);
766 @@ -737,7 +742,7 @@ namespace {
767 const weight_vector_type &conflicts)
769 const unsigned m = DIV_ROUND_UP(conflicts.size, vector_width);
770 - vector_type s_p = {}, s_n = {};
771 + vector_type s_p = {0}, s_n = {0};
773 for (unsigned r = 0; r < m; r++) {
774 s_p = adds(s_p, mask(bank_mask_p.v[r], conflicts.v[r]));
777 [FILE:234:patches/patch-src_intel_isl_isl.h]
778 --- src/intel/isl/isl.h.orig 2023-10-04 13:53:02 UTC
779 +++ src/intel/isl/isl.h
781 #include "util/format/u_format.h"
785 +# define restrict __restrict__
792 [FILE:302:patches/patch-src_intel_tools_aubinator__error__decode.c]
793 # expose getline in FreeBSD's stdio.h
795 --- src/intel/tools/aubinator_error_decode.c.orig 2023-10-04 13:53:02 UTC
796 +++ src/intel/tools/aubinator_error_decode.c
802 +#define _WITH_GETLINE
809 [FILE:238:patches/patch-src_intel_tools_error2aub.c]
810 --- src/intel/tools/error2aub.c.orig 2023-10-04 13:53:02 UTC
811 +++ src/intel/tools/error2aub.c
817 +#define _WITH_GETLINE
821 #include <inttypes.h>
824 [FILE:328:patches/patch-src_util_build__id.c]
825 # Elf_ doesn't exist, use Elf32_ or Elf64_
827 --- src/util/build_id.c.orig 2023-10-04 13:53:02 UTC
828 +++ src/util/build_id.c
833 -#define ElfW(type) Elf_##type
835 +#define ElfW(type) Elf64_##type
837 +#define ElfW(type) Elf32_##type
841 struct build_id_note {
844 [FILE:235:patches/patch-src_util_libsync.h]
845 --- src/util/libsync.h.orig 2023-10-04 13:53:02 UTC
846 +++ src/util/libsync.h
852 +#include <sys/ioccom.h>
855 #if defined(__cplusplus)
860 [FILE:230:patches/patch-src_util_os__file.c]
861 --- src/util/os_file.c.orig 2023-10-04 13:53:02 UTC
862 +++ src/util/os_file.c
868 +#define ENODATA ENOATTR
872 os_file_create_unique(const char *filename, int filemode)
875 [FILE:592:patches/patch-src_util_os__memory__aligned.h]
876 --- src/util/os_memory_aligned.h.orig 2023-10-04 13:53:02 UTC
877 +++ src/util/os_memory_aligned.h
878 @@ -53,11 +53,16 @@ add_overflow_size_t(size_t a, size_t b,
880 os_malloc_aligned(size_t size, size_t alignment)
883 + alignment = (alignment + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
884 + return memalign(alignment, size);
887 alignment = (alignment + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
888 if(posix_memalign(&ptr, alignment, size) != 0)
894 #define os_free_aligned(_ptr) free(_ptr)
897 [FILE:853:patches/patch-src_util_strndup.h]
898 --- src/util/strndup.h.orig 2023-10-04 13:53:02 UTC
899 +++ src/util/strndup.h
905 +#if defined(_WIN32) || defined(__sun)
907 #include <stdlib.h> // size_t
909 @@ -34,6 +34,7 @@ extern "C" {
914 strndup(const char *str, size_t max)
917 @@ -50,6 +51,22 @@ strndup(const char *str, size_t max)
921 +#else // version without strnlen
922 +strndup(const char *str, size_t n)
929 + return (strdup(str));
930 + if ((copy = (char *)malloc(len + 1)) == NULL)
932 + memcpy(copy, str, len);
942 [FILE:430:patches/patch-src_util_u__atomic.h]
943 --- src/util/u_atomic.h.orig 2023-10-04 13:53:02 UTC
944 +++ src/util/u_atomic.h
946 * locally coded assembly, compiler intrinsic or ultimately a
947 * mutex-based implementation.
950 -#define PIPE_ATOMIC_OS_SOLARIS
951 -#elif defined(_MSC_VER)
952 -#define PIPE_ATOMIC_MSVC_INTRINSIC
953 -#elif defined(__GNUC__)
954 +#if defined(__GNUC__)
955 #define PIPE_ATOMIC_GCC_INTRINSIC
957 #error "Unsupported platform"
960 [FILE:188:patches/patch-src_util_u__math.h]
961 --- src/util/u_math.h.orig 2023-10-04 13:53:02 UTC
962 +++ src/util/u_math.h
970 #define M_SQRT2 1.41421356237309504880
973 [FILE:442:patches/patch-src_util_u__thread.h]
974 --- src/util/u_thread.h.orig 2023-10-04 13:53:02 UTC
975 +++ src/util/u_thread.h
977 * but not with __thread
979 #define __THREAD_INITIAL_EXEC __thread
980 -#elif defined(__GLIBC__)
981 +#elif defined(__GLIBC__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__MidnightBSD__)
982 #define __THREAD_INITIAL_EXEC thread_local __attribute__((tls_model("initial-exec")))
983 #define REALLY_INITIAL_EXEC
987 [FILE:458:files/01-freebsd.conf]
989 <device driver="iris">
990 <application name="kwin_x11" executable="kwin_x11">
991 <!-- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251836 -->
992 <option name="glx_extension_override" value="-GLX_EXT_buffer_age" />
993 <!-- https://gitlab.freedesktop.org/mesa/mesa/-/commit/580fbbb59a60 -->
994 <option name="glx_disable_ext_buffer_age" value="true" />
1000 [FILE:25:files/special.mk]
1001 GALLIUM_DRIVERS+= SWRAST
1004 [FILE:911:sunos/patch-src_gallium_targets_dri_meson.build]
1005 --- src/gallium/targets/dri/meson.build.orig 2020-12-31 03:59:58 UTC
1006 +++ src/gallium/targets/dri/meson.build
1007 @@ -45,11 +45,12 @@ libgallium_dri = shared_library(
1008 inc_gallium_winsys, include_directories('../../frontends/dri'),
1010 gnu_symbol_visibility : 'hidden',
1011 - link_args : [ld_args_build_id, ld_args_gc_sections, gallium_dri_ld_args],
1012 + link_args : [ld_args_gc_sections, gallium_dri_ld_args],
1013 link_depends : gallium_dri_link_depends,
1014 + link_whole : [libdri, libdricommon, libgallium, libr300, _libnir, libglsl, libglcpp], # libr600, libamd_common
1016 - libdri, libmesa_gallium, libdricommon, libmegadriver_stub, libgalliumvl,
1017 - libgallium, libglapi, libpipe_loader_static, libws_null, libwsw, libswdri,
1018 + libmesa_gallium, libmegadriver_stub, libgalliumvl,
1019 + libglapi, libpipe_loader_static, libws_null, libwsw, libswdri,
1025 [FILE:424:sunos/patch-src_gallium_targets_opencl_meson.build]
1026 --- src/gallium/targets/opencl/meson.build.orig 2021-01-29 18:33:19 UTC
1027 +++ src/gallium/targets/opencl/meson.build
1028 @@ -90,7 +90,7 @@ libopencl = shared_library(
1030 link_args : [ld_args_gc_sections, opencl_link_args],
1031 link_depends : opencl_link_deps,
1032 - link_whole : libclover,
1033 + link_whole : [libclover,libmesa_format],
1034 link_with : [libpipe_loader_dynamic, libgallium],
1039 [FILE:604:sunos/patch-src_gallium_targets_osmesa_meson.build]
1040 --- src/gallium/targets/osmesa/meson.build.orig 2020-12-31 03:59:58 UTC
1041 +++ src/gallium/targets/osmesa/meson.build
1042 @@ -49,9 +49,9 @@ libosmesa = shared_library(
1043 inc_gallium_drivers,
1045 link_depends : osmesa_link_deps,
1046 - link_whole : [libosmesa_st, libglapi_static],
1047 + link_whole : [libosmesa_st, libglapi_static, libsoftpipe, libgallium, _libnir, libglsl, libglcpp],
1049 - libmesa_gallium, libgallium, libws_null, osmesa_link_with,
1050 + libmesa_gallium, libws_null, osmesa_link_with,
1053 dep_ws2_32, dep_selinux, dep_thread, dep_clock, dep_unwind,
1056 [FILE:2062:sunos/patch-src_gallium_targets_pipe-loader_meson.build]
1057 --- src/gallium/targets/pipe-loader/meson.build.orig 2021-01-29 18:33:19 UTC
1058 +++ src/gallium/targets/pipe-loader/meson.build
1059 @@ -57,16 +57,16 @@ if with_gallium_v3d
1063 - [with_gallium_i915, 'i915', driver_i915, []],
1064 - [with_gallium_iris, 'iris', [driver_iris, idep_xmlconfig], []],
1065 - [with_gallium_nouveau, 'nouveau', driver_nouveau, []],
1066 - [with_gallium_r300, 'r300', driver_r300, []],
1067 - [with_gallium_r600, 'r600', driver_r600, []],
1068 - [with_gallium_radeonsi, 'radeonsi', [driver_radeonsi, idep_xmlconfig], []],
1069 - [with_gallium_freedreno, 'msm', driver_freedreno, []],
1070 - [with_gallium_kmsro, 'kmsro', _kmsro_targets, []],
1071 - [with_gallium_svga, 'vmwgfx', driver_svga, []],
1072 - [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, libws_null]],
1073 + [with_gallium_i915, 'i915', driver_i915, [], []],
1074 + [with_gallium_iris, 'iris', [driver_iris, idep_xmlconfig], [], []],
1075 + [with_gallium_nouveau, 'nouveau', driver_nouveau, [], []],
1076 + [with_gallium_r300, 'r300', driver_r300, [], [libr300,libradeonwinsys,libmesa_format]],
1077 + [with_gallium_r600, 'r600', driver_r600, [], [libr600,libradeonwinsys,libmesa_format,libgalliumvl]],
1078 + [with_gallium_radeonsi, 'radeonsi', [driver_radeonsi], [], [libradeonsi,libradeonwinsys,libamd_common,libamd_common_llvm,libmesa_format,_libxmlconfig,libgalliumvl]],
1079 + [with_gallium_freedreno, 'msm', driver_freedreno, [], []],
1080 + [with_gallium_kmsro, 'kmsro', _kmsro_targets, [], []],
1081 + [with_gallium_svga, 'vmwgfx', driver_svga, [], [libsvga,libsvgadrm,libmesa_format]],
1082 + [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, libws_null], [libllvmpipe,libmesa_format,libsoftpipe]],
1085 foreach x : pipe_loaders
1086 @@ -80,6 +80,7 @@ foreach x : pipe_loaders
1087 link_args : pipe_loader_link_args,
1088 link_depends : pipe_loader_link_deps,
1089 include_directories : pipe_loader_incs,
1090 + link_whole : [x[4]],
1091 link_with : [pipe_loader_link_with, x[3]],
1092 dependencies : [idep_mesautil, idep_nir, dep_thread, x[2]],
1096 [FILE:838:sunos/patch-src_gallium_targets_va_meson.build]
1097 --- src/gallium/targets/va/meson.build.orig 2021-01-29 18:33:19 UTC
1098 +++ src/gallium/targets/va/meson.build
1099 @@ -39,13 +39,14 @@ libva_gallium = shared_library(
1100 include_directories : [
1101 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1103 - link_whole : [libva_st],
1104 + link_whole : [libva_st, _libxmlconfig, libmesa_format, libloader, libpipe_loader_static],
1106 libgalliumvlwinsys, libgalliumvl, libgallium,
1107 - libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
1108 + libws_null, libwsw, libswdri, libswkmsdri,
1109 + libr600, libradeonsi,
1112 - dep_libdrm, driver_r600, driver_radeonsi, driver_nouveau,
1113 + dep_libdrm, driver_nouveau,
1116 link_depends : va_link_depends,
1119 [FILE:784:sunos/patch-src_gallium_targets_vdpau_meson.build]
1120 --- src/gallium/targets/vdpau/meson.build.orig 2020-12-31 03:59:58 UTC
1121 +++ src/gallium/targets/vdpau/meson.build
1122 @@ -44,10 +44,10 @@ libvdpau_gallium = shared_library(
1123 include_directories : [
1124 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1126 - link_whole : [libvdpau_st],
1127 + link_whole : [libvdpau_st, libr300, libradeonwinsys, libmesa_format, _libxmlconfig, libpipe_loader_static, libgallium, _libnir], # libr600, libradeonsi, libamd_common, libamd_common_llvm,
1129 libgalliumvlwinsys, libgalliumvl, libgallium,
1130 - libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
1131 + libws_null, libwsw, libswdri, libswkmsdri,
1137 [FILE:670:sunos/patch-src_gallium_targets_xa_meson.build]
1138 --- src/gallium/targets/xa/meson.build.orig 2020-12-31 03:59:58 UTC
1139 +++ src/gallium/targets/xa/meson.build
1140 @@ -40,9 +40,9 @@ libxatracker = shared_library(
1141 include_directories : [
1142 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1144 - link_whole : [libxa_st],
1145 + link_whole : [libxa_st, libsvga, libsvgadrm, libpipe_loader_static, libmesa_format, _libxmlconfig, libgallium, _libnir],
1147 - libgalliumvl_stub, libgallium, libpipe_loader_static,
1148 + libgalliumvl_stub, libgallium,
1149 libws_null, libwsw, libswdri, libswkmsdri,
1151 link_depends : xa_link_depends,
1154 [FILE:846:sunos/patch-src_gallium_targets_xvmc_meson.build]
1155 --- src/gallium/targets/xvmc/meson.build.orig 2021-01-29 18:33:19 UTC
1156 +++ src/gallium/targets/xvmc/meson.build
1157 @@ -39,12 +39,12 @@ libxvmc_gallium = shared_library(
1158 include_directories : [
1159 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1161 - link_whole : [libxvmc_st],
1162 + link_whole : [libxvmc_st,libradeonwinsys,libr600,_libxmlconfig,libmesa_format,libpipe_loader_static],
1164 libgalliumvlwinsys, libgalliumvl, libgallium,
1165 libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
1167 - dependencies : [idep_mesautil, driver_r600, driver_nouveau],
1168 + dependencies : [idep_mesautil, driver_nouveau],
1169 link_depends : xvmc_link_depends,
1170 # Will be deleted during installation, see install_megadrivers.py
1174 [FILE:510:sunos/patch-src_gbm_meson.build]
1175 --- src/gbm/meson.build.orig 2021-01-29 18:33:19 UTC
1176 +++ src/gbm/meson.build
1177 @@ -49,8 +49,8 @@ libgbm = shared_library(
1178 include_directories : incs_gbm,
1179 c_args : [args_gbm],
1180 link_args : [ld_args_gc_sections],
1181 - link_with : libloader,
1182 - dependencies : [deps_gbm, dep_dl, dep_thread, idep_mesautil, idep_xmlconfig],
1183 + link_with : [libloader, _libxmlconfig],
1184 + dependencies : [deps_gbm, dep_dl, dep_thread, idep_mesautil],
1185 gnu_symbol_visibility : 'hidden',
1190 [FILE:997:sunos/patch-src_mesa_drivers_dri_meson.build]
1191 --- src/mesa/drivers/dri/meson.build.orig 2020-12-31 03:59:58 UTC
1192 +++ src/mesa/drivers/dri/meson.build
1198 +_dri_drivers = [ _libnir, libmesa_classic, libmesa_common, libintel_compiler, libglcpp, libdricommon ]
1202 @@ -59,14 +59,13 @@ if _dri_drivers != []
1204 link_whole : _dri_drivers,
1206 - libmegadriver_stub, libdricommon, libglapi,
1208 + libmegadriver_stub, libglapi, libintel_dev,
1211 dep_selinux, dep_libdrm, dep_m, dep_thread, dep_dl,
1212 - idep_nir, idep_xmlconfig, idep_mesautil,
1213 + idep_xmlconfig, idep_mesautil,
1215 - link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections],
1216 + link_args : [ld_args_build_id, ld_args_gc_sections],
1217 # Will be deleted during installation, see install_megadrivers.py
1219 install_dir : dri_drivers_path,