# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= mesa VERSION= 24.0.6 KEYWORDS= graphics VARIANTS= standard SDESC[standard]= Mesa 3D Graphics Library HOMEPAGE= https://www.mesa3d.org/ CONTACT= nobody DOWNLOAD_GROUPS= main SITES[main]= https://mesa.freedesktop.org/archive/ ftp://ftp.freedesktop.org/pub/mesa/ DISTFILE[1]= mesa-24.0.6.tar.xz:main DF_INDEX= 1 SPKGS[standard]= complete primary drivers dev OPTIONS_AVAILABLE= X86_DRIVERS ARM_DRIVERS LLVMPIPE WAYLAND OPTIONS_STANDARD= X86_DRIVERS ARM_DRIVERS LLVMPIPE OPT_ON[freebsd]= LLVMPIPE//i386|x86_64 OPT_ON[aarch64]= ARM_DRIVERS OPT_ON[linux]= LLVMPIPE//i386|x86_64 OPT_ON[x86_64]= X86_DRIVERS OPT_ON[netbsd]= LLVMPIPE//i386|x86_64 OPT_ON[dragonfly]= LLVMPIPE//i386|x86_64 OPT_ON[i386]= X86_DRIVERS OPT_ON[midnightbsd]= LLVMPIPE//i386|x86_64 BUILD_DEPENDS= libdrm:dev:standard libelf:dev:standard libelf:primary:standard libva:dev:standard libvdpau:dev:standard python-Mako:single:python_used BUILDRUN_DEPENDS= libdrm:primary:standard EXRUN[drivers]= mesa:primary:standard libelf:primary:standard USES= cpe bison gettext:build gmake meson pkgconfig zstd zlib expat shebangfix solaris-funcs python:build c++:primary,drivers XORG_COMPONENTS= x11 xdamage xext xfixes xshmfence xxf86vm xv xrandr xcb LICENSE= MIT:primary CUSTOM1:primary CUSTOM2:primary LICENSE_NAME= CUSTOM1:"Kronos License (MIT with modifications)" CUSTOM2:"SGI Free Software License B" LICENSE_FILE= MIT:{{WRKDIR}}/LICENSE_MIT CUSTOM1:{{WRKDIR}}/LICENSE_KHRONOS CUSTOM2:{{WRKDIR}}/LICENSE_SGI LICENSE_AWK= MIT:"^$$" CUSTOM2:"^$$" LICENSE_SOURCE= MIT:{{WRKSRC}}/include/GL/gl.h CUSTOM2:{{WRKSRC}}/src/glx/eval.c LICENSE_SCHEME= multi CPE_VENDOR= mesa3d FPC_EQUIVALENT= graphics/mesa-libs MESON_ARGS= -Dplatforms=x11{{WAYPLAT}} -Dzstd=enabled -Ddri3=enabled -Dgallium-drivers={{GALLIUM_DRIVERS:tW:tl:C/[[:space:]]/,/g}} -Dosmesa=true -Dlibunwind=disabled -Dgles1=disabled -Dgles2=disabled -Dglx=auto -Dopengl=true -Degl=disabled -Dvulkan-drivers={{VULKAN_DRIVERS:tW:tl:C/[[:space:]]/,/g}} SHEBANG_FILES= src/gallium/*/*/*.py src/gallium/tools/trace/*.py src/gallium/drivers/svga/svgadump/svga_dump.py src/mapi/glapi/gen/*.py src/mapi/mapi_abi.py src/mesa/main/get_*.py src/util/format_srgb.py src/amd/*/*.py src/intel/genxml/gen_pack_header.py SHEBANG_OLD_PYTHON= /usr/bin/env[[:space:]]python2 /usr/bin/python2 /bin/env[[:space:]]python SOL_FUNCTIONS= dirfd:src/util/disk_cache.c asprintf:src/util/anon_file.c asprintf:src/mesa/drivers/dri/common/megadriver_stub.c asprintf:src/loader/loader.c asprintf:src/egl/main/eglcurrent.c asprintf:src/util/u_string.h asprintf:src/amd/common/ac_rtld.c strnlen:src/util/ralloc.c strnlen:src/mesa/main/errors.c strndup:src/loader/loader.c strndup:src/egl/drivers/dri2/platform_x11.c strndup:src/gallium/drivers/r600/evergreen_compute.c strndup:src/gallium/drivers/radeonsi/si_debug.c CONFIGURE_ENV= ax_cv_check_cflags___Wno_initializer_overrides=no INSTALL_TARGET= install-strip INSTALL_REQ_TOOLCHAIN= yes CFLAGS= -Wno-pointer-sign VAR_OPSYS[sunos]= CPPFLAGS=-D__EXTENSIONS__=1 CPPFLAGS=-Wno-unused-function CXXFLAGS=-Drestrict=__restrict__ CFLAGS=-D_POSIX_PTHREAD_SEMANTICS CFLAGS=-DF_DUPFD_CLOEXEC=F_DUPFD CFLAGS=-Wno-incompatible-pointer-types LDFLAGS=-lsocket LDFLAGS=-lnsl MAKEFILE_LINE=MESON_ARGS+=-Dshader-cache=false [ARM_DRIVERS].DESCRIPTION= Build drivers for aarch64 architecture [ARM_DRIVERS].MAKEFILE_ON= GALLIUM_DRIVERS+=FREEDRENO GALLIUM_DRIVERS+=VC4 [X86_DRIVERS].DESCRIPTION= Build drivers for i386 and x86_64 architectures [X86_DRIVERS].MAKEFILE_ON= GALLIUM_DRIVERS+=R300 GALLIUM_DRIVERS+=SVGA VULKAN_DRIVERS+={{VULKAN_DRIVERS_X86}} [WAYLAND].DESCRIPTION= Build Vulkan drivers for Wayland platform [WAYLAND].BUILDRUN_DEPENDS_ON= wayland:primary:standard [WAYLAND].BUILD_DEPENDS_ON= wayland-protocols:single:standard python-Mako:single:python_default wayland:dev:standard [WAYLAND].MAKEFILE_ON= WAYPLAT=,wayland VULKAN_DRIVERS+=INTEL VULKAN_DRIVERS_X86+=RADEON [LLVMPIPE].DESCRIPTION= Build LLVM-based drivers and libraries [LLVMPIPE].BUILDRUN_DEPENDS_ON= llvm17:primary:standard ocl-icd:primary:standard [LLVMPIPE].BUILD_DEPENDS_ON= libclc:single:standard opencl-headers:single:standard ocl-icd:dev:standard llvm17:tools:standard llvm17:dev:standard clang17:complete:standard [LLVMPIPE].MAKEFILE_OFF= MESON_ARGS+=-Dgallium-opencl=disabled [LLVMPIPE].MAKEFILE_ON= GALLIUM_LLVM_DRIVERS+=R600 GALLIUM_LLVM_DRIVERS+=RADEONSI GALLIUM_DRIVERS+={{GALLIUM_LLVM_DRIVERS}} MESON_ARGS+=-Dllvm=true MESON_ARGS+=-Dgallium-va=enabled MESON_ARGS+=-Dgallium-opencl=icd MESON_ARGS+=-Dgallium-vdpau=enabled [LLVMPIPE].RUN_DEPENDS_ON= clang17:dynlibs:standard pre-patch-linux: # qsort fixes for BSD break linux ${RM} ${PATCHDIR}/patch-meson.build post-install: ${RM} ${STAGEDIR}${PREFIX}/lib/libGL.so* ${RM} ${STAGEDIR}${PREFIX}/include/GL/g*.h ${RM} ${STAGEDIR}${PREFIX}/lib/pkgconfig/gl.pc ${RM} -r ${STAGEDIR}${PREFIX}/include/KHR ${INSTALL_DATA} ${FILESDIR}/01-freebsd.conf \ ${STAGEDIR}${PREFIX}/share/drirc.d pre-configure: ${REINPLACE_CMD} \ -e '/SYSCONFDIR/ s|/etc|${PREFIX}/etc|g' \ -e '/DATADIR/ s|/usr/share|${PREFIX}/share|g' \ ${WRKSRC}/src/util/xmlconfig.c post-extract: ${AWK} '/Copyright/,/DEALINGS/' ${WRKSRC}/include/GL/glext.h \ > ${WRKDIR}/LICENSE_KHRONOS [FILE:1198:descriptions/desc.primary] The Mesa project began as an open-source implementation of the OpenGL specification - a system for rendering interactive 3D graphics. Over the years the project has grown to implement more graphics APIs, including OpenGL ES (versions 1, 2, 3), OpenCL, OpenMAX, VDPAU, VA API, XvMC and Vulkan. A variety of device drivers allows the Mesa libraries to be used in many different environments ranging from software emulation to complete hardware acceleration for modern GPUs. Mesa ties into several other open-source projects: the Direct Rendering Infrastructure and X.org to provide OpenGL support on Linux, FreeBSD and other operating systems. This package contains the Mesa OpenGL libraries for GLX and EGL clients. These include libOSMesa, libEGL, libGL, and libglesv2 as well as utility libraries libglapi and gbm. The OSMesa library is an Off-Screen version of Mesa in order to do off-screen rendering in other packages like VTK. Offscreen rendering is useful for a number of things, such as batch processing, parallel processing, and remote processing. This package also contains Mesa's libOpenCL implementation "Clover". It is built upon GALLIUM and currently only supports Radeon GPUs. [FILE:162:descriptions/desc.drivers] This package contains the Mesa OpenGL libraries for GLX and EGL clients. These include libEGL, libGL, and libglesv2 as well as utlity libraries libglapi and gbm. [FILE:97:distinfo] 8b7a92dbe6468c18f2383700135b5fe9de836cdf0cc8fd7dbae3c7110237d604 20115628 mesa-24.0.6.tar.xz [FILE:365:manifests/plist.primary] %%LLVMPIPE-ON%%etc/OpenCL/vendors/mesa.icd %%LLVMPIPE-ON%%lib/ libMesaOpenCL.so.1 libMesaOpenCL.so.1.0.0 %%LLVMPIPE-ON%%lib/gallium-pipe/ pipe_r300.so pipe_r600.so pipe_radeonsi.so pipe_swrast.so pipe_vmwgfx.so lib/ libOSMesa.so.8 libOSMesa.so.8.0.0 libgbm.so.1 libgbm.so.1.0.0 libglapi.so.0 libglapi.so.0.0.0 libxatracker.so.2 libxatracker.so.2.5.0 [FILE:483:manifests/plist.drivers] %%ARM_DRIVERS-ON%%lib/dri/ kgsl_dri.so msm_dri.so vc4_dri.so %%LLVMPIPE-ON%%lib/dri/ r600_dri.so r600_drv_video.so radeonsi_dri.so radeonsi_drv_video.so %%LLVMPIPE-ON%%lib/vdpau/ libvdpau_r600.so.1 libvdpau_r600.so.1.0 libvdpau_r600.so.1.0.0 libvdpau_radeonsi.so.1 libvdpau_radeonsi.so.1.0 libvdpau_radeonsi.so.1.0.0 %%X86_DRIVERS-ON%%lib/dri/ r300_dri.so vmwgfx_dri.so lib/dri/ kms_swrast_dri.so swrast_dri.so share/drirc.d/ 00-mesa-defaults.conf 01-freebsd.conf [FILE:334:manifests/plist.dev] %%LLVMPIPE-ON%%lib/libMesaOpenCL.so %%LLVMPIPE-ON%%lib/vdpau/ libvdpau_r600.so libvdpau_radeonsi.so include/ gbm.h xa_composite.h xa_context.h xa_tracker.h include/GL/osmesa.h include/GL/internal/dri_interface.h lib/ libOSMesa.so libgbm.so libglapi.so libxatracker.so lib/pkgconfig/ dri.pc gbm.pc osmesa.pc xatracker.pc [FILE:2287:patches/patch-meson.build] --- meson.build.orig 2024-04-24 18:00:13 UTC +++ meson.build @@ -128,7 +128,7 @@ with_any_opengl = with_opengl or with_gl # Only build shared_glapi if at least one OpenGL API is enabled with_shared_glapi = with_shared_glapi and with_any_opengl -system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm'].contains(host_machine.system()) +system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm', 'midnightbsd'].contains(host_machine.system()) gallium_drivers = get_option('gallium-drivers') if gallium_drivers.contains('auto') @@ -1115,7 +1115,7 @@ else endif # FreeBSD annotated but Mesa isn't ready - if not (cc.get_id() == 'clang' and host_machine.system() == 'freebsd') + if not (cc.get_id() == 'clang' and ['freebsd', 'midnightbsd'].contains(host_machine.system())) _trial_c += ['-Werror=thread-safety'] endif @@ -1387,34 +1387,34 @@ foreach f, prefix: functions_to_detect endforeach if cpp.links(''' - #define _GNU_SOURCE #include - static int dcomp(const void *l, const void *r, void *t) { return 0; } + static int dcomp(void *t, const void *l, const void *r) { return 0; } int main(int ac, char **av) { int arr[] = { 1 }; void *t = NULL; - qsort_r((void*)&arr[0], 1, 1, dcomp, t); + qsort_r((void*)&arr[0], 1, 1, t, dcomp); return (0); }''', args : pre_args, - name : 'GNU qsort_r') - pre_args += '-DHAVE_GNU_QSORT_R' + name : 'BSD qsort_r') + pre_args += '-DHAVE_BSD_QSORT_R' elif cpp.links(''' + #define _GNU_SOURCE #include - static int dcomp(void *t, const void *l, const void *r) { return 0; } + static int dcomp(const void *l, const void *r, void *t) { return 0; } int main(int ac, char **av) { int arr[] = { 1 }; void *t = NULL; - qsort_r((void*)&arr[0], 1, 1, t, dcomp); + qsort_r((void*)&arr[0], 1, 1, dcomp, t); return (0); }''', args : pre_args, - name : 'BSD qsort_r') - pre_args += '-DHAVE_BSD_QSORT_R' + name : 'GNU qsort_r') + pre_args += '-DHAVE_GNU_QSORT_R' endif if cc.has_header_symbol('time.h', 'struct timespec') [FILE:227:patches/patch-src_amd_llvm_ac__llvm__build.h] --- src/amd/llvm/ac_llvm_build.h.orig 2024-04-24 18:00:13 UTC +++ src/amd/llvm/ac_llvm_build.h @@ -16,6 +16,10 @@ #include +#ifdef __sun +#include +#endif + #ifdef __cplusplus extern "C" { #endif [FILE:512:patches/patch-src_amd_vulkan_radv__device.c] - Define CLOCK_MONOTONIC_RAW if missing --- src/amd/vulkan/radv_device.c.orig 2024-04-24 18:00:13 UTC +++ src/amd/vulkan/radv_device.c @@ -462,6 +462,14 @@ radv_parse_force_vrs_config_file(const c #define BUF_LEN ((10 * (sizeof(struct inotify_event) + NAME_MAX + 1))) +#ifndef CLOCK_MONOTONIC_RAW +# ifdef CLOCK_MONOTONIC_FAST +# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST +# else +# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC +# endif +#endif + static int radv_notifier_thread_run(void *data) { [FILE:354:patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c] - Define ETIME if missing --- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig 2024-04-24 18:00:13 UTC +++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c @@ -48,6 +48,10 @@ enum { VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024 }; +#ifndef ETIME +#define ETIME ETIMEDOUT +#endif + struct radv_amdgpu_ib { struct radeon_winsys_bo *bo; unsigned cdw; [FILE:544:patches/patch-src_egl_drivers_dri2_egl__dri2.c] --- src/egl/drivers/dri2/egl_dri2.c.orig 2024-04-24 18:00:13 UTC +++ src/egl/drivers/dri2/egl_dri2.c @@ -941,11 +941,13 @@ dri2_setup_screen(_EGLDisplay *disp) disp->Extensions.KHR_gl_texture_3D_image = EGL_TRUE; #ifdef HAVE_LIBDRM +# ifndef __DragonFly__ if (dri2_dpy->image->base.version >= 8 && dri2_dpy->image->createImageFromDmaBufs) { disp->Extensions.EXT_image_dma_buf_import = EGL_TRUE; disp->Extensions.EXT_image_dma_buf_import_modifiers = EGL_TRUE; } +# endif #endif } [FILE:798:patches/patch-src_egl_drivers_dri2_platform__wayland.c] --- src/egl/drivers/dri2/platform_wayland.c.orig 2024-04-24 18:00:13 UTC +++ src/egl/drivers/dri2/platform_wayland.c @@ -1980,6 +1980,7 @@ registry_handle_global_drm(void *data, s if (strcmp(interface, wl_drm_interface.name) == 0) { dri2_dpy->wl_drm_version = MIN2(version, 2); dri2_dpy->wl_drm_name = name; +#ifndef __DragonFly__ } else if (strcmp(interface, zwp_linux_dmabuf_v1_interface.name) == 0 && version >= 3) { dri2_dpy->wl_dmabuf = wl_registry_bind( @@ -1987,6 +1988,7 @@ registry_handle_global_drm(void *data, s MIN2(version, ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION)); zwp_linux_dmabuf_v1_add_listener(dri2_dpy->wl_dmabuf, &dmabuf_listener, dri2_dpy); +#endif } } [FILE:281:patches/patch-src_egl_main_eglglobals.c] --- src/egl/main/eglglobals.c.orig 2024-04-24 18:00:13 UTC +++ src/egl/main/eglglobals.c @@ -40,6 +40,10 @@ #include "util/macros.h" #include "util/os_misc.h" +#ifdef __DragonFly__ +#undef HAVE_MINCORE +#endif + #ifdef HAVE_MINCORE #include #include [FILE:314:patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c] --- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2024-04-24 18:00:13 UTC +++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "loader.h" #include "target-helpers/drm_helper_public.h" [FILE:357:patches/patch-src_gallium_auxiliary_renderonly_renderonly.c] --- src/gallium/auxiliary/renderonly/renderonly.c.orig 2024-04-24 18:00:13 UTC +++ src/gallium/auxiliary/renderonly/renderonly.c @@ -37,6 +37,10 @@ #include "util/u_inlines.h" #include "util/u_memory.h" +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + void renderonly_scanout_destroy(struct renderonly_scanout *scanout, struct renderonly *ro) [FILE:403:patches/patch-src_gallium_drivers_llvmpipe_lp__scene.c] --- src/gallium/drivers/llvmpipe/lp_scene.c.orig 2024-04-24 18:00:13 UTC +++ src/gallium/drivers/llvmpipe/lp_scene.c @@ -25,6 +25,10 @@ * **************************************************************************/ +#ifdef __NetBSD__ +#define _OPENBSD_SOURCE +#include /* for reallocarray */ +#endif #include "util/u_framebuffer.h" #include "util/u_math.h" #include "util/u_memory.h" [FILE:360:patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c] # define ETIME as ETIMEOUT same as in intel driver # --- src/gallium/drivers/vc4/vc4_bufmgr.c.orig 2024-04-24 18:00:13 UTC +++ src/gallium/drivers/vc4/vc4_bufmgr.c @@ -27,6 +27,9 @@ #include #include #include +#ifndef ETIME +#define ETIME ETIMEDOUT +#endif #include "util/u_hash_table.h" #include "util/u_memory.h" [FILE:271:patches/patch-src_gallium_winsys_amdgpu_drm_amdgpu__cs.c] --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c.orig 2024-04-24 18:00:13 UTC +++ src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -13,6 +13,10 @@ #include "amd/common/sid.h" +#ifdef __sun__ +#include +#endif + /* FENCES */ static struct pipe_fence_handle * [FILE:1012:patches/patch-src_intel_common_intel__measure.c] --- src/intel/common/intel_measure.c.orig 2024-04-24 18:00:13 UTC +++ src/intel/common/intel_measure.c @@ -42,6 +42,46 @@ #include "util/u_debug.h" #include "util/macros.h" +#ifdef __sun +static int +mkfifoat(int fd, const char *path, mode_t mode) +{ + int er, curfd = -1, newfd = -1; + + /* Get our current directory then switch to the given one. */ + + if (fd != AT_FDCWD) { + if ((curfd = open(".", O_RDONLY, 0)) == -1) + return -1; + if (fchdir(fd) == -1) + goto out; + } + + if ((newfd = mkfifo(path, mode)) == -1) + goto out; + + /* This leaves the fifo if it fails. */ + + if (curfd != -1 && fchdir(curfd) == -1) + goto out; + if (curfd != -1) + close(curfd); + + return newfd; +out: + /* Ignore errors in close(2). */ + + er = errno; + if (curfd != -1) + fchdir(curfd); + if (curfd != -1) + close(curfd); + if (newfd != -1) + close(newfd); + errno = er; + return -1; +} +#endif static const struct debug_control debug_control[] = { { "draw", INTEL_MEASURE_DRAW }, [FILE:1014:patches/patch-src_intel_compiler_brw__eu__validate.c] --- src/intel/compiler/brw_eu_validate.c.orig 2024-04-24 18:00:13 UTC +++ src/intel/compiler/brw_eu_validate.c @@ -41,6 +41,39 @@ #include #include "brw_eu.h" +#ifdef __sun__ +#include + +static void * +memmem(const void *l, size_t l_len, const void *s, size_t s_len) +{ + char *cur, *last; + const char *cl = (const char *)l; + const char *cs = (const char *)s; + + /* we need something to compare */ + if (l_len == 0 || s_len == 0) + return NULL; + + /* "s" must be smaller or equal to "l" */ + if (l_len < s_len) + return NULL; + + /* special case where s_len == 1 */ + if (s_len == 1) + return memchr(l, (int)*cs, l_len); + + /* the last position where its possible to find "s" in "l" */ + last = (char *)cl + l_len - s_len; + + for (cur = (char *)cl; cur <= last; cur++) + if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0) + return cur; + + return NULL; +} +#endif + /* We're going to do lots of string concatenation, so this should help. */ struct string { char *str; [FILE:954:patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp] --- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig 2024-04-24 18:00:13 UTC +++ src/intel/compiler/brw_fs_bank_conflicts.cpp @@ -309,8 +309,13 @@ namespace { const unsigned align = MAX2(sizeof(void *), __alignof__(vector_type)); const unsigned size = DIV_ROUND_UP(n, vector_width) * sizeof(vector_type); void *p; +#ifdef __sun + p = memalign(align, size); + if (p == NULL) return NULL; +#else if (posix_memalign(&p, align, size)) return NULL; +#endif memset(p, 0, size); return reinterpret_cast(p); } @@ -737,7 +742,7 @@ namespace { const weight_vector_type &conflicts) { const unsigned m = DIV_ROUND_UP(conflicts.size, vector_width); - vector_type s_p = {}, s_n = {}; + vector_type s_p = {0}, s_n = {0}; for (unsigned r = 0; r < m; r++) { s_p = adds(s_p, mask(bank_mask_p.v[r], conflicts.v[r])); [FILE:234:patches/patch-src_intel_isl_isl.h] --- src/intel/isl/isl.h.orig 2024-04-24 18:00:13 UTC +++ src/intel/isl/isl.h @@ -48,6 +48,9 @@ #include "util/format/u_format.h" #ifdef __cplusplus +# ifdef __sun__ +# define restrict __restrict__ +# endif extern "C" { #endif [FILE:302:patches/patch-src_intel_tools_aubinator__error__decode.c] # expose getline in FreeBSD's stdio.h # --- src/intel/tools/aubinator_error_decode.c.orig 2024-04-24 18:00:13 UTC +++ src/intel/tools/aubinator_error_decode.c @@ -22,6 +22,9 @@ * */ +#ifdef __FreeBSD__ +#define _WITH_GETLINE +#endif #include #include #include [FILE:238:patches/patch-src_intel_tools_error2aub.c] --- src/intel/tools/error2aub.c.orig 2024-04-24 18:00:13 UTC +++ src/intel/tools/error2aub.c @@ -22,6 +22,9 @@ * */ +#ifdef __FreeBSD__ +#define _WITH_GETLINE +#endif #include #include #include [FILE:328:patches/patch-src_util_build__id.c] # Elf_ doesn't exist, use Elf32_ or Elf64_ # --- src/util/build_id.c.orig 2024-04-24 18:00:13 UTC +++ src/util/build_id.c @@ -35,7 +35,11 @@ #endif #ifndef ElfW -#define ElfW(type) Elf_##type +#ifdef __LP64__ +#define ElfW(type) Elf64_##type +#else +#define ElfW(type) Elf32_##type +#endif #endif struct build_id_note { [FILE:235:patches/patch-src_util_libsync.h] --- src/util/libsync.h.orig 2024-04-24 18:00:13 UTC +++ src/util/libsync.h @@ -38,6 +38,10 @@ #include #include +#ifdef __sun__ +#include +#endif + #if defined(__cplusplus) extern "C" { #endif [FILE:230:patches/patch-src_util_os__file.c] --- src/util/os_file.c.orig 2024-04-24 18:00:13 UTC +++ src/util/os_file.c @@ -28,6 +28,9 @@ #endif #endif +#ifndef ENODATA +#define ENODATA ENOATTR +#endif FILE * os_file_create_unique(const char *filename, int filemode) [FILE:592:patches/patch-src_util_os__memory__aligned.h] --- src/util/os_memory_aligned.h.orig 2024-04-24 18:00:13 UTC +++ src/util/os_memory_aligned.h @@ -53,11 +53,16 @@ add_overflow_size_t(size_t a, size_t b, static inline void * os_malloc_aligned(size_t size, size_t alignment) { +#ifdef __sun__ + alignment = (alignment + sizeof(void*) - 1) & ~(sizeof(void*) - 1); + return memalign(alignment, size); +#else void *ptr; alignment = (alignment + sizeof(void*) - 1) & ~(sizeof(void*) - 1); if(posix_memalign(&ptr, alignment, size) != 0) return NULL; return ptr; +#endif } #define os_free_aligned(_ptr) free(_ptr) [FILE:853:patches/patch-src_util_strndup.h] --- src/util/strndup.h.orig 2024-04-24 18:00:13 UTC +++ src/util/strndup.h @@ -24,7 +24,7 @@ #ifndef STRNDUP_H #define STRNDUP_H -#if defined(_WIN32) +#if defined(_WIN32) || defined(__sun) #include // size_t #include @@ -34,6 +34,7 @@ extern "C" { #endif static inline char * +#if defined(_WIN32) strndup(const char *str, size_t max) { size_t n; @@ -50,6 +51,22 @@ strndup(const char *str, size_t max) memcpy(ptr, str, n); return ptr; } +#else // version without strnlen +strndup(const char *str, size_t n) +{ + size_t len; + char *copy; + + len = strlen(str); + if (len <= n) + return (strdup(str)); + if ((copy = (char *)malloc(len + 1)) == NULL) + return (NULL); + memcpy(copy, str, len); + copy[len] = '\0'; + return (copy); +} +#endif #ifdef __cplusplus } [FILE:430:patches/patch-src_util_u__atomic.h] --- src/util/u_atomic.h.orig 2024-04-24 18:00:13 UTC +++ src/util/u_atomic.h @@ -20,11 +20,7 @@ * locally coded assembly, compiler intrinsic or ultimately a * mutex-based implementation. */ -#if defined(__sun) -#define PIPE_ATOMIC_OS_SOLARIS -#elif defined(_MSC_VER) -#define PIPE_ATOMIC_MSVC_INTRINSIC -#elif defined(__GNUC__) +#if defined(__GNUC__) #define PIPE_ATOMIC_GCC_INTRINSIC #else #error "Unsupported platform" [FILE:188:patches/patch-src_util_u__math.h] --- src/util/u_math.h.orig 2024-04-24 18:00:13 UTC +++ src/util/u_math.h @@ -60,6 +60,7 @@ extern "C" { #endif +#undef ALIGN #ifndef M_SQRT2 #define M_SQRT2 1.41421356237309504880 [FILE:442:patches/patch-src_util_u__thread.h] --- src/util/u_thread.h.orig 2024-04-24 18:00:13 UTC +++ src/util/u_thread.h @@ -50,7 +50,7 @@ * but not with __thread */ #define __THREAD_INITIAL_EXEC __thread -#elif defined(__GLIBC__) +#elif defined(__GLIBC__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__MidnightBSD__) #define __THREAD_INITIAL_EXEC thread_local __attribute__((tls_model("initial-exec"))) #define REALLY_INITIAL_EXEC #else [FILE:458:files/01-freebsd.conf] [FILE:25:files/special.mk] GALLIUM_DRIVERS+= SWRAST [FILE:911:sunos/patch-src_gallium_targets_dri_meson.build] --- src/gallium/targets/dri/meson.build.orig 2020-12-31 03:59:58 UTC +++ src/gallium/targets/dri/meson.build @@ -45,11 +45,12 @@ libgallium_dri = shared_library( inc_gallium_winsys, include_directories('../../frontends/dri'), ], gnu_symbol_visibility : 'hidden', - link_args : [ld_args_build_id, ld_args_gc_sections, gallium_dri_ld_args], + link_args : [ld_args_gc_sections, gallium_dri_ld_args], link_depends : gallium_dri_link_depends, + link_whole : [libdri, libdricommon, libgallium, libr300, _libnir, libglsl, libglcpp], # libr600, libamd_common link_with : [ - libdri, libmesa_gallium, libdricommon, libmegadriver_stub, libgalliumvl, - libgallium, libglapi, libpipe_loader_static, libws_null, libwsw, libswdri, + libmesa_gallium, libmegadriver_stub, libgalliumvl, + libglapi, libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri, ], dependencies : [ [FILE:424:sunos/patch-src_gallium_targets_opencl_meson.build] --- src/gallium/targets/opencl/meson.build.orig 2021-01-29 18:33:19 UTC +++ src/gallium/targets/opencl/meson.build @@ -90,7 +90,7 @@ libopencl = shared_library( [], link_args : [ld_args_gc_sections, opencl_link_args], link_depends : opencl_link_deps, - link_whole : libclover, + link_whole : [libclover,libmesa_format], link_with : [libpipe_loader_dynamic, libgallium], dependencies : [ idep_mesautil, [FILE:604:sunos/patch-src_gallium_targets_osmesa_meson.build] --- src/gallium/targets/osmesa/meson.build.orig 2020-12-31 03:59:58 UTC +++ src/gallium/targets/osmesa/meson.build @@ -49,9 +49,9 @@ libosmesa = shared_library( inc_gallium_drivers, ], link_depends : osmesa_link_deps, - link_whole : [libosmesa_st, libglapi_static], + link_whole : [libosmesa_st, libglapi_static, libsoftpipe, libgallium, _libnir, libglsl, libglcpp], link_with : [ - libmesa_gallium, libgallium, libws_null, osmesa_link_with, + libmesa_gallium, libws_null, osmesa_link_with, ], dependencies : [ dep_ws2_32, dep_selinux, dep_thread, dep_clock, dep_unwind, [FILE:2062:sunos/patch-src_gallium_targets_pipe-loader_meson.build] --- src/gallium/targets/pipe-loader/meson.build.orig 2021-01-29 18:33:19 UTC +++ src/gallium/targets/pipe-loader/meson.build @@ -57,16 +57,16 @@ if with_gallium_v3d endif pipe_loaders = [ - [with_gallium_i915, 'i915', driver_i915, []], - [with_gallium_iris, 'iris', [driver_iris, idep_xmlconfig], []], - [with_gallium_nouveau, 'nouveau', driver_nouveau, []], - [with_gallium_r300, 'r300', driver_r300, []], - [with_gallium_r600, 'r600', driver_r600, []], - [with_gallium_radeonsi, 'radeonsi', [driver_radeonsi, idep_xmlconfig], []], - [with_gallium_freedreno, 'msm', driver_freedreno, []], - [with_gallium_kmsro, 'kmsro', _kmsro_targets, []], - [with_gallium_svga, 'vmwgfx', driver_svga, []], - [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, libws_null]], + [with_gallium_i915, 'i915', driver_i915, [], []], + [with_gallium_iris, 'iris', [driver_iris, idep_xmlconfig], [], []], + [with_gallium_nouveau, 'nouveau', driver_nouveau, [], []], + [with_gallium_r300, 'r300', driver_r300, [], [libr300,libradeonwinsys,libmesa_format]], + [with_gallium_r600, 'r600', driver_r600, [], [libr600,libradeonwinsys,libmesa_format,libgalliumvl]], + [with_gallium_radeonsi, 'radeonsi', [driver_radeonsi], [], [libradeonsi,libradeonwinsys,libamd_common,libamd_common_llvm,libmesa_format,_libxmlconfig,libgalliumvl]], + [with_gallium_freedreno, 'msm', driver_freedreno, [], []], + [with_gallium_kmsro, 'kmsro', _kmsro_targets, [], []], + [with_gallium_svga, 'vmwgfx', driver_svga, [], [libsvga,libsvgadrm,libmesa_format]], + [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, libws_null], [libllvmpipe,libmesa_format,libsoftpipe]], ] foreach x : pipe_loaders @@ -80,6 +80,7 @@ foreach x : pipe_loaders link_args : pipe_loader_link_args, link_depends : pipe_loader_link_deps, include_directories : pipe_loader_incs, + link_whole : [x[4]], link_with : [pipe_loader_link_with, x[3]], dependencies : [idep_mesautil, idep_nir, dep_thread, x[2]], name_prefix : '', [FILE:838:sunos/patch-src_gallium_targets_va_meson.build] --- src/gallium/targets/va/meson.build.orig 2021-01-29 18:33:19 UTC +++ src/gallium/targets/va/meson.build @@ -39,13 +39,14 @@ libva_gallium = shared_library( include_directories : [ inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers, ], - link_whole : [libva_st], + link_whole : [libva_st, _libxmlconfig, libmesa_format, libloader, libpipe_loader_static], link_with : [ libgalliumvlwinsys, libgalliumvl, libgallium, - libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri, + libws_null, libwsw, libswdri, libswkmsdri, + libr600, libradeonsi, ], dependencies : [ - dep_libdrm, driver_r600, driver_radeonsi, driver_nouveau, + dep_libdrm, driver_nouveau, idep_mesautil, ], link_depends : va_link_depends, [FILE:784:sunos/patch-src_gallium_targets_vdpau_meson.build] --- src/gallium/targets/vdpau/meson.build.orig 2020-12-31 03:59:58 UTC +++ src/gallium/targets/vdpau/meson.build @@ -44,10 +44,10 @@ libvdpau_gallium = shared_library( include_directories : [ inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers, ], - link_whole : [libvdpau_st], + link_whole : [libvdpau_st, libr300, libradeonwinsys, libmesa_format, _libxmlconfig, libpipe_loader_static, libgallium, _libnir], # libr600, libradeonsi, libamd_common, libamd_common_llvm, link_with : [ libgalliumvlwinsys, libgalliumvl, libgallium, - libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri, + libws_null, libwsw, libswdri, libswkmsdri, ], dependencies : [ idep_mesautil, [FILE:670:sunos/patch-src_gallium_targets_xa_meson.build] --- src/gallium/targets/xa/meson.build.orig 2020-12-31 03:59:58 UTC +++ src/gallium/targets/xa/meson.build @@ -40,9 +40,9 @@ libxatracker = shared_library( include_directories : [ inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers, ], - link_whole : [libxa_st], + link_whole : [libxa_st, libsvga, libsvgadrm, libpipe_loader_static, libmesa_format, _libxmlconfig, libgallium, _libnir], link_with : [ - libgalliumvl_stub, libgallium, libpipe_loader_static, + libgalliumvl_stub, libgallium, libws_null, libwsw, libswdri, libswkmsdri, ], link_depends : xa_link_depends, [FILE:846:sunos/patch-src_gallium_targets_xvmc_meson.build] --- src/gallium/targets/xvmc/meson.build.orig 2021-01-29 18:33:19 UTC +++ src/gallium/targets/xvmc/meson.build @@ -39,12 +39,12 @@ libxvmc_gallium = shared_library( include_directories : [ inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers, ], - link_whole : [libxvmc_st], + link_whole : [libxvmc_st,libradeonwinsys,libr600,_libxmlconfig,libmesa_format,libpipe_loader_static], link_with : [ libgalliumvlwinsys, libgalliumvl, libgallium, libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri, ], - dependencies : [idep_mesautil, driver_r600, driver_nouveau], + dependencies : [idep_mesautil, driver_nouveau], link_depends : xvmc_link_depends, # Will be deleted during installation, see install_megadrivers.py install : true, [FILE:510:sunos/patch-src_gbm_meson.build] --- src/gbm/meson.build.orig 2021-01-29 18:33:19 UTC +++ src/gbm/meson.build @@ -49,8 +49,8 @@ libgbm = shared_library( include_directories : incs_gbm, c_args : [args_gbm], link_args : [ld_args_gc_sections], - link_with : libloader, - dependencies : [deps_gbm, dep_dl, dep_thread, idep_mesautil, idep_xmlconfig], + link_with : [libloader, _libxmlconfig], + dependencies : [deps_gbm, dep_dl, dep_thread, idep_mesautil], gnu_symbol_visibility : 'hidden', version : '1.0.0', install : true, [FILE:997:sunos/patch-src_mesa_drivers_dri_meson.build] --- src/mesa/drivers/dri/meson.build.orig 2020-12-31 03:59:58 UTC +++ src/mesa/drivers/dri/meson.build @@ -20,7 +20,7 @@ subdir('common') -_dri_drivers = [] +_dri_drivers = [ _libnir, libmesa_classic, libmesa_common, libintel_compiler, libglcpp, libdricommon ] _dri_link = [] if with_dri_swrast subdir('swrast') @@ -59,14 +59,13 @@ if _dri_drivers != [] [], link_whole : _dri_drivers, link_with : [ - libmegadriver_stub, libdricommon, libglapi, - libmesa_classic, + libmegadriver_stub, libglapi, libintel_dev, ], dependencies : [ dep_selinux, dep_libdrm, dep_m, dep_thread, dep_dl, - idep_nir, idep_xmlconfig, idep_mesautil, + idep_xmlconfig, idep_mesautil, ], - link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections], + link_args : [ld_args_build_id, ld_args_gc_sections], # Will be deleted during installation, see install_megadrivers.py install : true, install_dir : dri_drivers_path,