external/libeot/ExternalProject_libeot.mk |    2 +-
 external/libeot/UnpackedTarball_libeot.mk |    2 ++
 external/libeot/debug-no-werror.patch.0   |   11 +++++++++++
 external/libeot/ubsan.patch.0             |   11 +++++++++++
 4 files changed, 25 insertions(+), 1 deletion(-)

New commits:
commit 17d2a10303272ed90ed0b2fe7ba886a2ab3a65e1
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Fri May 9 09:53:09 2025 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Fri May 9 11:51:17 2025 +0200

    external/libeot: Silence invalid-shift-base
    
    ...as seen during CppunitTest_sd_font_embedding_tests,
    
    > src/EOT.c:15:68: runtime error: left shift of 160 by 24 places cannot be 
represented in type 'int'
    >     #0 0x7f0b39e71791 in EOTreadU32LE 
(/instdir/program/libvcllo.so+0xbbb0791)
    >     #1 0x7f0b39e73882 in EOTfillMetadataSpecifyingVersion 
(/instdir/program/libvcllo.so+0xbbb2882)
    >     #2 0x7f0b39e754a6 in EOTfillMetadata 
(/instdir/program/libvcllo.so+0xbbb44a6)
    >     #3 0x7f0b39e7129e in EOT2ttf_buffer 
(/instdir/program/libvcllo.so+0xbbb029e)
    >     #4 0x7f0b35eb77d9 in 
EmbeddedFontsHelper::addEmbeddedFont(com::sun::star::uno::Reference<com::sun::star::io::XInputStream>
 const&, rtl::OUString const&, std::basic_string_view<char16_t, 
std::char_traits<char16_t> >, std::__debug::vector<unsigned char, 
std::allocator<unsigned char> > const&, bool, bool) 
/vcl/source/gdi/embeddedfontshelper.cxx:120:13
    >     #5 0x7f0acf649034 in 
oox::ppt::EmbeddedFontListContext::onEndElement() 
/oox/source/ppt/EmbeddedFontListContext.cxx:96:30
    >     #6 0x7f0ace1879d4 in 
oox::core::ContextHandler2Helper::implEndElement(int) 
/oox/source/core/contexthandler2.cxx:124:9
    >     #7 0x7f0ace2287c6 in oox::core::FragmentHandler2::endFastElement(int) 
/oox/source/core/fragmenthandler2.cxx:91:5
    >     #8 0x7f0b07f340ca in (anonymous namespace)::Entity::endElement() 
/sax/source/fastparser/fastparser.cxx:515:27
    >     #9 0x7f0b07f33a98 in 
sax_fastparser::FastSaxParserImpl::callbackEndElement() 
/sax/source/fastparser/fastparser.cxx:1340:17
    >     #10 0x7f0b07f23a24 in (anonymous 
namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char 
const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:339:18
    >     #11 0x7f0b4391eb84 in xmlParseEndTag2 
/workdir/UnpackedTarball/libxml2/parser.c:9632:2
    >     #12 0x7f0b438d0124 in xmlParseTryOrFinish 
/workdir/UnpackedTarball/libxml2/parser.c:11374:14
    >     #13 0x7f0b438c4f6c in xmlParseChunk 
/workdir/UnpackedTarball/libxml2/parser.c:11640:5
    >     #14 0x7f0b07f1e811 in sax_fastparser::FastSaxParserImpl::parse() 
/sax/source/fastparser/fastparser.cxx:1091:21
    >     #15 0x7f0b07f18318 in 
sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource
 const&) /sax/source/fastparser/fastparser.cxx:895:9
    >     #16 0x7f0b07f39a50 in 
sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource
 const&) /sax/source/fastparser/fastparser.cxx:1479:13
    >     #17 0x7f0ace1b2541 in 
oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource 
const&, bool) /oox/source/core/fastparser.cxx:121:15
    >     #18 0x7f0ace1b2cd8 in 
oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream>
 const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5
    >     #19 0x7f0ace2871ce in 
oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler>
 const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:421:21
    >     #20 0x7f0ace285a1d in 
oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler>
 const&) /oox/source/core/xmlfilterbase.cxx:351:12
    >     #21 0x7f0acf65bbb2 in oox::ppt::PowerPointImport::importDocument() 
/oox/source/ppt/pptimport.cxx:109:17
    >     #22 0x7f0ace1c54ab in 
oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
 const&) /oox/source/core/filterbase.cxx:486:49
    >     #23 0x7f0acf65f687 in 
oox::ppt::PowerPointImport::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
 const&) /oox/source/ppt/pptimport.cxx:214:24
    >     #24 0x7f0af938ff1a in SfxObjectShell::ImportFrom(SfxMedium&, 
com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) 
/sfx2/source/doc/objstor.cxx:2685:34
    >     #25 0x7f0b01e1acd1 in sd::DrawDocShell::ImportFrom(SfxMedium&, 
com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) 
/sd/source/ui/docshell/docshel4.cxx:458:39
    >     #26 0x7f0af9342ab1 in SfxObjectShell::DoLoad(SfxMedium*) 
/sfx2/source/doc/objstor.cxx:768:23
    >     #27 0x7f0af95d3e84 in 
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
 const&) /sfx2/source/doc/sfxbasemodel.cxx:1986:36
    >     #28 0x7f0af9e36f00 in (anonymous 
namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
 const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) 
/sfx2/source/view/frmload.cxx:771:28
    >     #29 0x7f0ac5b19f36 in framework::LoadEnv::impl_loadContent() 
/framework/source/loadenv/loadenv.cxx:1180:37
    >     #30 0x7f0ac5b10dd2 in framework::LoadEnv::start() 
/framework/source/loadenv/loadenv.cxx:415:20
    >     #31 0x7f0ac5b09292 in framework::LoadEnv::startLoading(rtl::OUString 
const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> 
const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, 
rtl::OUString const&, int, LoadEnvFeatures) 
/framework/source/loadenv/loadenv.cxx:311:5
    >     #32 0x7f0ac5b04674 in 
framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader>
 const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> 
const&, rtl::OUString const&, rtl::OUString const&, int, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
/framework/source/loadenv/loadenv.cxx:167:14
    >     #33 0x7f0ac5bd9348 in 
framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString 
const&, int, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
/framework/source/services/desktop.cxx:594:16
    >     #34 0x7f0ac5bd96c6 in non-virtual thunk to 
framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString 
const&, int, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
/framework/source/services/desktop.cxx
    >     #35 0x7f0adc8e6a09 in 
unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString 
const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> 
const&) /unotest/source/cpp/macros_test.cxx:72:62
    >     #36 0x7f0af3eb9f62 in UnoApiTest::loadWithParams(rtl::OUString 
const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> 
const&) /test/source/unoapi_test.cxx:125:19
    >     #37 0x7f0af3eb9098 in UnoApiTest::loadFromURL(rtl::OUString const&, 
char const*) /test/source/unoapi_test.cxx:107:5
    >     #38 0x7f0af3eba994 in 
UnoApiTest::loadFromFile(std::basic_string_view<char16_t, 
std::char_traits<char16_t> >, char const*) /test/source/unoapi_test.cxx:132:5
    >     #39 0x7f0b0e518798 in SdModelTestBase::createSdImpressDoc(char 
const*, char const*) /sd/qa/unit/sdmodeltestbase.hxx:54:13
    >     #40 0x7f0b0e50fa7d in testRoundtripEmbeddedFontsPPTX::TestBody() 
/sd/qa/unit/FontEmbeddingTest.cxx:49:5
    
    (<https://ci.libreoffice.org/job/lo_ubsan/3555/>)
    
    Change-Id: I0fed461981c812a10ee88ea44629afe6c76525ff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185086
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/external/libeot/UnpackedTarball_libeot.mk 
b/external/libeot/UnpackedTarball_libeot.mk
index 9a781c99798f..40ac1cbb0b94 100644
--- a/external/libeot/UnpackedTarball_libeot.mk
+++ b/external/libeot/UnpackedTarball_libeot.mk
@@ -10,6 +10,7 @@
 libeot_patches :=
 libeot_patches += 0001-remove-unused-err.h.patch
 libeot_patches += debug-no-werror.patch.0
+libeot_patches += ubsan.patch.0
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,libeot))
 
diff --git a/external/libeot/ubsan.patch.0 b/external/libeot/ubsan.patch.0
new file mode 100644
index 000000000000..62673c275ca9
--- /dev/null
+++ b/external/libeot/ubsan.patch.0
@@ -0,0 +1,11 @@
+--- src/EOT.c
++++ src/EOT.c
+@@ -12,7 +12,7 @@
+ 
+ uint32_t EOTreadU32LE(const uint8_t *bytes)
+ {
+-  return bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24);
++  return ((uint32_t)bytes[0]) | (((uint32_t)bytes[1]) << 8) | 
(((uint32_t)bytes[2]) << 16) | (((uint32_t)bytes[3]) << 24);
+ }
+ 
+ uint16_t EOTreadU16LE(const uint8_t *bytes)
commit a3c7481469af82a3df8cb14a07db75ffb2e3ef92
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Fri May 9 09:44:54 2025 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Fri May 9 11:51:06 2025 +0200

    external/libeot: Conditionally --enable/disable-debug
    
    But --enable-debug also unconditionally enables -Werror, and which would 
start
    to cause lots of warning errors, so patch that out.
    
    Change-Id: I9df4b3c924d6490c4f0c01d68808fb875e0517ee
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185085
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/external/libeot/ExternalProject_libeot.mk 
b/external/libeot/ExternalProject_libeot.mk
index 95b5128a9d63..b60ac86d5b55 100644
--- a/external/libeot/ExternalProject_libeot.mk
+++ b/external/libeot/ExternalProject_libeot.mk
@@ -22,7 +22,7 @@ $(call gb_ExternalProject_get_state_target,libeot,build) :
                        --with-pic \
                        --enable-static \
                        --disable-shared \
-                       --disable-debug \
+                       $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
                        $(gb_CONFIGURE_PLATFORMS) \
                && $(MAKE) $(if $(verbose),V=1) libeot.la \
        )
diff --git a/external/libeot/UnpackedTarball_libeot.mk 
b/external/libeot/UnpackedTarball_libeot.mk
index 669dc1ecd76a..9a781c99798f 100644
--- a/external/libeot/UnpackedTarball_libeot.mk
+++ b/external/libeot/UnpackedTarball_libeot.mk
@@ -9,6 +9,7 @@
 
 libeot_patches :=
 libeot_patches += 0001-remove-unused-err.h.patch
+libeot_patches += debug-no-werror.patch.0
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,libeot))
 
diff --git a/external/libeot/debug-no-werror.patch.0 
b/external/libeot/debug-no-werror.patch.0
new file mode 100644
index 000000000000..eb916b72e277
--- /dev/null
+++ b/external/libeot/debug-no-werror.patch.0
@@ -0,0 +1,11 @@
+--- Makefile.in
++++ Makefile.in
+@@ -365,7 +365,7 @@
+ eot2ttf_LDADD = libeot.la
+ eot2ttf_SOURCES = src/eot2ttf.c
+ common_flags = --std=c99 -DDECOMPRESS_ON
+-debug_flags = -Werror -Wall -g -O0 $(common_flags)
++debug_flags = -Wall -g -O0 $(common_flags)
+ release_flags = -O2 $(common_flags)
+ @DEBUG_FALSE@eot2ttf_CFLAGS = $(release_flags)
+ @DEBUG_TRUE@eot2ttf_CFLAGS = $(debug_flags)

Reply via email to