115 Commits
Author SHA1 Message Date
Caolán McNamara a0ffcdfe62 ofz#516227797 Integer-overflow
the fixed-point subtractions reached from _cairo_spline_decompose_into
can overflow, so do the arithmetic in wider types

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I6c7d1fa569bfb958ac45ab10748b45acc3ba742d
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12355
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit a1af5f124e9179f74c85feab1b05e7c8f0d73ceb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211407
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-24 11:01:06 +02:00
Khaled Hosny a1b5f5cedd vcl: Remove the dead fd-hack
Drop the exterals patches as VCL internals don’t support this anymore,
and drop the LOK addfont change as it wouldn’t work now. I don’t know if
LOK addfont has any use now, but I left it.

Change-Id: I2798679d0bb59bb6c2c6e0eae329287f36662223
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208546
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Tested-by: Jenkins
2026-07-24 18:12:39 +02:00
Michael Weghorn 1c44d34e7e external cairo/pixmap: Exclude .gitlab-ci.d when extracting tarball
Use gb_UnpackedTarball_set_exclude_pattern newly introduced
in previous commit

    Change-Id: I066f706e6a396a2eb325c5e75c8e9a108174bb88
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Apr 1 09:04:10 2026 +0200

        gbuild: Allow setting an exclude pattern for tarball extraction

to not extract the files in the "pixman-0.46.4/.gitlab-ci.d"
directory of the pixman tarball.

Since this is only used for pixman's Gitlab CI, it is not relevant
for the LibreOffice build and the directory contains symlinks
which would result in the extraction to fail in an --enable-headless
wsl-as-helper build on Windows like this:

    [build UPK] pixman-0.46.4.tar.xz
    tar: .gitlab-ci.d/meson-cross/linux-386-gnu.meson: Cannot create symlink to ‘native-gnu.meson’: No such file or directory
    tar: .gitlab-ci.d/meson-cross/linux-386-llvm.meson: Cannot create symlink to ‘native-llvm.meson’: No such file or directory
    tar: .gitlab-ci.d/meson-cross/linux-amd64-gnu.meson: Cannot create symlink to ‘native-gnu.meson’: No such file or directory
    tar: .gitlab-ci.d/meson-cross/linux-amd64-llvm.meson: Cannot create symlink to ‘native-llvm.meson’: No such file or directory
    tar: .gitlab-ci.d/meson-cross/linux-arm64-v8-gnu.meson: Cannot create symlink to ‘native-gnu.meson’: No such file or directory
    tar: .gitlab-ci.d/meson-cross/linux-arm64-v8-llvm.meson: Cannot create symlink to ‘native-llvm.meson’: No such file or directory
    tar: .gitlab-ci.d/meson-cross/linux-mipsel-gnu.meson: Cannot create symlink to ‘native-gnu-noopenmp.meson’: No such file or directory
    tar: .gitlab-ci.d/meson-cross/linux-mipsel-llvm.meson: Cannot create symlink to ‘native-llvm-noopenmp.meson’: No such file or directory
    tar: .gitlab-ci.d/meson-cross/linux-ppc64le-gnu.meson: Cannot create symlink to ‘native-gnu.meson’: No such file or directory
    tar: .gitlab-ci.d/meson-cross/linux-ppc64le-llvm.meson: Cannot create symlink to ‘native-llvm.meson’: No such file or directory
    tar: .gitlab-ci.d/meson-cross/linux-riscv64-gnu.meson: Cannot create symlink to ‘native-gnu.meson’: No such file or directory
    tar: .gitlab-ci.d/meson-cross/linux-riscv64-llvm.meson: Cannot create symlink to ‘native-llvm.meson’: No such file or directory
    tar: Exiting with failure status due to previous errors
    make[1]: *** [C:/Users/mwegh/DEVELO~1/git/LIBREO~1/solenv/gbuild/UnpackedTarball.mk:61: C:/Users/mwegh/development/git/libreoffice/workdir/UnpackedTarget/pixman-0.46.4.tar.xz] Error 2

Same error seen when trying to manually extract the tarball
using tar in Git Bash.
The inability to extract certain tarballs containing symlinks
in Git Bash/msys2 is a known problem, reported at [1].

[1] https://github.com/msys2/MSYS2-packages/issues/1216

Change-Id: I59b7bdeb341c5c018e96f600a4e640251fd95975
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203128
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-04-02 07:37:06 +02:00
Tor Lillqvist 80f8fe8479 Make also fonts installed from the Microsoft Store show up in CODA-W
This was much more complicated than expected. Most of that thanks to
the inscrutability of fontconfig.

Fonts from the Microsoft Store get installed in a separate folder per
product, under the WindowsApps folder. Each such font product folder
contains one or several TrueType font files, and metadata files, and
preview images, etc.

Add a C++ source file to fontconfig that uses DirectWrite to enumerate
the available fonts. Take only those with a source type of
DWRITE_FONT_SOURCE_TYPE_APPX_PACKAGE into account. Other fonts are
found as before, looking in the system fonts folder (typically
C:\Windows\Fonts) and in the per-user fonts folder (typically
C:\Users\username\AppData\Local\Microsoft\Windows\Fonts).

This C++ code requires headers from the winrt tree in the Windows SDK,
so add that to SOLARINC.

Sadly, thanks to the way fontconfig works (scanning directories for
font files), I need to let it scan the folders of font products from
the Microsoft Store to find the font files, even if the DirectWrite
API would already give us the font file names directly. But I didn't
want to modify fontconfig too much, so oh well.

There was something weird in how fontconfig calculates the hash for
directory names to be used in its cache files. It ended up creating
more and more cache files for the same directories each time CODA-W
was run. I could not understand what was going on, but in any case,
just making sure that FcConfigMapFontPath() and FcConfigMapSalt()
don't do anything on Windows seems to help.

Also change the way freetype is built so that only the special
FT_Done_MM_Var is exported, not all public functions. This was
necessary because for some unknown reason, when linking the vcl DLL I
started getting errors for the freetype symbols that happen to be
linked into also the cairo DLL. If we eventually can switch to
building all of core statically for CODA-W this problem will go away.

Also stop defining FT_DEBUG_LOGGING, such logging will not show up
anywhere for end-users, and fixing problems in freetype on Windows
will have to be done by reproducing and debugging in the VS debugger
anyway.

There is still much to do to make fontconfig (and probably freetype
and cairo) work really correctly on Windows. The most obvious thing is
that the file name handling is broken. This is perhaps understandable
as the port of that code to Windows is from over 20 years ago, I
think.

It works for file and folder names in ASCII, but most likely not for
others. At least the user profile directory, under which per-user font
files are stored, will definitely have non-ASCII in many cases. We
should modify the code to use <tools/UnixWrappers.h>, so that all file
system access is done using proper wide character (UTF-16)
APIs. Pathnames that these libraries handle will then be in UTF-8. The
opendir() etc emulation in fontconfig should also be replaced by
adding such to UnixWrappers.h instead.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I4bc6e32dcc32ff74b79679edacee1aecebd774c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196336
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Tor Lillqvist <tml@iki.fi>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197507
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@iki.fi>
2026-01-17 21:49:57 +01:00
Tor Lillqvist 4857a2ba16 Make cairo and pixman build on Windows again
Change-Id: Icbed00952f6fcc04bd29c5946d7ea626ef5113f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196990
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Jenkins
2026-01-11 16:55:36 +01:00
Tor Lillqvist a7a806de51 Make pixman build for Windows on ARM64
Also silence more warnings in pixman and cairo.

Change-Id: Ic00c0ece203a0bdac5407f958c446ac8147093b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194597
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196989
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@iki.fi>
2026-01-11 16:54:43 +01:00
Tor Lillqvist 7feb6ec87e Update the Windows build of cairo for pixman 0.46.4 (for CODA-W)
Change-Id: I03f1010c0f15e9cc226c02daa529cec30888d5de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196988
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Jenkins
2026-01-11 16:54:22 +01:00
Tor Lillqvist 1bc1c360cb Add some missing gb_StaticLibrary_use_unpacked calls
I had missed that such are needed, which explains why I had had to
manually hand-hold the build of those externals. (These are built as
static libraries, for now, only for CODA-W.)

Change-Id: Ib19ed82e0ab443b7ddfab254ed5754efd013bdf1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194583
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196985
Tested-by: Tor Lillqvist <tml@iki.fi>
Reviewed-by: Tor Lillqvist <tml@iki.fi>
2026-01-11 08:40:29 +01:00
Tor Lillqvist cc7b9f1842 Use gb_UnpackedTarball_workdir
Change-Id: I4ce3c487425191bba4f004e8a93fb81d7316c700
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194574
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196982
Tested-by: Tor Lillqvist <tml@iki.fi>
Reviewed-by: Tor Lillqvist <tml@iki.fi>
2026-01-11 08:36:36 +01:00
Tor Lillqvist fb2e5cd38c Add possibility to build cairo for Windows
As a Library, i.e. DLL. Using our build mechanism, not its own. This
commit does not yet actually add any configury to get it built,
BUILD_TYPE will never contain CAIRO on Windows. Running "make cairo"
won't work.

Change-Id: Ia0fb98471bea92ffb60a0d2a941a378c1fbc6b29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194572
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196979
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Jenkins
2026-01-11 08:32:41 +01:00
Hossein d6773eccb3 Fix cairo / pixman build for headless macOS
The library .dylib file path was not found when building cairo for
macOS. Now it is possible to build cairo for macOS.

Built library files for cario and pixman are adjusted using the tool
install_name_tool, and also solenv/bin/macosx-change-install-names.pl
perl script which also uses install_name_tool indirectly.

From now on, macOS no longer uses the name 'libcairo' for built library
file, and it will use 'libcairo-lo' like the other platforms. This removes
the need for handling macOS differently from the other platforms.

To use headless mode, these options should be added to autogen.input:

--enable-headless
--without-system-fontconfig
--without-system-freetype

Change-Id: I1895ba651a07b1dbd8488fa973ec1d90c24de63b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194931
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
2025-12-05 17:50:24 +01:00
Jan Holesovsky aad732825e Make it possible to build cairo even on macOS
Change-Id: Iea337f2fdd0f90e2b0612cd2cda9c1ea1f4739a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194792
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-11-28 20:56:17 +01:00
Andras Timar 567466b473 tdf#168848 fix cairo build with --enable-python=fully-internal on linux
Change-Id: I1abc8a3c9a7378d8a5d8d9917ae53b8405677e3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193262
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Jenkins
2025-10-31 18:28:08 +01:00
Caolán McNamara ccbd3926bd tweak cairo libxml requirements for all things that use internal libxml2
to fix oss-fuzz build too

Change-Id: I1fe9bc878081530ba6b9455a46196a6afd91f3f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192136
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-10-10 10:00:17 +02:00
Stephan Bergmann 36e0812a01 Update external/cairo/cairo/Wincompatible-pointer-types.patch.0
...to 2b515d095d "upgrade pixman and cairo", where
it now caused an Emscripten build against emsdk 4.0.15 (cf.
4ad6309f5b "external/cairo: Silence some
-Wincompatible-pointer-types") to fail with

> ../src/cairo-image-source.c:89:33: error: incompatible pointer types passing 'void **' to parameter of type 'cairo_atomic_intptr_t *' (aka '_Atomic(void *) *') [-Wincompatible-pointer-types]
>    89 |         if (_cairo_atomic_ptr_cmpxchg ((void **) &__pixman_transparent_image,
>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../src/cairo-atomic-private.h:121:34: note: expanded from macro '_cairo_atomic_ptr_cmpxchg'
>   121 |   _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
>       |                                  ^
> ../src/cairo-atomic-private.h:114:55: note: passing argument to parameter 'x' here
>   114 | _cairo_atomic_ptr_cmpxchg_impl(cairo_atomic_intptr_t *x, void *oldv, void *newv)
>       |                                                       ^
> ../src/cairo-image-source.c:121:33: error: incompatible pointer types passing 'void **' to parameter of type 'cairo_atomic_intptr_t *' (aka '_Atomic(void *) *') [-Wincompatible-pointer-types]
>   121 |         if (_cairo_atomic_ptr_cmpxchg ((void **) &__pixman_black_image,
>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../src/cairo-atomic-private.h:121:34: note: expanded from macro '_cairo_atomic_ptr_cmpxchg'
>   121 |   _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
>       |                                  ^
> ../src/cairo-atomic-private.h:114:55: note: passing argument to parameter 'x' here
>   114 | _cairo_atomic_ptr_cmpxchg_impl(cairo_atomic_intptr_t *x, void *oldv, void *newv)
>       |                                                       ^
> ../src/cairo-image-source.c:153:33: error: incompatible pointer types passing 'void **' to parameter of type 'cairo_atomic_intptr_t *' (aka '_Atomic(void *) *') [-Wincompatible-pointer-types]
>   153 |         if (_cairo_atomic_ptr_cmpxchg ((void **) &__pixman_white_image,
>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../src/cairo-atomic-private.h:121:34: note: expanded from macro '_cairo_atomic_ptr_cmpxchg'
>   121 |   _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
>       |                                  ^
> ../src/cairo-atomic-private.h:114:55: note: passing argument to parameter 'x' here
>   114 | _cairo_atomic_ptr_cmpxchg_impl(cairo_atomic_intptr_t *x, void *oldv, void *newv)
>       |                                                       ^

Change-Id: Icbda11b95e8e9dfae3af6e0c84c68f3b5842f193
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191700
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-10-01 07:57:24 +02:00
Stephan Bergmann 23366f93bc external/cairo: Fix Emscripten build
...after 2b515d095d "upgrade pixman and cairo".

For one, building ExternalProject_cairo failed with

> Run-time dependency fontconfig found: NO (tried pkgconfig and cmake)
> Not looking for a fallback subproject for the dependency fontconfig because:
> Use of fallback dependencies is disabled.
>
> meson.build:271:17: ERROR: Dependency 'fontconfig' is required but not found.

and

> Called: `/usr/bin/pkg-config --cflags fontconfig` -> 1
> stderr:
> Package libxml-2.0 was not found in the pkg-config search path.
> Perhaps you should add the directory containing `libxml-2.0.pc'
> to the PKG_CONFIG_PATH environment variable
> Package 'libxml-2.0', required by 'fontconfig', not found

in workdir/UnpackedTarball/cairo/builddir/meson-logs/meson-log.txt, because
workdir/UnpackedTarball/fontconfig/fontconfig.pc contains

> Requires.private:  libxml-2.0 >= 2.6

so add workdir/UnpackedTarball/libxml2/libxml-2.0.pc to PKG_CONFIG_PATH (TODO:
even though its contents point to /usr/local? but that seems good enough to get
the build going).

For another,

> [LNK] Executable/soffice.js: wait for lock at Mon Sep 29 10:23:58 AM UTC 2025
> [LNK] Executable/soffice.js: got link lock at Mon Sep 29 10:24:03 AM UTC 2025
> em++: error: /home/sberg/lo-wasm-upstream/core/workdir/UnpackedTarball/pixman/pixman/.libs/libpixman-1.a: No such file or directory ("/home/sberg/lo-wasm-upstream/core/workdir/UnpackedTarball/pixman/pixman/.libs/libpixman-1.a" was expected to be an input file, based on the commandline arguments provided)
> make[1]: *** [/home/sberg/lo-wasm-upstream/core/desktop/Executable_soffice_bin.mk:10: /home/sberg/lo-wasm-upstream/core/instdir/program/soffice.js] Error 1

failed to link, so adapt the path in RepositoryExternal.mk.

Change-Id: I925f4fbcaabd58b0de074575293ba9b5366f2cf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191623
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-09-29 16:20:17 +02:00
Caolán McNamaraandNoel Grandin 2b515d095d upgrade pixman and cairo
Co-authored-by: Noel Grandin <noel.grandin@collabora.co.uk>

Change-Id: I21b8c772138b544d3192b786a6bae4c64ebcac94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191199
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-09-27 21:38:46 +02:00
Stephan Bergmann 4ad6309f5b external/cairo: Silence some -Wincompatible-pointer-types
...as seen at least when doing an Emscripten build against emsdk 4.0.15 (which
uses a Clang with
<https://github.com/llvm/llvm-project/commit/b24769855d97697de08e2296a548c033f193caf4>
"[Clang] [Sema] Make `-Wincompatible-pointer-types` an error by default
(#157364)"),

> cairo-image-source.c:89:33: error: incompatible pointer types passing 'pixman_image_t **' (aka 'union pixman_image **') to parameter of type 'void **' [-Wincompatible-pointer-types]
>    89 |         if (_cairo_atomic_ptr_cmpxchg (&__pixman_transparent_image,
>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./cairo-atomic-private.h:143:34: note: expanded from macro '_cairo_atomic_ptr_cmpxchg'
>   143 |   _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
>       |                                  ^
> ./cairo-atomic-private.h:136:39: note: passing argument to parameter 'x' here
>   136 | _cairo_atomic_ptr_cmpxchg_impl(void **x, void *oldv, void *newv)
>       |                                       ^
> cairo-image-source.c:121:33: error: incompatible pointer types passing 'pixman_image_t **' (aka 'union pixman_image **') to parameter of type 'void **' [-Wincompatible-pointer-types]
>   121 |         if (_cairo_atomic_ptr_cmpxchg (&__pixman_black_image,
>       |                                        ^~~~~~~~~~~~~~~~~~~~~
> ./cairo-atomic-private.h:143:34: note: expanded from macro '_cairo_atomic_ptr_cmpxchg'
>   143 |   _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
>       |                                  ^
> ./cairo-atomic-private.h:136:39: note: passing argument to parameter 'x' here
>   136 | _cairo_atomic_ptr_cmpxchg_impl(void **x, void *oldv, void *newv)
>       |                                       ^
> cairo-image-source.c:153:33: error: incompatible pointer types passing 'pixman_image_t **' (aka 'union pixman_image **') to parameter of type 'void **' [-Wincompatible-pointer-types]
>   153 |         if (_cairo_atomic_ptr_cmpxchg (&__pixman_white_image,
>       |                                        ^~~~~~~~~~~~~~~~~~~~~
> ./cairo-atomic-private.h:143:34: note: expanded from macro '_cairo_atomic_ptr_cmpxchg'
>   143 |   _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
>       |                                  ^
> ./cairo-atomic-private.h:136:39: note: passing argument to parameter 'x' here
>   136 | _cairo_atomic_ptr_cmpxchg_impl(void **x, void *oldv, void *newv)
>       |                                       ^

Change-Id: Ie7e6424350b60e61db2cc13c17fa14b1cc0e9944
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191368
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-09-22 21:53:57 +02:00
Caolán McNamara edc6033e39 don't require pkg-config on macOS either
Change-Id: Icaca4f047060c73dee9562385fb3d5e3f6b99cd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191316
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-09-22 12:46:03 +02:00
Noel Grandin 1f9fa0dd5b fix cairo null pointer deref
when running with internal cairo and the gen backend

Change-Id: Iec847b5f9fe97faefc1304e0e153ed81f8e1c9b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189983
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-08-21 12:45:28 +02:00
Xisco Fauli 3709789a58 gbuild: set default patchlevel to 1
Change-Id: I195dbafff63e21a22edf438f5b9ed5beee4dac03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183784
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-04-08 09:24:08 +02:00
Stephan Bergmann 375c3952c0 Revert "remove unnecessary cairo soname patch"
This reverts commit 3500c44bcc.

Reason for revert: At least for Linux --without-system-cairo builds, this causes
workdir/UnpackedTarball/cairo/src/.libs/libcairo.so (which is the lib that other
libs like Library_drawinglayer and Library_vcl will link against) to have an
SONAME of libcairo.so.2 (instead of libcairo-lo.so.2), so at runtime libs like
instdir/program/libdrawinglayerlo.so and instdir/program/libvcllo.so will have a
NEEDED of libcairo.so.2 (instead of libcairo-lo.so.2), so will pick up whatever
system libcairo.so.2 (/usr/lib64/libcairo.so.2 from cairo-1.18.2-2.fc41.x86_64,
in my case) instead of instdir/program/libcairo-lo.so.2, which caused e.g.
CppunitTest_vcl_bitmap_render_test
CPPUNIT_TEST_NAME=BitmapRenderTest::testTdf113918 to happen to fail for me with

> [_RUN_____] BitmapRenderTest::testTdf113918
> warn:vcl.gdi:2234659:2234659:vcl/headless/CairoCommon.cxx:1619: unsupported SvpSalGraphics::drawAlphaBitmap case
> vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx:100:BitmapRenderTest::testTdf113918
> equality assertion failed
> - Expected: rgba[ffffffff]
> - Actual  : rgba[008000ff]

Change-Id: I9a2a64197185b7c057352c3fb7f3e3f6dbcf70db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180884
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-01-29 14:45:54 +01:00
Noel Grandin 3500c44bcc remove unnecessary cairo soname patch
This was introduced by
    commit 2def5485aa57d7c407a84ecc73b22083579e9a98
    Author: Tor Lillqvist <tml@collabora.com>
    Date:   Tue Sep 20 16:07:14 2022 +0300
    Enable opening of downloaded fonts only in ForKit in Online

but we don't need to this, since we rename the .so file when we copy it
in external/cairo/ExternalPackage_cairo.mk

This change makes a later patch less noisy/

Change-Id: I06f78d7ff068df14e95542391e20b669487ebb5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180794
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-01-28 07:16:10 +01:00
Caolán McNamara a662e7a4eb MSAN: Use-of-uninitialized-value
==10765==WARNING: MemorySanitizer: use-of-uninitialized-value
 #0 0x5a74216f620b in _cairo_path_fixed_fill_rectilinear_tessellate_to_boxes workdir/UnpackedTarball/cairo/src/cairo-path-fill.c:288:5
 #1 0x5a74216f620b in _cairo_path_fixed_fill_rectilinear_to_boxes workdir/UnpackedTarball/cairo/src/cairo-path-fill.c:345:12
 #2 0x5a7421735497 in _cairo_spans_compositor_fill workdir/UnpackedTarball/cairo/src/cairo-spans-compositor.c:1121:11

num_limits is 0 here so this is apparently cosmetic

Change-Id: Ib07259ce653414c9381c800355a648ab025d1919
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172457
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-27 16:39:22 +02:00
Caolán McNamara 06a2805d88 cool#7015 fix rgba emojis
We initially added this for android so we could match the OpenGL GL_RGBA
layout available there. Later we made it available for all platforms via
--enable-cairo-rgba which is useful for the kit case.

But along the line color emoji support was added to cairo which wasn't
present at the time of the original patch, so now capture those uses
as well.

https: //github.com/CollaboraOnline/online/issues/7015
Change-Id: I6039607a46a58a7e9cbf5c052e6fb34234fd19b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167225
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-05-07 20:57:04 +02:00
Christian Lohmaier 875a1bf2e1 makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo)
…by a simple/static $(gb_UnpackedTarball_workdir)/foo
see also 0c4c84a14b

Change-Id: I8e6aa55c85534c4446556548910c950ddbe7c6fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167163
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2024-05-06 11:40:45 +02:00
Stephan Bergmann f7371ed8c1 Silence UBSan misaligned-pointer-use
...as seen during CppunitTest_sd_import_tests2,

> pixman-sse2.c:522:16: runtime error: load of misaligned address 0x5170000a4f83 for type 'const uint32_t *' (aka 'const unsigned int *'), which requires 4 byte alignment
> 0x5170000a4f83: note: pointer points here
>  00  b8 ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff c0 00  b8 ff ff ff ff ff ff
>               ^
>  #0 in combine1 at workdir/UnpackedTarball/pixman/pixman/pixman-sse2.c:522:5
>  #1 in sse2_combine_add_u at workdir/UnpackedTarball/pixman/pixman/pixman-sse2.c:1366:6
>  #2 in sse2_composite_add_8_8 at workdir/UnpackedTarball/pixman/pixman/pixman-sse2.c:4490:2
>  #3 in add_glyphs at workdir/UnpackedTarball/pixman/pixman/pixman-glyph.c:615:6
>  #4 in pixman_composite_glyphs at workdir/UnpackedTarball/pixman/pixman/pixman-glyph.c:673:5
>  #5 in composite_glyphs at workdir/UnpackedTarball/cairo/src/cairo-image-compositor.c:941:2
>  #6 in composite_glyphs at workdir/UnpackedTarball/cairo/src/cairo-traps-compositor.c:2295:12
>  #7 in clip_and_composite at workdir/UnpackedTarball/cairo/src/cairo-traps-compositor.c:1049:15
>  #8 in _cairo_traps_compositor_glyphs at workdir/UnpackedTarball/cairo/src/cairo-traps-compositor.c:2331:11
>  #9 in _cairo_compositor_glyphs at workdir/UnpackedTarball/cairo/src/cairo-compositor.c:292:11
>  #10 in _cairo_image_surface_glyphs at workdir/UnpackedTarball/cairo/src/cairo-image-surface.c:1030:12
>  #11 in _cairo_surface_show_text_glyphs at workdir/UnpackedTarball/cairo/src/cairo-surface.c:2920:15
>  #12 in _cairo_gstate_show_text_glyphs at workdir/UnpackedTarball/cairo/src/cairo-gstate.c:2077:15
>  #13 in _cairo_default_context_glyphs at workdir/UnpackedTarball/cairo/src/cairo-default-context.c:1334:12
>  #14 in cairo_show_glyphs at workdir/UnpackedTarball/cairo/src/cairo.c:3670:14
>  #15 in CairoTextRender::DrawTextLayout(GenericSalLayout const&, SalGraphics const&) at vcl/unx/generic/gdi/cairotextrender.cxx:476:9
>  #16 in SvpSalGraphics::DrawTextLayout(GenericSalLayout const&) at vcl/headless/svptext.cxx:72:23
>  #17 in GenericSalLayout::DrawText(SalGraphics&) const at vcl/source/gdi/CommonSalLayout.cxx:171:18
>  #18 in OutputDevice::ImplDrawTextDirect(SalLayout&, bool) at vcl/source/outdev/text.cxx:331:16
>  #19 in OutputDevice::ImplDrawText(SalLayout&) at vcl/source/outdev/text.cxx:482:9
>  #20 in OutputDevice::DrawTextArray(Point const&, rtl::OUString const&, KernArraySpan, std::span<unsigned char const, 18446744073709551615ul>, int, int, SalLayoutFlags, SalLayoutGlyphs const*) at vcl/source/outdev/text.cxx:951:9
>  #21 in drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(drawinglayer::primitive2d::TextSimplePortionPrimitive2D const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:422:33
>  #22 in drawinglayer::processor2d::VclPixelProcessor2D::processTextSimplePortionPrimitive2D(drawinglayer::primitive2d::TextSimplePortionPrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:404:9
>  #23 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:200:13
>  #24 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21
>  #25 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13
>  #26 in drawinglayer::primitive2d::GroupPrimitive2D::getChildren(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&) const at include/drawinglayer/primitive2d/groupprimitive2d.hxx:76:90
>  #27 in drawinglayer::primitive2d::GroupPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/groupprimitive2d.cxx:53:13
>  #28 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24
>  #29 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13
>  #30 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21
>  #31 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13
>  #32 in drawinglayer::primitive2d::GroupPrimitive2D::getChildren(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&) const at include/drawinglayer/primitive2d/groupprimitive2d.hxx:76:90
>  #33 in drawinglayer::primitive2d::GroupPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/groupprimitive2d.cxx:53:13
>  #34 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24
>  #35 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13
>  #36 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21
>  #37 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13
>  #38 in drawinglayer::primitive2d::GroupPrimitive2D::getChildren(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&) const at include/drawinglayer/primitive2d/groupprimitive2d.hxx:76:90
>  #39 in drawinglayer::primitive2d::GroupPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/groupprimitive2d.cxx:53:13
>  #40 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24
>  #41 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13
>  #42 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21
>  #43 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13
>  #44 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14
>  #45 in drawinglayer::primitive2d::SdrTextPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx:235:47
>  #46 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24
>  #47 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13
>  #48 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21
>  #49 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13
>  #50 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14
>  #51 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24
>  #52 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13
>  #53 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21
>  #54 in sdr::contact::ObjectContactOfPageView::DoProcessDisplay(sdr::contact::DisplayInfo&) at svx/source/sdr/contact/objectcontactofpageview.cxx:279:31
>  #55 in sdr::contact::ObjectContactOfPageView::ProcessDisplay(sdr::contact::DisplayInfo&) at svx/source/sdr/contact/objectcontactofpageview.cxx:117:21
>  #56 in SdrPageWindow::RedrawAll(sdr::contact::ViewObjectContactRedirector*) at svx/source/svdraw/sdrpagewindow.cxx:354:28
>  #57 in SdrPageView::CompleteRedraw(SdrPaintWindow&, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) at svx/source/svdraw/svdpagv.cxx:239:18
>  #58 in SdrPaintView::DoCompleteRedraw(SdrPaintWindow&, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) at svx/source/svdraw/svdpntv.cxx:610:21
>  #59 in SdrPaintView::CompleteRedraw(OutputDevice*, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) at svx/source/svdraw/svdpntv.cxx:523:5
>  #60 in sd::View::CompleteRedraw(OutputDevice*, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) at sd/source/ui/view/sdview.cxx:498:17
>  #61 in sd::DrawView::CompleteRedraw(OutputDevice*, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) at sd/source/ui/view/drawview.cxx:517:17
>  #62 in sd::DrawDocShell::Draw(OutputDevice*, JobSetup const&, unsigned short, bool) at sd/source/ui/docshell/docshel2.cxx:112:12
>  #63 in SfxObjectShell::DoDraw_Impl(OutputDevice*, Point const&, Fraction const&, Fraction const&, JobSetup const&, unsigned short, bool) at sfx2/source/doc/objembed.cxx:204:5
>  #64 in SfxObjectShell::DoDraw(OutputDevice*, Point const&, Size const&, JobSetup const&, unsigned short, bool) at sfx2/source/doc/objembed.cxx:151:9
>  #65 in SfxObjectShell::CreatePreview_Impl(bool, VirtualDevice*, GDIMetaFile*) const at sfx2/source/doc/objcont.cxx:197:40
>  #66 in SfxObjectShell::GetPreviewBitmap() const at sfx2/source/doc/objcont.cxx:109:9
>  #67 in SfxObjectShell::WriteThumbnail(bool, com::sun::star::uno::Reference<com::sun::star::io::XStream> const&) at sfx2/source/doc/objstor.cxx:3738:31
>  #68 in SfxObjectShell::GenerateAndStoreThumbnail(bool, com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&) at sfx2/source/doc/objstor.cxx:3696:33
>  #69 in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) at sfx2/source/doc/objstor.cxx:1469:19
>  #70 in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objstor.cxx:2992:39
>  #71 in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objstor.cxx:2782:9
>  #72 in SfxObjectShell::APISaveAs_Impl(std::basic_string_view<char16_t, std::char_traits<char16_t>>, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objserv.cxx:319:19
>  #73 in SfxBaseModel::impl_store(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, bool) at sfx2/source/doc/sfxbasemodel.cxx:3191:42
>  #74 in SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1801:13
>  #75 in UnoApiTest::saveWithParams(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at test/source/unoapi_test.cxx:213:16
>  #76 in UnoApiTest::save(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:178:5
>  #77 in UnoApiTest::saveAndReload(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:218:5
>  #78 in testOverflowBehaviorClip::TestBody() at sd/qa/unit/import-tests2.cxx:1899:5

Change-Id: Iea3e107608137c4dec9103ee0b04e801284b5fa9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158018
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-16 14:08:05 +02:00
Stephan Bergmann 233e0a009a A more principled suppression of -fsanitize=function in external C code
...after
<https://github.com/llvm/llvm-project/commit/279a4d0d67c874e80c171666822f2fabdd6fa926>
"-fsanitize=function: support C".

This includes reverts of 16af9e8186 "update clang
asan suppressions" and 151a43f3d0 ""update clang
asan suppressions".

Change-Id: I49740f5f3a784af1d62b830b47bfdfa27fe3e471
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156935
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-09-15 07:58:37 +02:00
Caolán McNamara 9b84955c11 cairo RGBA needs to take account of custom RGB24_888 format
Change-Id: I929d20f134c4fb7dedfd2c581263c303cae87eea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154080
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-06 10:18:32 +02:00
Caolán McNamara 22ab4f30ac add an --enable-cairo-rgba to set the order of pixels for internal cairo
Change-Id: Ieab2ef59f63a7722bffea3273d2eeefadef47b56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153628
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-27 10:04:36 +02:00
Caolán McNamara 00ede35a52 ofz#57493 reduce num_edges required to trigger
Change-Id: Idb6127d8943dbf62d8cacb7f2f5382a1e8619aae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151869
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-05-17 13:59:50 +02:00
Caolán McNamara 354cfa20af ofz#57493 Timeout in _cairo_bo_event_queue_sort with > 200000 edges
Change-Id: Id925da604647973977c25bbbfa57b1a69382e063
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151665
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-05-11 14:38:36 +02:00
Tor Lillqvist a62cb6db82 It seems to work to compile also the MMX code for WASM
Change-Id: I27b56297a07e248102cae1bee4074b7be422ce23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147875
Tested-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2023-02-27 10:55:10 +00:00
Stephan Bergmann 9eaa1325a0 Only package the external/cairo library that is named the same as the SONAME
Change-Id: Id97fe380c3e3976e56a6962eaebfbd696bab7332
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146908
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-13 15:49:21 +00:00
Tor Lillqvist d5f5f09845 Use SIMD in pixman for WASM
Emscripten and WASM do have some support for SSSE3, so let's try to
use it, with -msimd128. See
https://emscripten.org/docs/porting/simd.html.

WASM is not x86, though, so avoid use of inline x86 assembly, like the
CPUID instruction.

Emscripten does not have <mmintrin.h> but does have <xmmintrin.h>,
<emmintrin.h>, and <tmmintrin.h>.

Change-Id: Ic3a47291f6c6dee6843e93ccecc92a643b269cb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146691
Tested-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2023-02-09 14:55:26 +00:00
Tor Lillqvist d552b4a549 Enable opening of downloaded fonts only in ForKit in Online
We want that only the ForKit process needs to have access to new font
files added to a Collabora Online instance dynamically by downloading
from a server. There are however many locations in the Kit process, in
core and in external libraries like harfbuzz, where the code wants to
open a font file.

Handle this so that the ForKit process opens such a downloaded font
file and doesn't close it. The file descriptor is thus inherited by
Kit processes.  The font file pathname passed on to other code is a
fake on in the format "/:FD:/%d" where the %d is the file descriptor
of the opened font file. Add checks in all places where font files are
opened, look for this special pathname format, and modify the code to
just dup() the already open file descriptor in that case.

All this is relevant for Linux only, as Collabora Online runs on
Linux.

Do the above for harfbuzz, cairo, fontconfig, and freetype.

In addition make sure that these libraries (except harfbuzz which
needs to be a static library and freetype) when bundled, on Linux, are
built as shared libraries, and won't be confused with the
corresponding system libraries by making sure their sonames are
different.

Change-Id: Ib059cb27e1637d07bb709249abd0d984f948caa9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140714
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146341
Tested-by: Jenkins
2023-02-09 13:47:02 +00:00
Tor Lillqvist 5cd3a8ec6d Enforce compiling cairo and pixman for WASM with -O3
Earlier, no -O flag at all got used in the cairo and pixman
builds. Which was sad, as these two libraries are performance-critical.

Yes, this change is quick-and-dirty. The proper way would be to modify
things in solenv/gbuild. But that is somewhat complicated.

In general it seems fairly hard to make sure the same compiler flags
get used for every external bundled library. Each external library is
a special snowflake, more or less, with a differently structured
ExternalProject makefile.

For instance for the libwpd library (just picked randomly as an
example), even -O2 gets used. (Which as such is OK.) This despite
solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk apparently trying to
enforce use of -O1 for Emscripten.

This change has a visible impact on the performance of COWASM.

Change-Id: I99d74db2da733134fde16661881856f9a81100f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146009
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2023-01-23 22:58:54 +00:00
Caolán McNamara fc7068d648 if we --disable-arm-neon then also use the new --disable-arm-a64-neon
alternatively -fno-integrated-as is a suggestion at
https://gitlab.freedesktop.org/pixman/pixman/-/issues/45

Change-Id: I9b16d235d24f3d0a87507bdd0c6d5d397ac45d91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143481
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-11-30 12:12:15 +01:00
Taichi Haradaguchi 93a69d37c1 pixman: upgrade to release 0.42.2
Fixes CVE-2022-44638

Remove Wincompatible-function-pointer-types.patch.0, fixed upstream.

Change-Id: If6589a701a252f71da145264ee3a6f0e333492ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143423
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-11-29 14:18:28 +01:00
Thorsten Behrens dff1d7526f Don't use pthread for cairo
For cross builds, odd cases of cairo configure picking up wrong librt
and then missing pthread functions - so lets just disable it, we're
not using cairo multi-threaded anyway.

Change-Id: Id8b6426203859e7bf082d71ad8cf4548928d6acc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143390
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-11-29 01:55:50 +01:00
Stephan Bergmann ae3965f6cc external/cairo: Remove dead code from cairo.RGB24_888.patch
...now that ab157ab93e "move part of sanitizer
patch to the patch that introduced the problem" unilaterally folded in here the
content of f5e1314ffa "external/cairo: Fix
previous -fsanitize=alignment fix", about which that commit's message had
stated:  "The following line

>       pixel &= 0x00ffffff; /* ignore next pixel bits */

should no longer be necessary now, and it is probably better to directly fix the
original code in external/cairo/cairo/cairo-1.10.2.patch, but I'll leave that
for a potential follow-up fix, once the provenance and assumed quality of that
original CAIRO_FORMAT_RGB24_888 code is clarified."  (The provenance and quality
of that code is still not clarified though, see the still unanswered question in
the comment at
<https://gerrit.libreoffice.org/c/core/+/116637/2#message-407ec72875fcb015a3024f9a7ebf8480513b1e5e>
"external/cairo: Fix previous -fsanitize=alignment fix".)

Change-Id: Ic729bff238a35fac69d048b7c3912dd706a5b601
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139211
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-09-02 08:37:40 +02:00
Caolán McNamara 08fc49843f document attempt to upstream cairo patches
Change-Id: If3fc80931a544030a6cef97978f9fed835b4530b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139095
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-31 14:14:05 +02:00
Caolán McNamara ab157ab93e move part of sanitizer patch to the patch that introduced the problem
Change-Id: I3fdec4dd5ae93187aebb4a17f9fb01f0a536c9cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139094
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-31 14:13:50 +02:00
Caolán McNamara 0a54d331f4 ofz#50805 crash seen in fuzzing libreoffice text rendering
Change-Id: I8af207ff21399f1bc3f36c01b7d2912692cbb06b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139093
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-31 14:13:32 +02:00
Caolán McNamara 995ae3dc84 ofz: -Wp,-D_FORTIFY_SOURCE=2 in cairo a problem with msan
Change-Id: I5c7bc7b9a370ee3a5c7dd3f7a2c92c5f2b193d58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138920
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-27 12:45:52 +02:00
Stephan Bergmann 49f392feb9 external/cairo: Fix -Wincompatible-function-pointer-types
...with recent Clang 16 trunk since
<https://github.com/llvm/llvm-project/commit/af01f717c48f0fd2481600ed6c00441763365b62>
"Default implicit function pointer conversions diagnostic to be an error",
causing

> pixman-bits-image.c:1184:39: error: incompatible function pointer types passing 'const float (int, int)' to parameter of type 'dither_factor_t' (aka 'float (*)(int, int)') [-Wincompatible-function-pointer-types]
>         buffer = dither_apply_ordered (iter, dither_factor_blue_noise_64);
>                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> pixman-bits-image.c:1130:60: note: passing argument to parameter 'factor' here
> dither_apply_ordered (pixman_iter_t *iter, dither_factor_t factor)
>                                                            ^
> pixman-bits-image.c:1189:39: error: incompatible function pointer types passing 'const float (int, int)' to parameter of type 'dither_factor_t' (aka 'float (*)(int, int)') [-Wincompatible-function-pointer-types]
>         buffer = dither_apply_ordered (iter, dither_factor_bayer_8);
>                                              ^~~~~~~~~~~~~~~~~~~~~
> pixman-bits-image.c:1130:60: note: passing argument to parameter 'factor' here
> dither_apply_ordered (pixman_iter_t *iter, dither_factor_t factor)
>                                                            ^

Change-Id: I3e28280c9c25dfb7cee5155719a71655db00e344
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138265
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-15 11:17:16 +02:00
Stephan Bergmann cf7e3ac040 Reinstate external/cairo/cairo/san.patch.0
(Instead of just removing any hunks that no longer applied,
86132d8188 "upgrade to cairo 1.17.6" had dropped
it completely presumably in error.)

Change-Id: I98fe20fc96bd5ce9400b6ad6a9837b21f08cdff0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133892
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-05 18:03:52 +02:00
Caolán McNamara 86132d8188 upgrade to cairo 1.17.6
Change-Id: Ibdf84df380c89d3a0713163920a576bf1c47873a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133825
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-04 21:08:12 +02:00
Luboš Luňák 1ffd6897dd try to use also proper debug LDFLAGS for externals libraries
This is basically ea68de2968 but
for LDFLAGS. A number of external libs cannot use this because
their libtool mishandles -fuse-ld.

Change-Id: Idee379eb0a3afb475b536519ee3de064b4e218f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133639
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-01 05:47:22 +02:00
Luboš Luňák ea68de2968 use gb_DEBUGINFO_FLAGS consistently in gbuild ExternalProject's
A number of them didn't use it at all, others had it hand-written
in various ways.

Change-Id: Iaf86325f9cdc032926bac917dc3eef4e34661544
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132818
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-12 13:57:32 +02:00