diff -urN libreoffice-6.4.2.2/external/pdfium-1/illumos.patch libreoffice-6.4.2.2/external/pdfium/illumos.patch
--- libreoffice-6.4.2.2/external/pdfium-1/illumos.patch	1970-01-01 03:00:00.000000000 +0000
+++ libreoffice-6.4.2.2/external/pdfium/illumos.patch	2020-03-14 13:57:43.236983250 +0000
@@ -0,0 +1,22 @@
+--- third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h.1	2020-03-14 13:50:31.561072287 +0000
++++ third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h	2020-03-14 13:50:51.205996015 +0000
+@@ -184,7 +184,7 @@
+   // performance benefits unclear.
+   //
+   // Therefore, we just do the simple thing: MADV_DONTNEED.
+-  CHECK(!madvise(address, length, MADV_DONTNEED));
++  CHECK(!posix_madvise(address, length, POSIX_MADV_DONTNEED));
+ #endif
+ }
+ 
+--- core/fxcrt/cfx_fileaccess_posix.h.1	2020-03-14 14:22:47.915686341 +0000
++++ core/fxcrt/cfx_fileaccess_posix.h	2020-03-14 14:23:12.768876421 +0000
+@@ -12,7 +12,7 @@
+ #include "core/fxcrt/fx_system.h"
+ 
+ #if _FX_PLATFORM_ != _FX_PLATFORM_LINUX_ && !defined(OS_MACOSX) && \
+-    !defined(OS_ANDROID)
++    !defined(OS_ANDROID) && !defined(OS_SOLARIS)
+ #error "Included on the wrong platform"
+ #endif
+ 
--- core-fdc87dd56548622e13353b4cf9864232ee0110fb/external/pdfium/UnpackedTarball_pdfium.mk.~1~	2023-12-14 18:35:52.900928088 -0500
+++ core-fdc87dd56548622e13353b4cf9864232ee0110fb/external/pdfium/UnpackedTarball_pdfium.mk	2023-12-14 18:55:33.458848712 -0500
@@ -8,6 +8,8 @@
 #
 
 pdfium_patches :=
+# illumos-specific fixes
+pdfium_patches += illumos.patch
 # Fixes build on our baseline.
 pdfium_patches += build.patch.1
 # Avoids Windows 8 build dependency.