pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/misc/libreoffice
Module Name: pkgsrc
Committed By: manu
Date: Wed Apr 9 14:31:57 UTC 2025
Modified Files:
pkgsrc/misc/libreoffice: Makefile distinfo
Added Files:
pkgsrc/misc/libreoffice/patches:
patch-bridges_source_cpp_uno_shared_vtablefactory.cxx
Log Message:
Fix a bug in cpp_uno that caused memory allocation failure if the
fileystem did not implement fallocate().
While there add an explicit version dependency on libcmis
To generate a diff of this commit:
cvs rdiff -u -r1.354 -r1.355 pkgsrc/misc/libreoffice/Makefile
cvs rdiff -u -r1.163 -r1.164 pkgsrc/misc/libreoffice/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/misc/libreoffice/patches/patch-bridges_source_cpp_uno_shared_vtablefactory.cxx
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/misc/libreoffice/Makefile
diff -u pkgsrc/misc/libreoffice/Makefile:1.354 pkgsrc/misc/libreoffice/Makefile:1.355
--- pkgsrc/misc/libreoffice/Makefile:1.354 Sun Feb 9 14:44:06 2025
+++ pkgsrc/misc/libreoffice/Makefile Wed Apr 9 14:31:57 2025
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.354 2025/02/09 14:44:06 wiz Exp $
+# $NetBSD: Makefile,v 1.355 2025/04/09 14:31:57 manu Exp $
VERREL= 25.2.0
VERRC= 3
VER= ${VERREL}.${VERRC}
DISTNAME= libreoffice-${VER}
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= misc
MASTER_SITES= http://download.documentfoundation.org/libreoffice/src/${VERREL}/
EXTRACT_SUFX= .tar.xz
@@ -408,6 +408,7 @@ BUILDLINK_API_DEPENDS.libnumbertext+= li
.include "../../multimedia/gstreamer1/buildlink3.mk"
.include "../../multimedia/gst-plugins1-base/buildlink3.mk"
.include "../../net/libcmis/buildlink3.mk"
+BUILDLINK_API_DEPENDS.libcmis+= libcmis>=0.6.1
.include "../../net/mDNSResponder/buildlink3.mk"
# Use PDFium instead of poppler for PDF import since 6.3.2.2nb1
#.include "../../print/poppler-cpp/buildlink3.mk"
Index: pkgsrc/misc/libreoffice/distinfo
diff -u pkgsrc/misc/libreoffice/distinfo:1.163 pkgsrc/misc/libreoffice/distinfo:1.164
--- pkgsrc/misc/libreoffice/distinfo:1.163 Wed Feb 5 03:50:01 2025
+++ pkgsrc/misc/libreoffice/distinfo Wed Apr 9 14:31:57 2025
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.163 2025/02/05 03:50:01 ryoon Exp $
+$NetBSD: distinfo,v 1.164 2025/04/09 14:31:57 manu Exp $
BLAKE2s (libreoffice/0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz) = 0e0a0ae1eb07e5058749dc1726bc59971c723b4b16c57d83f24b6ac6ddd96d71
SHA512 (libreoffice/0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz) =
b9c02d63e9b47a838dbe67c05b9e9e4983d13b9d74794e1c30c73d341c3bc905c9edec3a72fa339ae8c0e06d97e69ac2ea23bf51336b77af14cab7ae67721a46
@@ -208,6 +208,7 @@ SHA1 (patch-Makefile.in) = c16214631f0e4
SHA1 (patch-autogen.sh) = 0fed5f88342112bed0f573d426cc2c3d05ed45c7
SHA1 (patch-bridges_source_cpp__uno_gcc3__linux__intel_share.hxx) = 2eed9efc4a145687f409ba87806147dac2210c68
SHA1 (patch-bridges_source_cpp__uno_gcc3__linux__x86-64_share.hxx) = e664faa4044feaafe8214fdf42f7d008b9aa29fc
+SHA1 (patch-bridges_source_cpp_uno_shared_vtablefactory.cxx) = 108892ef7251073679e05bf23debe0cba83e03bc
SHA1 (patch-configure.ac) = c19a8201ddc9a3297ee8ca5a23ac0ba0145686fe
SHA1 (patch-desktop_scripts_soffice.sh) = 443bbfde1056521901f5f599726053883a98a67d
SHA1 (patch-external_mariadb-connector-c_UnpackedTarball__mariadb-connector-c.mk) = 13defabb6ed7c903872f4782cfd987960fdf2797
Added files:
Index: pkgsrc/misc/libreoffice/patches/patch-bridges_source_cpp_uno_shared_vtablefactory.cxx
diff -u /dev/null pkgsrc/misc/libreoffice/patches/patch-bridges_source_cpp_uno_shared_vtablefactory.cxx:1.1
--- /dev/null Wed Apr 9 14:31:58 2025
+++ pkgsrc/misc/libreoffice/patches/patch-bridges_source_cpp_uno_shared_vtablefactory.cxx Wed Apr 9 14:31:57 2025
@@ -0,0 +1,84 @@
+$NetBSD: patch-bridges_source_cpp_uno_shared_vtablefactory.cxx,v 1.1 2025/04/09 14:31:57 manu Exp $
+
+posix_fallocate() may be available but unimplemented for a
+given filesystem. Detect that situation once and use ftruncate()
+instead.
+
+Here LibreOffice need to mmap() a memory block RWX. At least on NetBSD,
+PAX mprofect will prevent this. LibreOffice has an alternative
+implementation that double mmap() a mkstemp() file, one time RW and
+the second tume RX. Make sure the mmap() RWX is only tried once.
+
+--- ./bridges/source/cpp_uno/shared/vtablefactory.cxx.orig
++++ ./bridges/source/cpp_uno/shared/vtablefactory.cxx
+@@ -245,17 +245,26 @@
+
+ #ifdef USE_DOUBLE_MMAP
+ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
+ {
++#if defined(HAVE_POSIX_FALLOCATE)
++ static int use_fallocate = 1;
++#else
++ static int use_fallocate = 0;
++#endif
++ static int use_double_mmap = 0;
+ std::size_t size = getBlockSize(slotCount);
+ std::size_t pagesize = sysconf(_SC_PAGESIZE);
+ block.size = (size + (pagesize - 1)) & ~(pagesize - 1);
+ block.fd = -1;
+
+- // Try non-doublemmaped allocation first:
+- block.start = block.exec = rtl_arena_alloc(m_arena, &block.size);
+- if (block.start != nullptr) {
+- return true;
++ // try non-doublemmaped allocation first
++ if (!use_double_mmap) {
++ block.start = block.exec = rtl_arena_alloc(m_arena, &block.size);
++ if (block.start != nullptr) {
++ return true;
++ }
++ use_double_mmap = 1;
+ }
+
+ osl::Security aSecurity;
+ OUString strDirectory;
+@@ -280,20 +289,30 @@
+ break;
+ }
+ unlink(tmpfname.get());
+ tmpfname.reset();
++
++ int err;
+ #if defined(HAVE_POSIX_FALLOCATE)
+- int err = posix_fallocate(block.fd, 0, block.size);
+-#else
+- int err = ftruncate(block.fd, block.size);
++retry:
++ if (use_fallocate) {
++ err = posix_fallocate(block.fd, 0, block.size);
++ if (err == EOPNOTSUPP) {
++ use_fallocate = 0;
++ goto retry;
++ }
++ }
++ else
+ #endif
+- if (err != 0)
+ {
+-#if defined(HAVE_POSIX_FALLOCATE)
+- SAL_WARN("bridges", "posix_fallocate failed with code " << err);
+-#else
+- SAL_WARN("bridges", "truncation of executable memory area failed with code " << err);
+-#endif
++ err = ftruncate(block.fd, block.size);
++ }
++
++ if (err != 0) {
++ if (use_fallocate)
++ SAL_WARN("bridges", "posix_fallocate failed with code " << err);
++ else
++ SAL_WARN("bridges", "truncation of executable memory area failed with code " << err);
+ close(block.fd);
+ block.fd = -1;
+ break;
+ }
Home |
Main Index |
Thread Index |
Old Index