external/redland/ExternalProject_raptor.mk  |    2 ++
 external/redland/UnpackedTarball_redland.mk |    1 +
 external/redland/redland/ubsan.patch        |   11 +++++++++++
 3 files changed, 14 insertions(+)

New commits:
commit c34bc3841fece7d432f9749753e442c2a3a1d716
Author:     Christian Lohmaier <[email protected]>
AuthorDate: Wed Jul 17 13:38:22 2024 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Feb 3 16:41:09 2025 +0100

    fix raptor build when using system-icu
    
    Change-Id: I1671e5872deb583c1c0395ab49ab33b171d0e086
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170620
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <[email protected]>
    (cherry picked from commit c1b00424f17eaea8f55565dae285521c1ec4d042)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174003
    Tested-by: Stephan Bergmann <[email protected]>
    Reviewed-by: Stephan Bergmann <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181059
    Reviewed-by: Andras Timar <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/external/redland/ExternalProject_raptor.mk 
b/external/redland/ExternalProject_raptor.mk
index 31face289f6d..8b800f76eea0 100644
--- a/external/redland/ExternalProject_raptor.mk
+++ b/external/redland/ExternalProject_raptor.mk
@@ -14,7 +14,9 @@ $(eval $(call gb_ExternalProject_use_externals,raptor,\
        libxml2 \
 ))
 
+ifeq ($(SYSTEM_ICU),)
 $(eval $(call gb_ExternalProject_use_package,raptor,icu_ure))
+endif
 
 $(eval $(call gb_ExternalProject_register_targets,raptor,\
        build \
commit 9c16014322c57726a200e8f915e2c11f8af52f9c
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Wed Jul 10 11:19:36 2024 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Feb 3 16:40:57 2025 +0100

    Fix UBSan build of ExternalProject_redland
    
    ...after c75c21eef670fce33eb5a501357935dbd25be923 "Upgrade raptor to 
2.0.16",
    where it now started to fail with
    
    > libtool: link: LD_RUN_PATH="/usr/local/lib:" /usr/bin/ccache 
/home/tdf/lode/opt_private/clang-llvmorg-12.0.1/bin/clang 
--gcc-toolchain=/opt/rh/gcc-toolset-12/root/usr -fsanitize=address 
-fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=local-bounds 
-fsanitize-blacklist=/home/tdf/lode/jenkins/workspace/lo_ubsan/sanitize-ubsan-excludelist
 -fno-sanitize=function -DLIBRDF_INTERNAL=1 -O0 -Wp,-U_FORTIFY_SOURCE 
-fstrict-aliasing -fstrict-overflow -ggdb2 -gsplit-dwarf -Xclang 
-debug-info-kind=constructor -Wl,-z -Wl,origin -Wl,-rpath -Wl,\$ORIGIN 
-Wl,-rpath-link -Wl,/home/tdf/lode/jenkins/workspace/lo_ubsan/instdir/program 
-Wl,-z -Wl,origin -Wl,-rpath -Wl,\$ORIGIN -Wl,-rpath-link 
-Wl,/home/tdf/lode/jenkins/workspace/lo_ubsan/instdir/program -o 
.libs/redland-db-upgrade db_upgrade.o  
-L/home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/UnpackedTarball/raptor/src/.libs
 
/home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/UnpackedTarball/raptor/src/.libs/libraptor2.so
 -L/home/tdf/
 lode/jenkins/workspace/lo_ubsan/workdir/UnpackedTarball/libxml2/.libs 
/home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/UnpackedTarball/libxml2/.libs/libxml2.so
 
-L/home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/UnpackedTarball/rasqal/src/.libs
 
/home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/UnpackedTarball/rasqal/src/.libs/librasqal.so
 ../src/.libs/librdf.so
    > /opt/rh/gcc-toolset-12/root/usr/bin/ld: 
/home/tdf/lode/jenkins/workspace/lo_ubsan/instdir/program/libicuuc.so.74: 
undefined reference to `__ubsan_vptr_type_cache'
    > /opt/rh/gcc-toolset-12/root/usr/bin/ld: 
/home/tdf/lode/jenkins/workspace/lo_ubsan/instdir/program/libicuuc.so.74: 
undefined reference to `__ubsan_handle_function_type_mismatch_v1'
    > /opt/rh/gcc-toolset-12/root/usr/bin/ld: 
/home/tdf/lode/jenkins/workspace/lo_ubsan/instdir/program/libicuuc.so.74: 
undefined reference to `__ubsan_handle_dynamic_type_cache_miss'
    > clang-12: error: linker command failed with exit code 1 (use -v to see 
invocation)
    > make[3]: *** [Makefile:489: redland-db-upgrade] Error 1
    
    (<https://ci.libreoffice.org/job/lo_ubsan/3239/>) because $(CC) is used to 
link
    a (nominally C-only) executable that links against C++ ICU shared libraries 
that
    in turn require a C++-specific UBSan library to be linked in.  So just use
    $(CXX) for linking instead.
    
    Change-Id: If7c61c6ee7e1b43965a928b1560f8ab4ae2b0603
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170277
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit b3300387f2e14ea59c70db513a8f6eda6fe17afa)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173793
    Tested-by: Stephan Bergmann <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181058
    Reviewed-by: Andras Timar <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/external/redland/UnpackedTarball_redland.mk 
b/external/redland/UnpackedTarball_redland.mk
index 66e766d20fee..31ebcb8f2f0a 100644
--- a/external/redland/UnpackedTarball_redland.mk
+++ b/external/redland/UnpackedTarball_redland.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,redland,\
        external/redland/redland/rpath.patch \
        external/redland/redland/clang-cl.patch \
        external/redland/redland/libtool.patch \
+       external/redland/redland/ubsan.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/redland/redland/ubsan.patch 
b/external/redland/redland/ubsan.patch
new file mode 100644
index 000000000000..8226258ea38b
--- /dev/null
+++ b/external/redland/redland/ubsan.patch
@@ -0,0 +1,11 @@
+--- utils/Makefile.in
++++ utils/Makefile.in
+@@ -106,7 +106,7 @@
+ AM_V_at = $(am__v_at_@AM_V@)
+ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+ am__v_at_0 = @
+-CCLD = $(CC)
++CCLD = $(CXX)
+ LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@

Reply via email to