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