Ravenports generated: 25 Mar 2021 02:50
[ravenports.git] / bucket_F0 / mesa
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               mesa
4 VERSION=                20.3.5
5 KEYWORDS=               graphics
6 VARIANTS=               standard
7 SDESC[standard]=        Mesa 3D Graphics Library
8 HOMEPAGE=               https://www.mesa3d.org/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            https://mesa.freedesktop.org/archive/
13                         ftp://ftp.freedesktop.org/pub/mesa/
14 DISTFILE[1]=            mesa-20.3.5.tar.xz:main
15 DF_INDEX=               1
16 SPKGS[standard]=        complete
17                         libs
18                         drivers
19
20 OPTIONS_AVAILABLE=      X86_DRIVERS ARM_DRIVERS LLVMPIPE WAYLAND
21 OPTIONS_STANDARD=       X86_DRIVERS ARM_DRIVERS LLVMPIPE
22 OPT_ON[freebsd]=        LLVMPIPE//i386|x86_64
23 OPT_ON[sunos]=          LLVMPIPE
24 OPT_ON[aarch64]=        ARM_DRIVERS
25 OPT_ON[linux]=          LLVMPIPE//i386|x86_64
26 OPT_ON[x86_64]=         X86_DRIVERS
27 OPT_ON[dragonfly]=      LLVMPIPE//i386|x86_64
28 OPT_ON[i386]=           X86_DRIVERS
29
30 BUILD_DEPENDS=          python-Mako:single:python_used
31                         libpthread-stubs:single:standard
32                         libelf:single:standard
33                         libvdpau:single:standard
34                         libva:single:standard
35 BUILDRUN_DEPENDS=       libdrm:single:standard
36 EXRUN[drivers]=         mesa:libs:standard
37                         libelf:single:standard
38
39 USES=                   cpe bison gettext-tools gmake meson pkgconfig zstd
40                         zlib expat shebangfix solaris-funcs python:build
41                         c++:libs,drivers
42 XORG_COMPONENTS=        x11 xdamage xext xfixes xshmfence xxf86vm xv xrandr
43                         xcb
44
45 LICENSE=                MIT:libs CUSTOM1:libs CUSTOM2:libs
46 LICENSE_NAME=           CUSTOM1:"Kronos License (MIT with modifications)"
47                         CUSTOM2:"SGI Free Software License B"
48 LICENSE_FILE=           MIT:{{WRKDIR}}/LICENSE_MIT
49                         CUSTOM1:{{WRKDIR}}/LICENSE_KHRONOS
50                         CUSTOM2:{{WRKDIR}}/LICENSE_SGI
51 LICENSE_AWK=            MIT:"^$$"
52                         CUSTOM2:"^$$"
53 LICENSE_SOURCE=         MIT:{{WRKSRC}}/include/GL/gl.h
54                         CUSTOM2:{{WRKSRC}}/src/glx/eval.c
55 LICENSE_SCHEME=         multi
56
57 CPE_VENDOR=             mesa3d
58 FPC_EQUIVALENT=         graphics/mesa-libs
59 MESON_ARGS=             -Dplatforms=x11{{WAYPLAT}}
60                         -Dzstd=enabled
61                         -Ddri3=true
62                         -Ddri-drivers={{DRI_DRIVERS:tW:tl:C/[[:space:]]/,/g}}
63                         -Dgallium-drivers={{GALLIUM_DRIVERS:tW:tl:C/[[:space:]]/,/g}}
64                         -Dgallium-vdpau=enabled
65                         -Dosmesa=gallium
66                         -Dlibunwind=false
67                         -Dgles1=disabled
68                         -Dvulkan-drivers={{VULKAN_DRIVERS:tW:tl:C/[[:space:]]/,/g}}
69 SHEBANG_FILES=          src/gallium/*/*/*.py
70                         src/gallium/tools/trace/*.py
71                         src/gallium/drivers/svga/svgadump/svga_dump.py
72                         src/mapi/glapi/gen/*.py
73                         src/mapi/mapi_abi.py
74                         src/mesa/main/get_*.py
75                         src/util/format_srgb.py
76                         src/amd/*/*.py
77                         src/intel/genxml/gen_pack_header.py
78 SHEBANG_OLD_PYTHON=     /usr/bin/env[[:space:]]python2
79                         /usr/bin/python2
80                         /bin/env[[:space:]]python
81 SOL_FUNCTIONS=          dirfd:src/util/disk_cache.c
82                         asprintf:src/util/anon_file.c
83                         asprintf:src/mesa/drivers/dri/common/megadriver_stub.c
84                         asprintf:src/loader/loader.c
85                         asprintf:src/egl/main/eglcurrent.c
86                         asprintf:src/util/u_string.h
87                         asprintf:src/amd/common/ac_rtld.c
88                         strnlen:src/util/ralloc.c
89                         strnlen:src/mesa/main/errors.c
90                         strndup:src/loader/loader.c
91                         strndup:src/egl/drivers/dri2/platform_x11.c
92                         strndup:src/gallium/drivers/r600/evergreen_compute.c
93                         strndup:src/gallium/drivers/radeonsi/si_debug.c
94
95 CONFIGURE_ENV=          ax_cv_check_cflags___Wno_initializer_overrides=no
96
97 INSTALL_TARGET=         install-strip
98 INSTALL_REQ_TOOLCHAIN=  yes
99
100 CFLAGS=                 -Wno-pointer-sign
101 VAR_OPSYS[sunos]=       CPPFLAGS=-D__EXTENSIONS__=1
102                         CPPFLAGS=-Wno-unused-function
103                         CXXFLAGS=-Drestrict=__restrict__
104                         CFLAGS=-D_POSIX_PTHREAD_SEMANTICS
105                         CFLAGS=-DF_DUPFD_CLOEXEC=F_DUPFD
106                         CFLAGS=-Wno-incompatible-pointer-types
107                         LDFLAGS=-lsocket
108                         LDFLAGS=-lnsl
109                         MAKEFILE_LINE=MESON_ARGS+=-Dshader-cache=false
110
111 [ARM_DRIVERS].DESCRIPTION=              Build drivers for aarch64 architecture
112 [ARM_DRIVERS].MAKEFILE_ON=              GALLIUM_DRIVERS+=FREEDRENO
113                                         GALLIUM_DRIVERS+=VC4
114
115 [X86_DRIVERS].DESCRIPTION=              Build drivers for i386 and x86_64 architectures
116 [X86_DRIVERS].MAKEFILE_ON=              DRI_DRIVERS+=R100
117                                         DRI_DRIVERS+=R200
118                                         DRI_DRIVERS+=I915
119                                         DRI_DRIVERS+=I965
120                                         GALLIUM_DRIVERS+=R300
121                                         GALLIUM_DRIVERS+=SVGA
122                                         GALLIUM_DRIVERS+={{GALLIUM_LLVM_DRIVERS}}
123                                         VULKAN_DRIVERS+={{VULKAN_DRIVERS_X86}}
124
125 [WAYLAND].DESCRIPTION=                  Build Vulkan drivers for Wayland platform
126 [WAYLAND].BUILDRUN_DEPENDS_ON=          wayland:primary:standard
127 [WAYLAND].BUILD_DEPENDS_ON=             wayland-protocols:single:standard
128                                         python-Mako:single:python_default
129 [WAYLAND].MAKEFILE_ON=                  WAYPLAT=,wayland
130                                         VULKAN_DRIVERS+=INTEL
131                                         VULKAN_DRIVERS_X86+=RADEON
132
133 [LLVMPIPE].DESCRIPTION=                 Build LLVM-based drivers and libraries
134 [LLVMPIPE].BUILDRUN_DEPENDS_ON=         llvm:single:standard
135                                         ocl-icd:primary:standard
136 [LLVMPIPE].BUILD_DEPENDS_ON=            libclc:single:standard
137                                         opencl-headers:single:standard
138 [LLVMPIPE].MAKEFILE_OFF=                MESON_ARGS+=-Dgallium-opencl=disabled
139 [LLVMPIPE].MAKEFILE_ON=                 GALLIUM_LLVM_DRIVERS+=R600
140                                         GALLIUM_LLVM_DRIVERS+=RADEONSI
141                                         MESON_ARGS+=-Dllvm=true
142                                         MESON_ARGS+=-Dgallium-xvmc=enabled
143                                         MESON_ARGS+=-Dgallium-va=enabled
144                                         MESON_ARGS+=-Dgallium-opencl=icd
145 [LLVMPIPE].RUN_DEPENDS_ON=              clang:dynlibs:standard
146 [LLVMPIPE].USES_ON=                     clang:keepcc
147 [LLVMPIPE].XORG_COMPONENTS_ON=          xvmc
148
149 post-patch:
150         ${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \
151                 ${WRKSRC}/src/util/xmlconfig.c
152
153 post-extract:
154         ${AWK} '/Copyright/,/DEALINGS/' ${WRKSRC}/include/GL/glext.h \
155                 > ${WRKDIR}/LICENSE_KHRONOS
156
157 [FILE:1198:descriptions/desc.libs]
158 The Mesa project began as an open-source implementation of the OpenGL
159 specification - a system for rendering interactive 3D graphics.
160
161 Over the years the project has grown to implement more graphics APIs,
162 including OpenGL ES (versions 1, 2, 3), OpenCL, OpenMAX, VDPAU, VA API,
163 XvMC and Vulkan.
164
165 A variety of device drivers allows the Mesa libraries to be used in many
166 different environments ranging from software emulation to complete
167 hardware acceleration for modern GPUs.
168
169 Mesa ties into several other open-source projects: the Direct Rendering
170 Infrastructure and X.org to provide OpenGL support on Linux, FreeBSD
171 and other operating systems.
172
173 This package contains the Mesa OpenGL libraries for GLX and EGL clients.
174 These include libOSMesa, libEGL, libGL, and libglesv2 as well as utility
175 libraries libglapi and gbm.  The OSMesa library is an Off-Screen version
176 of Mesa in order to do off-screen rendering in other packages like VTK.
177 Offscreen rendering is useful for a number of things, such as batch
178 processing, parallel processing, and remote processing.
179
180 This package also contains Mesa's libOpenCL implementation "Clover".  It is
181 built upon GALLIUM and currently only supports Radeon GPUs.
182
183
184 [FILE:162:descriptions/desc.drivers]
185 This package contains the Mesa OpenGL libraries for GLX and EGL clients.
186 These include libEGL, libGL, and libglesv2 as well as utlity libraries
187 libglapi and gbm.
188
189
190 [FILE:97:distinfo]
191 909a72df63dfa3c0844ccf44a26ac028d148297ed333ab51560893923d7691ce     14367412 mesa-20.3.5.tar.xz
192
193
194 [FILE:981:manifests/plist.libs]
195 %%LLVMPIPE-ON%%etc/OpenCL/vendors/mesa.icd
196 %%LLVMPIPE-ON%%lib/
197  libMesaOpenCL.so
198  libMesaOpenCL.so.1
199  libMesaOpenCL.so.1.0.0
200 %%LLVMPIPE-ON%%lib/gallium-pipe/
201  pipe_r300.so
202  pipe_r600.so
203  pipe_radeonsi.so
204  pipe_swrast.so
205  pipe_vmwgfx.so
206 include/
207  gbm.h
208  xa_composite.h
209  xa_context.h
210  xa_tracker.h
211 include/EGL/
212  egl.h
213  eglext.h
214  eglextchromium.h
215  eglmesaext.h
216  eglplatform.h
217 include/GL/
218  gl.h
219  glcorearb.h
220  glext.h
221  glx.h
222  glxext.h
223  osmesa.h
224 include/GLES2/
225  gl2.h
226  gl2ext.h
227  gl2platform.h
228 include/GLES3/
229  gl3.h
230  gl31.h
231  gl32.h
232  gl3ext.h
233  gl3platform.h
234 include/KHR/khrplatform.h
235 lib/
236  libEGL.so
237  libEGL.so.1
238  libEGL.so.1.0.0
239  libGL.so
240  libGL.so.1
241  libGL.so.1.2.0
242  libGLESv2.so
243  libGLESv2.so.2
244  libGLESv2.so.2.0.0
245  libOSMesa.so
246  libOSMesa.so.8
247  libOSMesa.so.8.0.0
248  libgbm.so
249  libgbm.so.1
250  libgbm.so.1.0.0
251  libglapi.so
252  libglapi.so.0
253  libglapi.so.0.0.0
254  libxatracker.so
255  libxatracker.so.2
256  libxatracker.so.2.5.0
257 lib/pkgconfig/
258  egl.pc
259  gbm.pc
260  gl.pc
261  glesv2.pc
262  osmesa.pc
263  xatracker.pc
264
265
266 [FILE:824:manifests/plist.drivers]
267 %%ARM_DRIVERS-ON%%lib/dri/
268  kgsl_dri.so
269  msm_dri.so
270  vc4_dri.so
271 %%LLVMPIPE-ON%%lib/
272  libXvMCr600.so
273  libXvMCr600.so.1
274  libXvMCr600.so.1.0
275  libXvMCr600.so.1.0.0
276 %%LLVMPIPE-ON%%lib/dri/
277  r600_dri.so
278  r600_drv_video.so
279  radeonsi_dri.so
280  radeonsi_drv_video.so
281 %%LLVMPIPE-ON%%lib/vdpau/
282  libvdpau_r600.so
283  libvdpau_r600.so.1
284  libvdpau_r600.so.1.0
285  libvdpau_r600.so.1.0.0
286  libvdpau_radeonsi.so
287  libvdpau_radeonsi.so.1
288  libvdpau_radeonsi.so.1.0
289  libvdpau_radeonsi.so.1.0.0
290 %%X86_DRIVERS-ON%%lib/dri/
291  i915_dri.so
292  i965_dri.so
293  r200_dri.so
294  r300_dri.so
295  radeon_dri.so
296  vmwgfx_dri.so
297 %%X86_DRIVERS-ON%%lib/vdpau/
298  libvdpau_r300.so
299  libvdpau_r300.so.1
300  libvdpau_r300.so.1.0
301  libvdpau_r300.so.1.0.0
302 include/GL/internal/dri_interface.h
303 lib/dri/
304  kms_swrast_dri.so
305  swrast_dri.so
306 lib/pkgconfig/dri.pc
307 share/drirc.d/00-mesa-defaults.conf
308
309
310 [FILE:511:patches/patch-include_GL_internal_dri__interface.h]
311 GCC on 9.x doesn't allow types to be overwritten, these types are defined
312 in drm.h also, which causes build issues in xorg-server.
313
314 --- include/GL/internal/dri_interface.h.orig    2021-03-24 19:10:48 UTC
315 +++ include/GL/internal/dri_interface.h
316 @@ -40,13 +40,7 @@
317  #ifndef DRI_INTERFACE_H
318  #define DRI_INTERFACE_H
319  
320 -#ifdef HAVE_LIBDRM
321  #include <drm.h>
322 -#else
323 -typedef unsigned int drm_context_t;
324 -typedef unsigned int drm_drawable_t;
325 -typedef struct drm_clip_rect drm_clip_rect_t;
326 -#endif
327  
328  #include <GL/gl.h>
329  
330
331
332 [FILE:227:patches/patch-src_amd_llvm_ac__llvm__build.h]
333 --- src/amd/llvm/ac_llvm_build.h.orig   2021-03-24 19:10:48 UTC
334 +++ src/amd/llvm/ac_llvm_build.h
335 @@ -34,6 +34,10 @@
336  
337  #include <stdbool.h>
338  
339 +#ifdef __sun
340 +#include <alloca.h>
341 +#endif
342 +
343  #ifdef __cplusplus
344  extern "C" {
345  #endif
346
347
348 [FILE:503:patches/patch-src_amd_vulkan_radv__device.c]
349 - Define CLOCK_MONOTONIC_RAW if missing
350
351 --- src/amd/vulkan/radv_device.c.orig   2021-03-24 19:10:48 UTC
352 +++ src/amd/vulkan/radv_device.c
353 @@ -105,6 +105,14 @@ static uint64_t radv_get_absolute_timeou
354         return current_time + timeout;
355  }
356  
357 +#ifndef CLOCK_MONOTONIC_RAW
358 +# ifdef CLOCK_MONOTONIC_FAST
359 +#  define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
360 +# else
361 +#  define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
362 +# endif
363 +#endif
364 +
365  static int
366  radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
367  {
368
369
370 [FILE:321:patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c]
371 - Define ETIME if missing
372
373 --- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig  2021-03-24 19:10:48 UTC
374 +++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
375 @@ -36,6 +36,9 @@
376  #include "radv_amdgpu_bo.h"
377  #include "sid.h"
378  
379 +#ifndef ETIME
380 +#define ETIME ETIMEDOUT
381 +#endif
382  
383  enum {
384         VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024
385
386
387 [FILE:557:patches/patch-src_egl_drivers_dri2_egl__dri2.c]
388 --- src/egl/drivers/dri2/egl_dri2.c.orig        2021-03-24 19:10:48 UTC
389 +++ src/egl/drivers/dri2/egl_dri2.c
390 @@ -1007,11 +1007,13 @@ dri2_setup_screen(_EGLDisplay *disp)
391               disp->Extensions.KHR_gl_texture_3D_image = EGL_TRUE;
392        }
393  #ifdef HAVE_LIBDRM
394 +# ifndef __DragonFly__
395        if (dri2_dpy->image->base.version >= 8 &&
396            dri2_dpy->image->createImageFromDmaBufs) {
397           disp->Extensions.EXT_image_dma_buf_import = EGL_TRUE;
398           disp->Extensions.EXT_image_dma_buf_import_modifiers = EGL_TRUE;
399        }
400 +# endif
401  #endif
402     }
403  
404
405
406 [FILE:790:patches/patch-src_egl_drivers_dri2_platform__wayland.c]
407 --- src/egl/drivers/dri2/platform_wayland.c.orig        2021-03-24 19:10:48 UTC
408 +++ src/egl/drivers/dri2/platform_wayland.c
409 @@ -1346,6 +1346,7 @@ registry_handle_global_drm(void *data, s
410        dri2_dpy->wl_drm =
411           wl_registry_bind(registry, name, &wl_drm_interface, MIN2(version, 2));
412        wl_drm_add_listener(dri2_dpy->wl_drm, &drm_listener, dri2_dpy);
413 +#ifndef __DragonFly__
414     } else if (strcmp(interface, "zwp_linux_dmabuf_v1") == 0 && version >= 3) {
415        dri2_dpy->wl_dmabuf =
416           wl_registry_bind(registry, name, &zwp_linux_dmabuf_v1_interface,
417 @@ -1353,6 +1354,7 @@ registry_handle_global_drm(void *data, s
418        zwp_linux_dmabuf_v1_add_listener(dri2_dpy->wl_dmabuf, &dmabuf_listener,
419                                         dri2_dpy);
420     }
421 +#endif
422  }
423  
424  static void
425
426
427 [FILE:352:patches/patch-src_egl_main_eglglobals.c]
428 --- src/egl/main/eglglobals.c.orig      2021-03-24 19:10:48 UTC
429 +++ src/egl/main/eglglobals.c
430 @@ -135,7 +135,7 @@ _eglPointerIsDereferencable(void *p)
431  {
432     uintptr_t addr = (uintptr_t) p;
433     const long page_size = getpagesize();
434 -#ifdef HAVE_MINCORE
435 +#if defined(HAVE_MINCORE) && !defined(__DragonFly__)
436     unsigned char valid = 0;
437  
438     if (p == NULL)
439
440
441 [FILE:3256:patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c]
442 Revert the following commit.
443
444 FreeBSD and DragonFly don't have the required render nodes.
445
446 -------
447
448 From 69a1b9959e59653da262185c4e2cf57d24939b19 Mon Sep 17 00:00:00 2001
449 From: Emil Velikov <emil.l.velikov@gmail.com>
450 Date: Mon, 29 Jun 2015 12:36:45 +0100
451 Subject: pipe-loader: drop support for non-render node devices
452
453 Render nodes have been around for quite some time. Removing support via
454 the master/primary node allows us to clean up the conditional
455 compilation and simplify the build greatly.
456
457 For example currently we the pipe-loader, which explicitly links against
458 xcb and friends (for X auth) if found at compile-time. That
459 would cause problems as one will be forced to use X/xcb, even if it's a
460 headless system that is used for opencl.
461
462 v2: Clarify the linking topic in the commit message.
463
464 Cc: Tom Stellard <thomas.stellard@amd.com>
465 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
466 Reviewed-by: Francisco Jerez <currojerez@riseup.net>
467
468
469 --- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig    2021-03-24 19:10:48 UTC
470 +++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
471 @@ -193,6 +193,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa
472  }
473  
474  static int
475 +open_drm_minor(int minor)
476 +{
477 +   char path[PATH_MAX];
478 +   snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor);
479 +   return open(path, O_RDWR, 0);
480 +}
481 +
482 +static int
483  open_drm_render_node_minor(int minor)
484  {
485     char path[PATH_MAX];
486 @@ -204,8 +212,15 @@ open_drm_render_node_minor(int minor)
487  int
488  pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
489  {
490 -   int i, j, fd;
491 +   int i, k, fd, num_render_node_devs;
492 +   int j = 0;
493 +
494 +   struct {
495 +      unsigned vendor_id;
496 +      unsigned chip_id;
497 +   } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
498  
499 +   /* Look for render nodes first */
500     for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
501          i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
502        struct pipe_loader_device *dev;
503 @@ -219,6 +234,9 @@ pipe_loader_drm_probe(struct pipe_loader
504           continue;
505        }
506  
507 +      render_node_devs[j].vendor_id = dev->u.pci.vendor_id;
508 +      render_node_devs[j].chip_id = dev->u.pci.chip_id;
509 +
510        if (j < ndev) {
511           devs[j] = dev;
512        } else {
513 @@ -228,6 +246,46 @@ pipe_loader_drm_probe(struct pipe_loader
514        j++;
515     }
516  
517 +   num_render_node_devs = j;
518 +
519 +   /* Next look for drm devices. */
520 +   for (i = 0; i < DRM_MAX_MINOR; i++) {
521 +      struct pipe_loader_device *dev;
522 +      boolean duplicate = FALSE;
523 +      fd = open_drm_minor(i);
524 +      if (fd < 0)
525 +         continue;
526 +
527 +      if (!pipe_loader_drm_probe_fd(&dev, fd)) {
528 +         close(fd);
529 +         continue;
530 +      }
531 +
532 +      /* Check to make sure we aren't already accessing this device via
533 +       * render nodes.
534 +       */
535 +      for (k = 0; k < num_render_node_devs; k++) {
536 +         if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id &&
537 +             dev->u.pci.chip_id == render_node_devs[k].chip_id) {
538 +            close(fd);
539 +            dev->ops->release(&dev);
540 +            duplicate = TRUE;
541 +            break;
542 +         }
543 +      }
544 +
545 +      if (duplicate)
546 +         continue;
547 +
548 +      if (j < ndev) {
549 +         devs[j] = dev;
550 +      } else {
551 +         dev->ops->release(&dev);
552 +      }
553 +
554 +      j++;
555 +   }
556 +
557     return j;
558  }
559  
560
561
562 [FILE:271:patches/patch-src_gallium_auxiliary_rbug_rbug__texture.c]
563 --- src/gallium/auxiliary/rbug/rbug_texture.c.orig      2021-03-24 19:10:48 UTC
564 +++ src/gallium/auxiliary/rbug/rbug_texture.c
565 @@ -36,6 +36,10 @@
566  
567  #include "c99_alloca.h"
568  
569 +#ifdef __sun
570 +#include <alloca.h>
571 +#endif
572 +
573  #include "rbug_internal.h"
574  #include "rbug_texture.h"
575  
576
577
578 [FILE:326:patches/patch-src_gallium_auxiliary_renderonly_renderonly.c]
579 --- src/gallium/auxiliary/renderonly/renderonly.c.orig  2021-03-24 19:10:48 UTC
580 +++ src/gallium/auxiliary/renderonly/renderonly.c
581 @@ -37,6 +37,10 @@
582  #include "util/u_inlines.h"
583  #include "util/u_memory.h"
584  
585 +#ifndef O_CLOEXEC
586 +#define O_CLOEXEC      0
587 +#endif
588 +
589  struct renderonly *
590  renderonly_dup(const struct renderonly *ro)
591  {
592
593
594 [FILE:544:patches/patch-src_gallium_drivers_radeonsi_si__state__shaders.c]
595 --- src/gallium/drivers/radeonsi/si_state_shaders.c.orig        2021-03-24 19:10:48 UTC
596 +++ src/gallium/drivers/radeonsi/si_state_shaders.c
597 @@ -2093,6 +2093,7 @@ static void si_build_shader_variant(stru
598        return;
599     }
600  
601 +#ifndef __sun
602     if (shader->compiler_ctx_state.is_debug_context) {
603        FILE *f = open_memstream(&shader->shader_log, &shader->shader_log_size);
604        if (f) {
605 @@ -2100,6 +2101,7 @@ static void si_build_shader_variant(stru
606           fclose(f);
607        }
608     }
609 +#endif
610  
611     si_shader_init_pm4_state(sscreen, shader);
612  }
613
614
615 [FILE:360:patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c]
616 # define ETIME as ETIMEOUT same as in intel driver
617 #
618 --- src/gallium/drivers/vc4/vc4_bufmgr.c.orig   2021-03-24 19:10:48 UTC
619 +++ src/gallium/drivers/vc4/vc4_bufmgr.c
620 @@ -27,6 +27,9 @@
621  #include <fcntl.h>
622  #include <xf86drm.h>
623  #include <xf86drmMode.h>
624 +#ifndef ETIME
625 +#define ETIME ETIMEDOUT
626 +#endif
627  
628  #include "util/u_hash_table.h"
629  #include "util/u_memory.h"
630
631
632 [FILE:420:patches/patch-src_gallium_frontends_clover_api_memory.cpp]
633 --- src/gallium/frontends/clover/api/memory.cpp.orig    2021-03-24 19:10:48 UTC
634 +++ src/gallium/frontends/clover/api/memory.cpp
635 @@ -457,7 +457,11 @@ clSVMAlloc(cl_context d_ctx,
636        void *ptr = nullptr;
637        if (alignment < sizeof(void*))
638           alignment = sizeof(void*);
639 +#ifdef __sun
640 +      ptr = memalign(alignment, size);
641 +#else
642        posix_memalign(&ptr, alignment, size);
643 +#endif
644        return ptr;
645     }
646  
647
648
649 [FILE:292:patches/patch-src_gallium_winsys_amdgpu_drm_amdgpu__cs.c]
650 --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c.orig      2021-03-24 19:10:48 UTC
651 +++ src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
652 @@ -33,6 +33,10 @@
653  
654  #include "amd/common/sid.h"
655  
656 +#ifdef __sun__
657 +#include <alloca.h>
658 +#endif
659 +
660  DEBUG_GET_ONCE_BOOL_OPTION(noop, "RADEON_NOOP", false)
661  
662  /* FENCES */
663
664
665 [FILE:575:patches/patch-src_glx_glxext.c]
666 # work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
667 #
668 --- src/glx/glxext.c.orig       2021-03-24 19:10:48 UTC
669 +++ src/glx/glxext.c
670 @@ -923,6 +923,9 @@ __glXInitialize(Display * dpy)
671  #if defined(GLX_USE_DRM)
672     if (glx_direct && glx_accel) {
673  #if defined(HAVE_DRI3)
674 +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)
675 +      if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false))
676 +#endif
677        if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
678           dpyPriv->dri3Display = dri3_create_display(dpy);
679  #endif /* HAVE_DRI3 */
680
681
682 [FILE:318:patches/patch-src_glx_meson.build]
683 --- src/glx/meson.build.orig    2021-03-24 19:10:48 UTC
684 +++ src/glx/meson.build
685 @@ -145,7 +145,7 @@ libglx = static_library(
686      extra_libs_libglx,
687    ],
688    dependencies : [
689 -    idep_mesautil, idep_xmlconfig,
690 +    idep_xmlconfig, idep_mesautil,
691      dep_libdrm, dep_dri2proto, dep_glproto, dep_x11, dep_glvnd,
692    ],
693  )
694
695
696 [FILE:1014:patches/patch-src_intel_compiler_brw__eu__validate.c]
697 --- src/intel/compiler/brw_eu_validate.c.orig   2021-03-24 19:10:48 UTC
698 +++ src/intel/compiler/brw_eu_validate.c
699 @@ -41,6 +41,39 @@
700  #include <stdlib.h>
701  #include "brw_eu.h"
702  
703 +#ifdef __sun__
704 +#include <string.h>
705 +
706 +static void *
707 +memmem(const void *l, size_t l_len, const void *s, size_t s_len)
708 +{
709 +       char *cur, *last;
710 +       const char *cl = (const char *)l;
711 +       const char *cs = (const char *)s;
712 +
713 +       /* we need something to compare */
714 +       if (l_len == 0 || s_len == 0)
715 +               return NULL;
716 +
717 +       /* "s" must be smaller or equal to "l" */
718 +       if (l_len < s_len)
719 +               return NULL;
720 +
721 +       /* special case where s_len == 1 */
722 +       if (s_len == 1)
723 +               return memchr(l, (int)*cs, l_len);
724 +
725 +       /* the last position where its possible to find "s" in "l" */
726 +       last = (char *)cl + l_len - s_len;
727 +
728 +       for (cur = (char *)cl; cur <= last; cur++)
729 +               if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0)
730 +                       return cur;
731 +
732 +       return NULL;
733 +}
734 +#endif
735 +
736  /* We're going to do lots of string concatenation, so this should help. */
737  struct string {
738     char *str;
739
740
741 [FILE:954:patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp]
742 --- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig   2021-03-24 19:10:48 UTC
743 +++ src/intel/compiler/brw_fs_bank_conflicts.cpp
744 @@ -309,8 +309,13 @@ namespace {
745           const unsigned align = MAX2(sizeof(void *), __alignof__(vector_type));
746           const unsigned size = DIV_ROUND_UP(n, vector_width) * sizeof(vector_type);
747           void *p;
748 +#ifdef __sun
749 +       p = memalign(align, size);
750 +       if (p == NULL) return NULL;
751 +#else
752           if (posix_memalign(&p, align, size))
753              return NULL;
754 +#endif
755           memset(p, 0, size);
756           return reinterpret_cast<vector_type *>(p);
757        }
758 @@ -736,7 +741,7 @@ namespace {
759                     const weight_vector_type &conflicts)
760     {
761        const unsigned m = DIV_ROUND_UP(conflicts.size, vector_width);
762 -      vector_type s_p = {}, s_n = {};
763 +      vector_type s_p = {0}, s_n = {0};
764  
765        for (unsigned r = 0; r < m; r++) {
766           s_p = adds(s_p, mask(bank_mask_p.v[r], conflicts.v[r]));
767
768
769 [FILE:234:patches/patch-src_intel_isl_isl.h]
770 --- src/intel/isl/isl.h.orig    2021-03-24 19:10:48 UTC
771 +++ src/intel/isl/isl.h
772 @@ -47,6 +47,9 @@
773  #include "util/format/u_format.h"
774  
775  #ifdef __cplusplus
776 +# ifdef __sun__
777 +# define restrict      __restrict__
778 +# endif
779  extern "C" {
780  #endif
781  
782
783
784 [FILE:302:patches/patch-src_intel_tools_aubinator__error__decode.c]
785 # expose getline in FreeBSD's stdio.h
786 #
787 --- src/intel/tools/aubinator_error_decode.c.orig       2021-03-24 19:10:48 UTC
788 +++ src/intel/tools/aubinator_error_decode.c
789 @@ -22,6 +22,9 @@
790   *
791   */
792  
793 +#ifdef __FreeBSD__
794 +#define _WITH_GETLINE
795 +#endif
796  #include <stdbool.h>
797  #include <stdio.h>
798  #include <stdlib.h>
799
800
801 [FILE:238:patches/patch-src_intel_tools_error2aub.c]
802 --- src/intel/tools/error2aub.c.orig    2021-03-24 19:10:48 UTC
803 +++ src/intel/tools/error2aub.c
804 @@ -22,6 +22,9 @@
805   *
806   */
807  
808 +#ifdef __FreeBSD__
809 +#define _WITH_GETLINE
810 +#endif
811  #include <assert.h>
812  #include <getopt.h>
813  #include <inttypes.h>
814
815
816 [FILE:936:patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c]
817 --- src/mesa/drivers/dri/i965/brw_bufmgr.c.orig 2021-03-24 19:10:49 UTC
818 +++ src/mesa/drivers/dri/i965/brw_bufmgr.c
819 @@ -85,6 +85,10 @@
820  } while (0)
821  
822  
823 +#ifndef O_CLOEXEC
824 +#define O_CLOEXEC      0
825 +#endif
826 +
827  /* VALGRIND_FREELIKE_BLOCK unfortunately does not actually undo the earlier
828   * VALGRIND_MALLOCLIKE_BLOCK but instead leaves vg convinced the memory is
829   * leaked. All because it does not call VG(cli_free) from its
830 @@ -1887,8 +1891,12 @@ brw_bufmgr_create(struct gen_device_info
831        bufmgr->initial_kflags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
832  
833        /* Allocate VMA in userspace if we have softpin and full PPGTT. */
834 +#ifdef __DragonFly__
835 +      if (false) {
836 +#else
837        if (gem_param(fd, I915_PARAM_HAS_EXEC_SOFTPIN) > 0 &&
838            gem_param(fd, I915_PARAM_HAS_ALIASING_PPGTT) > 1) {
839 +#endif
840           bufmgr->initial_kflags |= EXEC_OBJECT_PINNED;
841  
842           util_vma_heap_init(&bufmgr->vma_allocator[BRW_MEMZONE_LOW_4G],
843
844
845 [FILE:710:patches/patch-src_mesa_drivers_dri_i965_brw__disk__cache.c]
846 --- src/mesa/drivers/dri/i965/brw_disk_cache.c.orig     2021-03-24 19:10:49 UTC
847 +++ src/mesa/drivers/dri/i965/brw_disk_cache.c
848 @@ -394,6 +394,7 @@ brw_disk_cache_init(struct intel_screen
849     if (INTEL_DEBUG & DEBUG_DISK_CACHE_DISABLE_MASK)
850        return;
851  
852 +# ifdef HAVE_DL_ITERATE_PHDR
853     /* array length: print length + null char + 1 extra to verify it is unused */
854     char renderer[11];
855     ASSERTED int len = snprintf(renderer, sizeof(renderer), "i965_%04x",
856 @@ -413,5 +414,6 @@ brw_disk_cache_init(struct intel_screen
857     const uint64_t driver_flags =
858        brw_get_compiler_config_value(screen->compiler);
859     screen->disk_cache = disk_cache_create(renderer, timestamp, driver_flags);
860 +# endif
861  #endif
862  }
863
864
865 [FILE:851:patches/patch-src_mesa_drivers_dri_i965_brw__program__binary.c]
866 --- src/mesa/drivers/dri/i965/brw_program_binary.c.orig 2021-03-24 19:10:49 UTC
867 +++ src/mesa/drivers/dri/i965/brw_program_binary.c
868 @@ -36,9 +36,11 @@ static uint8_t driver_sha1[20];
869  void
870  brw_program_binary_init(unsigned device_id)
871  {
872 +#ifdef HAVE_DL_ITERATE_PHDR
873     const struct build_id_note *note =
874        build_id_find_nhdr_for_addr(brw_program_binary_init);
875     assert(note);
876 +#endif
877  
878     /**
879      * With Mesa's megadrivers, taking the sha1 of i965_dri.so may not be
880 @@ -52,7 +54,9 @@ brw_program_binary_init(unsigned device_
881     int len = snprintf(renderer, sizeof(renderer), "i965_%04x", device_id);
882     assert(len == sizeof(renderer) - 1);
883     _mesa_sha1_update(&ctx, renderer, len);
884 +#ifdef HAVE_DL_ITERATE_PHDR
885     _mesa_sha1_update(&ctx, build_id_data(note), build_id_length(note));
886 +#endif
887     _mesa_sha1_final(&ctx, driver_sha1);
888  }
889  
890
891
892 [FILE:328:patches/patch-src_util_build__id.c]
893 # Elf_ doesn't exist, use Elf32_ or Elf64_
894 #
895 --- src/util/build_id.c.orig    2021-03-24 19:10:49 UTC
896 +++ src/util/build_id.c
897 @@ -35,7 +35,11 @@
898  #endif
899  
900  #ifndef ElfW
901 -#define ElfW(type) Elf_##type
902 +#ifdef __LP64__
903 +#define ElfW(type) Elf64_##type
904 +#else
905 +#define ElfW(type) Elf32_##type
906 +#endif
907  #endif
908  
909  struct build_id_note {
910
911
912 [FILE:422:patches/patch-src_util_compiler.h]
913 --- src/util/compiler.h.orig    2021-03-24 19:10:49 UTC
914 +++ src/util/compiler.h
915 @@ -51,6 +51,9 @@
916  #if defined(__linux__)
917  #include <byteswap.h>
918  #define CPU_TO_LE32( x )       bswap_32( x )
919 +#elif defined(__FreeBSD__) || defined(__DragonFly__)
920 +#include <sys/endian.h>
921 +#define CPU_TO_LE32( x )       bswap32( x )
922  #elif defined(__APPLE__)
923  #include <CoreFoundation/CFByteOrder.h>
924  #define CPU_TO_LE32( x )       CFSwapInt32HostToLittle( x )
925
926
927 [FILE:1512:patches/patch-src_util_futex.h]
928 - Implement futex_wake() and futex_wait() via _umtx_op()
929
930 --- src/util/futex.h.orig       2021-03-24 19:10:49 UTC
931 +++ src/util/futex.h
932 @@ -30,10 +30,35 @@
933  #include <limits.h>
934  #include <stdint.h>
935  #include <unistd.h>
936 +#if defined(__FreeBSD__)
937 +#include <errno.h>
938 +# if __FreeBSD__ < 11
939 +#  include <machine/atomic.h>
940 +# endif
941 +#include <sys/umtx.h>
942 +#else
943  #include <linux/futex.h>
944  #include <sys/syscall.h>
945 +#endif
946  #include <sys/time.h>
947  
948 +#if defined(__FreeBSD__)
949 +static inline int futex_wake(uint32_t *addr, int count)
950 +{
951 +   return _umtx_op(addr, UMTX_OP_WAKE, (uint32_t)count, NULL, NULL) == -1 ? errno : 0;
952 +}
953 +
954 +static inline int futex_wait(uint32_t *addr, int32_t value, struct timespec *timeout)
955 +{
956 +   void *uaddr = NULL, *uaddr2 = NULL;
957 +   if (timeout != NULL) {
958 +      const struct _umtx_time tmo = { ._timeout = *timeout, ._flags = UMTX_ABSTIME, ._clockid = CLOCK_MONOTONIC };
959 +      uaddr = (void *)(uintptr_t)sizeof(tmo);
960 +      uaddr2 = (void *)&tmo;
961 +   }
962 +   return _umtx_op(addr, UMTX_OP_WAIT_UINT, (uint32_t)value, uaddr, uaddr2) == -1 ? errno : 0;
963 +}
964 +#else
965  static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3)
966  {
967     return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
968 @@ -51,6 +76,7 @@ static inline int futex_wait(uint32_t *a
969     return sys_futex(addr, FUTEX_WAIT_BITSET, value, timeout, NULL,
970                      FUTEX_BITSET_MATCH_ANY);
971  }
972 +#endif
973  
974  #elif defined(__FreeBSD__)
975  #define UTIL_FUTEX_SUPPORTED 1
976
977
978 [FILE:310:patches/patch-src_util_memstream.c]
979 --- src/util/memstream.c.orig   2021-03-24 19:10:49 UTC
980 +++ src/util/memstream.c
981 @@ -51,7 +51,7 @@ u_memstream_open(struct u_memstream *mem
982     }
983  
984     return success;
985 -#elif defined(__APPLE__)
986 +#elif defined(__APPLE__) || defined(__sun)
987     return false;
988  #else
989     FILE *const f = open_memstream(bufp, sizep);
990
991
992 [FILE:592:patches/patch-src_util_os__memory__aligned.h]
993 --- src/util/os_memory_aligned.h.orig   2021-03-24 19:10:49 UTC
994 +++ src/util/os_memory_aligned.h
995 @@ -53,11 +53,16 @@ add_overflow_size_t(size_t a, size_t b,
996  static inline void *
997  os_malloc_aligned(size_t size, size_t alignment)
998  {
999 +#ifdef __sun__
1000 +   alignment = (alignment + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
1001 +   return memalign(alignment, size);
1002 +#else
1003     void *ptr;
1004     alignment = (alignment + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
1005     if(posix_memalign(&ptr, alignment, size) != 0)
1006        return NULL;
1007     return ptr;
1008 +#endif
1009  }
1010  
1011  #define os_free_aligned(_ptr) free(_ptr)
1012
1013
1014 [FILE:853:patches/patch-src_util_strndup.h]
1015 --- src/util/strndup.h.orig     2021-03-24 19:10:49 UTC
1016 +++ src/util/strndup.h
1017 @@ -24,7 +24,7 @@
1018  #ifndef STRNDUP_H
1019  #define STRNDUP_H
1020  
1021 -#if defined(_WIN32)
1022 +#if defined(_WIN32) || defined(__sun)
1023  
1024  #include <stdlib.h> // size_t
1025  #include <string.h>
1026 @@ -34,6 +34,7 @@ extern "C" {
1027  #endif
1028  
1029  static inline char *
1030 +#if defined(_WIN32)
1031  strndup(const char *str, size_t max)
1032  {
1033     size_t n;
1034 @@ -50,6 +51,22 @@ strndup(const char *str, size_t max)
1035     memcpy(ptr, str, n);
1036     return ptr;
1037  }
1038 +#else  // version without strnlen
1039 +strndup(const char *str, size_t n)
1040 +{
1041 +    size_t len;
1042 +    char *copy;
1043 +
1044 +    len = strlen(str);
1045 +    if (len <= n)
1046 +        return (strdup(str));
1047 +    if ((copy = (char *)malloc(len + 1)) == NULL)
1048 +        return (NULL);
1049 +    memcpy(copy, str, len);
1050 +    copy[len] = '\0';
1051 +    return (copy);
1052 +}
1053 +#endif
1054  
1055  #ifdef __cplusplus
1056  }
1057
1058
1059 [FILE:430:patches/patch-src_util_u__atomic.h]
1060 --- src/util/u_atomic.h.orig    2021-03-24 19:10:49 UTC
1061 +++ src/util/u_atomic.h
1062 @@ -20,11 +20,7 @@
1063   * locally coded assembly, compiler intrinsic or ultimately a
1064   * mutex-based implementation.
1065   */
1066 -#if defined(__sun)
1067 -#define PIPE_ATOMIC_OS_SOLARIS
1068 -#elif defined(_MSC_VER)
1069 -#define PIPE_ATOMIC_MSVC_INTRINSIC
1070 -#elif defined(__GNUC__)
1071 +#if defined(__GNUC__)
1072  #define PIPE_ATOMIC_GCC_INTRINSIC
1073  #else
1074  #error "Unsupported platform"
1075
1076
1077 [FILE:188:patches/patch-src_util_u__math.h]
1078 --- src/util/u_math.h.orig      2021-03-24 19:10:49 UTC
1079 +++ src/util/u_math.h
1080 @@ -51,6 +51,7 @@
1081  extern "C" {
1082  #endif
1083  
1084 +#undef ALIGN
1085  
1086  #ifndef M_SQRT2
1087  #define M_SQRT2 1.41421356237309504880
1088
1089
1090 [FILE:1328:patches/patch-src_util_u__thread.h]
1091 --- src/util/u_thread.h.orig    2021-03-24 19:10:49 UTC
1092 +++ src/util/u_thread.h
1093 @@ -39,6 +39,7 @@
1094  #include <signal.h>
1095  #ifdef HAVE_PTHREAD_NP_H
1096  #include <pthread_np.h>
1097 +#undef ALIGN
1098  #endif
1099  #endif
1100  
1101 @@ -103,9 +104,9 @@ static inline thrd_t u_thread_create(int
1102  static inline void u_thread_setname( const char *name )
1103  {
1104  #if defined(HAVE_PTHREAD)
1105 -#if DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS
1106 +#if DETECT_OS_LINUX || DETECT_OS_CYGWIN
1107     pthread_setname_np(pthread_self(), name);
1108 -#elif DETECT_OS_FREEBSD || DETECT_OS_OPENBSD
1109 +#elif DETECT_OS_FREEBSD || DETECT_OS_OPENBSD || DETECT_OS_DRAGONFLY
1110     pthread_set_name_np(pthread_self(), name);
1111  #elif DETECT_OS_NETBSD
1112     pthread_setname_np(pthread_self(), "%s", (void *)name);
1113 @@ -113,8 +114,6 @@ static inline void u_thread_setname( con
1114     pthread_setname_np(name);
1115  #elif DETECT_OS_HAIKU
1116     rename_thread(find_thread(NULL), name);
1117 -#else
1118 -#warning Not sure how to call pthread_setname_np
1119  #endif
1120  #endif
1121     (void)name;
1122 @@ -208,7 +207,7 @@ util_set_current_thread_affinity(const u
1123  static inline int64_t
1124  util_thread_get_time_nano(thrd_t thread)
1125  {
1126 -#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__)
1127 +#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__) && !defined(__sun)
1128     struct timespec ts;
1129     clockid_t cid;
1130  
1131
1132
1133 [FILE:25:files/special.mk]
1134 GALLIUM_DRIVERS+=       SWRAST
1135
1136
1137 [FILE:891:sunos/patch-src_gallium_targets_dri_meson.build]
1138 --- src/gallium/targets/dri/meson.build.orig    2020-12-31 03:59:58 UTC
1139 +++ src/gallium/targets/dri/meson.build
1140 @@ -45,11 +45,12 @@ libgallium_dri = shared_library(
1141      inc_gallium_winsys, include_directories('../../frontends/dri'),
1142    ],
1143    gnu_symbol_visibility : 'hidden',
1144 -  link_args : [ld_args_build_id, ld_args_gc_sections, gallium_dri_ld_args],
1145 +  link_args : [ld_args_gc_sections, gallium_dri_ld_args],
1146    link_depends : gallium_dri_link_depends,
1147 +  link_whole : [libdri, libdricommon, libgallium, libr300, libr600, _libnir, libamd_common],
1148    link_with : [
1149 -    libdri, libmesa_gallium, libdricommon, libmegadriver_stub, libgalliumvl,
1150 -    libgallium, libglapi, libpipe_loader_static, libws_null, libwsw, libswdri,
1151 +    libmesa_gallium, libmegadriver_stub, libgalliumvl,
1152 +    libglapi, libpipe_loader_static, libws_null, libwsw, libswdri,
1153      libswkmsdri,
1154    ],
1155    dependencies : [
1156
1157
1158 [FILE:424:sunos/patch-src_gallium_targets_opencl_meson.build]
1159 --- src/gallium/targets/opencl/meson.build.orig 2021-01-29 18:33:19 UTC
1160 +++ src/gallium/targets/opencl/meson.build
1161 @@ -90,7 +90,7 @@ libopencl = shared_library(
1162    [],
1163    link_args : [ld_args_gc_sections, opencl_link_args],
1164    link_depends : opencl_link_deps,
1165 -  link_whole : libclover,
1166 +  link_whole : [libclover,libmesa_format],
1167    link_with : [libpipe_loader_dynamic, libgallium],
1168    dependencies : [
1169      idep_mesautil,
1170
1171
1172 [FILE:585:sunos/patch-src_gallium_targets_osmesa_meson.build]
1173 --- src/gallium/targets/osmesa/meson.build.orig 2020-12-31 03:59:58 UTC
1174 +++ src/gallium/targets/osmesa/meson.build
1175 @@ -49,9 +49,9 @@ libosmesa = shared_library(
1176      inc_gallium_drivers,
1177    ],
1178    link_depends : osmesa_link_deps,
1179 -  link_whole : [libosmesa_st, libglapi_static],
1180 +  link_whole : [libosmesa_st, libglapi_static, libsoftpipe, libgallium, _libnir],
1181    link_with : [
1182 -    libmesa_gallium, libgallium, libws_null, osmesa_link_with,
1183 +    libmesa_gallium, libws_null, osmesa_link_with,
1184    ],
1185    dependencies : [
1186      dep_ws2_32, dep_selinux, dep_thread, dep_clock, dep_unwind,
1187
1188
1189 [FILE:2062:sunos/patch-src_gallium_targets_pipe-loader_meson.build]
1190 --- src/gallium/targets/pipe-loader/meson.build.orig    2021-01-29 18:33:19 UTC
1191 +++ src/gallium/targets/pipe-loader/meson.build
1192 @@ -57,16 +57,16 @@ if with_gallium_v3d
1193  endif
1194  
1195  pipe_loaders = [
1196 -  [with_gallium_i915, 'i915', driver_i915, []],
1197 -  [with_gallium_iris, 'iris', [driver_iris, idep_xmlconfig], []],
1198 -  [with_gallium_nouveau, 'nouveau', driver_nouveau, []],
1199 -  [with_gallium_r300, 'r300', driver_r300, []],
1200 -  [with_gallium_r600, 'r600', driver_r600, []],
1201 -  [with_gallium_radeonsi, 'radeonsi', [driver_radeonsi, idep_xmlconfig], []],
1202 -  [with_gallium_freedreno, 'msm', driver_freedreno, []],
1203 -  [with_gallium_kmsro, 'kmsro', _kmsro_targets, []],
1204 -  [with_gallium_svga, 'vmwgfx', driver_svga, []],
1205 -  [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, libws_null]],
1206 +  [with_gallium_i915, 'i915', driver_i915, [], []],
1207 +  [with_gallium_iris, 'iris', [driver_iris, idep_xmlconfig], [], []],
1208 +  [with_gallium_nouveau, 'nouveau', driver_nouveau, [], []],
1209 +  [with_gallium_r300, 'r300', driver_r300, [], [libr300,libradeonwinsys,libmesa_format]],
1210 +  [with_gallium_r600, 'r600', driver_r600, [], [libr600,libradeonwinsys,libmesa_format,libgalliumvl]],
1211 +  [with_gallium_radeonsi, 'radeonsi', [driver_radeonsi], [], [libradeonsi,libradeonwinsys,libamd_common,libamd_common_llvm,libmesa_format,_libxmlconfig,libgalliumvl]],
1212 +  [with_gallium_freedreno, 'msm', driver_freedreno, [], []],
1213 +  [with_gallium_kmsro, 'kmsro', _kmsro_targets, [], []],
1214 +  [with_gallium_svga, 'vmwgfx', driver_svga, [], [libsvga,libsvgadrm,libmesa_format]],
1215 +  [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, libws_null], [libllvmpipe,libmesa_format,libsoftpipe]],
1216  ]
1217  
1218  foreach x : pipe_loaders
1219 @@ -80,6 +80,7 @@ foreach x : pipe_loaders
1220        link_args : pipe_loader_link_args,
1221        link_depends : pipe_loader_link_deps,
1222        include_directories : pipe_loader_incs,
1223 +      link_whole : [x[4]],
1224        link_with : [pipe_loader_link_with, x[3]],
1225        dependencies : [idep_mesautil, idep_nir, dep_thread, x[2]],
1226        name_prefix : '',
1227
1228
1229 [FILE:838:sunos/patch-src_gallium_targets_va_meson.build]
1230 --- src/gallium/targets/va/meson.build.orig     2021-01-29 18:33:19 UTC
1231 +++ src/gallium/targets/va/meson.build
1232 @@ -39,13 +39,14 @@ libva_gallium = shared_library(
1233    include_directories : [
1234      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1235    ],
1236 -  link_whole : [libva_st],
1237 +  link_whole : [libva_st, _libxmlconfig, libmesa_format, libloader, libpipe_loader_static],
1238    link_with : [
1239      libgalliumvlwinsys, libgalliumvl, libgallium,
1240 -    libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
1241 +    libws_null, libwsw, libswdri, libswkmsdri,
1242 +    libr600, libradeonsi,
1243    ],
1244    dependencies : [
1245 -    dep_libdrm, driver_r600, driver_radeonsi, driver_nouveau,
1246 +    dep_libdrm, driver_nouveau,
1247      idep_mesautil,
1248    ],
1249    link_depends : va_link_depends,
1250
1251
1252 [FILE:761:sunos/patch-src_gallium_targets_vdpau_meson.build]
1253 --- src/gallium/targets/vdpau/meson.build.orig  2020-12-31 03:59:58 UTC
1254 +++ src/gallium/targets/vdpau/meson.build
1255 @@ -44,10 +44,10 @@ libvdpau_gallium = shared_library(
1256    include_directories : [
1257      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1258    ],
1259 -  link_whole : [libvdpau_st],
1260 +  link_whole : [libvdpau_st, libr300, libr600, libradeonsi, libradeonwinsys, libmesa_format, _libxmlconfig, libamd_common, libamd_common_llvm, libpipe_loader_static],
1261    link_with : [
1262      libgalliumvlwinsys, libgalliumvl, libgallium,
1263 -    libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
1264 +    libws_null, libwsw, libswdri, libswkmsdri,
1265    ],
1266    dependencies : [
1267      idep_mesautil,
1268
1269
1270 [FILE:649:sunos/patch-src_gallium_targets_xa_meson.build]
1271 --- src/gallium/targets/xa/meson.build.orig     2020-12-31 03:59:58 UTC
1272 +++ src/gallium/targets/xa/meson.build
1273 @@ -40,9 +40,9 @@ libxatracker = shared_library(
1274    include_directories : [
1275      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1276    ],
1277 -  link_whole : [libxa_st],
1278 +  link_whole : [libxa_st, libsvga, libsvgadrm, libpipe_loader_static, libmesa_format, _libxmlconfig],
1279    link_with : [
1280 -    libgalliumvl_stub, libgallium, libpipe_loader_static,
1281 +    libgalliumvl_stub, libgallium,
1282      libws_null, libwsw, libswdri, libswkmsdri,
1283    ],
1284    link_depends : xa_link_depends,
1285
1286
1287 [FILE:846:sunos/patch-src_gallium_targets_xvmc_meson.build]
1288 --- src/gallium/targets/xvmc/meson.build.orig   2021-01-29 18:33:19 UTC
1289 +++ src/gallium/targets/xvmc/meson.build
1290 @@ -39,12 +39,12 @@ libxvmc_gallium = shared_library(
1291    include_directories : [
1292      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1293    ],
1294 -  link_whole : [libxvmc_st],
1295 +  link_whole : [libxvmc_st,libradeonwinsys,libr600,_libxmlconfig,libmesa_format,libpipe_loader_static],
1296    link_with : [
1297      libgalliumvlwinsys, libgalliumvl, libgallium,
1298      libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
1299    ],
1300 -  dependencies : [idep_mesautil, driver_r600, driver_nouveau],
1301 +  dependencies : [idep_mesautil, driver_nouveau],
1302    link_depends : xvmc_link_depends,
1303    # Will be deleted during installation, see install_megadrivers.py
1304    install : true,
1305
1306
1307 [FILE:510:sunos/patch-src_gbm_meson.build]
1308 --- src/gbm/meson.build.orig    2021-01-29 18:33:19 UTC
1309 +++ src/gbm/meson.build
1310 @@ -49,8 +49,8 @@ libgbm = shared_library(
1311    include_directories : incs_gbm,
1312    c_args : [args_gbm],
1313    link_args : [ld_args_gc_sections],
1314 -  link_with : libloader,
1315 -  dependencies : [deps_gbm, dep_dl, dep_thread, idep_mesautil, idep_xmlconfig],
1316 +  link_with : [libloader, _libxmlconfig],
1317 +  dependencies : [deps_gbm, dep_dl, dep_thread, idep_mesautil],
1318    gnu_symbol_visibility : 'hidden',
1319    version : '1.0.0',
1320    install : true,
1321
1322
1323 [FILE:983:sunos/patch-src_mesa_drivers_dri_meson.build]
1324 --- src/mesa/drivers/dri/meson.build.orig       2020-12-31 03:59:58 UTC
1325 +++ src/mesa/drivers/dri/meson.build
1326 @@ -20,7 +20,7 @@
1327  
1328  subdir('common')
1329  
1330 -_dri_drivers = []
1331 +_dri_drivers = [ _libnir, libmesa_classic, libmesa_common, libintel_compiler, libglcpp, libdricommon ]
1332  _dri_link = []
1333  if with_dri_swrast
1334    subdir('swrast')
1335 @@ -59,14 +59,13 @@ if _dri_drivers != []
1336      [],
1337      link_whole : _dri_drivers,
1338      link_with : [
1339 -      libmegadriver_stub, libdricommon, libglapi,
1340 -      libmesa_classic,
1341 +      libmegadriver_stub, libglapi,
1342      ],
1343      dependencies : [
1344        dep_selinux, dep_libdrm, dep_m, dep_thread, dep_dl,
1345 -      idep_nir, idep_xmlconfig, idep_mesautil,
1346 +      idep_xmlconfig, idep_mesautil,
1347      ],
1348 -    link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections],
1349 +    link_args : [ld_args_build_id, ld_args_gc_sections],
1350      # Will be deleted during installation, see install_megadrivers.py
1351      install : true,
1352      install_dir : dri_drivers_path,
1353