external/pdfium/Library_pdfium.mk               |    2 +-
 external/pdfium/UnpackedTarball_pdfium.mk       |    2 ++
 external/pdfium/freebsd.patch                   |   23 +++++++++++++++++++++++
 sal/osl/unx/process.cxx                         |    2 +-
 sal/osl/unx/socket.cxx                          |    3 +++
 solenv/gbuild/platform/FREEBSD_X86_64_GCC.mk    |    2 ++
 vcl/source/bitmap/BitmapDisabledImageFilter.cxx |    5 -----
 7 files changed, 32 insertions(+), 7 deletions(-)

New commits:
commit 0e451f54c0905fbb14e951ae713f0c80d5a116ae
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Sep 5 22:16:55 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Sep 6 12:06:16 2025 +0200

    remove dead code
    
    we dont use 1-bit format internally anymore
    
    Change-Id: If6f6a6ec6a21507b68d24ce577b3f0600409cb3b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190628
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/vcl/source/bitmap/BitmapDisabledImageFilter.cxx 
b/vcl/source/bitmap/BitmapDisabledImageFilter.cxx
index e402f27fcea3..d27d09c1c689 100644
--- a/vcl/source/bitmap/BitmapDisabledImageFilter.cxx
+++ b/vcl/source/bitmap/BitmapDisabledImageFilter.cxx
@@ -15,12 +15,7 @@ Bitmap BitmapDisabledImageFilter::execute(Bitmap const& 
rBitmap) const
 {
     const Size aSize(rBitmap.GetSizePixel());
 
-    // keep disable image at same depth as original where possible, otherwise
-    // use 8 bit
     auto ePixelFormat = rBitmap.getPixelFormat();
-    if (sal_uInt16(ePixelFormat) < 8)
-        ePixelFormat = vcl::PixelFormat::N8_BPP;
-
     const BitmapPalette* pPal
         = vcl::isPalettePixelFormat(ePixelFormat) ? 
&Bitmap::GetGreyPalette(256) : nullptr;
     Bitmap aGrey(aSize, ePixelFormat, pPal);
commit 778adf575e26e7b35eaaeacb990c19d89edec1d9
Author:     Jaap <[email protected]>
AuthorDate: Sun Aug 3 13:14:21 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Sep 6 12:06:01 2025 +0200

    Fix compilation on FreeBSD
    
    Change-Id: Ida038aef3f83461cdcb0dfadf20a1057282b648b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188928
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 58f87a032edfbd00883fd3bb8936a716b03d4234)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188999
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/external/pdfium/Library_pdfium.mk 
b/external/pdfium/Library_pdfium.mk
index 748f6df053d9..a5f6b908c176 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -731,7 +731,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
 ))
 endif
 
-ifeq ($(OS),LINUX)
+ifneq (,$(filter LINUX FREEBSD OPENBSD,$(OS)))
 # fxge
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
     UnpackedTarball/pdfium/core/fxge/linux/fx_linux_impl \
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index bf93dcd2e09a..b07ab25633a1 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -14,6 +14,8 @@ pdfium_patches += c++20-comparison.patch
 
 pdfium_patches += constexpr-template.patch
 
+pdfium_patches += freebsd.patch
+
 pdfium_patches += system-abseil.diff
 
 # https://pdfium-review.googlesource.com/c/pdfium/+/130970
diff --git a/external/pdfium/freebsd.patch b/external/pdfium/freebsd.patch
new file mode 100644
index 000000000000..a31bf00fb7a9
--- /dev/null
+++ b/external/pdfium/freebsd.patch
@@ -0,0 +1,23 @@
+--- core/fxge/linux/fx_linux_impl.cpp.orig     2024-04-16 00:00:38 UTC
++++ core/fxge/linux/fx_linux_impl.cpp
+@@ -17,7 +17,7 @@
+ #include "core/fxge/fx_font.h"
+ #include "core/fxge/systemfontinfo_iface.h"
+ 
+-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !defined(OS_ASMJS)
++#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !defined(OS_ASMJS) && 
!defined(OS_FREEBSD) && !defined(OS_OPENBSD)
+ #error "Included on the wrong platform"
+ #endif
+ 
+--- core/fxge/cfx_fontmapper.cpp.orig  2024-04-16 00:00:38 UTC
++++ core/fxge/cfx_fontmapper.cpp
+@@ -157,7 +157,7 @@ constexpr AltFontFamily kAltFontFamilies[] = {
+     {"ForteMT", "Forte"},
+ };
+ 
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(OS_ASMJS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || defined(OS_ASMJS) || 
defined(OS_FREEBSD) || defined(OS_OPENBSD)
+ const char kNarrowFamily[] = "LiberationSansNarrow";
+ #elif BUILDFLAG(IS_ANDROID)
+ const char kNarrowFamily[] = "RobotoCondensed";
+
diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx
index bf7c967a80f4..78ab10888867 100644
--- a/sal/osl/unx/process.cxx
+++ b/sal/osl/unx/process.cxx
@@ -45,7 +45,7 @@
 #include <machine/param.h>
 #endif
 
-#ifdef IOS
+#if defined(IOS) || defined(FREEBSD)
 #include <signal.h>
 #endif
 
diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index 2b3a877ec977..28c7fd2e607b 100644
--- a/sal/osl/unx/socket.cxx
+++ b/sal/osl/unx/socket.cxx
@@ -39,6 +39,9 @@
 #include <arpa/inet.h>
 #include <fcntl.h>
 #include <netdb.h>
+#ifdef FREEBSD
+#include <netinet/ip.h>
+#endif
 #include <netinet/tcp.h>
 #include <poll.h>
 #include <unistd.h>
diff --git a/solenv/gbuild/platform/FREEBSD_X86_64_GCC.mk 
b/solenv/gbuild/platform/FREEBSD_X86_64_GCC.mk
index 6199f17b3015..a8eed6a9f131 100644
--- a/solenv/gbuild/platform/FREEBSD_X86_64_GCC.mk
+++ b/solenv/gbuild/platform/FREEBSD_X86_64_GCC.mk
@@ -11,4 +11,6 @@
 
 include $(GBUILDDIR)/platform/unxgcc.mk
 
+USE_LD += -Wl,--undefined-version
+
 # vim: set noet sw=4:

Reply via email to