office-gobmx/external/redland/UnpackedTarball_redland.mk
Stephan Bergmann b3300387f2 Fix UBSan build of ExternalProject_redland
...after c75c21eef6 "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 <stephan.bergmann@allotropia.de>
2024-07-10 16:06:52 +02:00

39 lines
1.5 KiB
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_UnpackedTarball_UnpackedTarball,redland))
$(eval $(call gb_UnpackedTarball_set_tarball,redland,$(REDLAND_TARBALL),,redland))
$(eval $(call gb_UnpackedTarball_update_autoconf_configs,redland,\
build \
libltdl/config \
))
# configure generated files for MSVC
$(eval $(call gb_UnpackedTarball_add_file,redland,src/librdf.h,external/redland/redland/librdf.h))
$(eval $(call gb_UnpackedTarball_set_patchlevel,redland,0))
# redland-format.patch.0 sent upstream as
# <https://github.com/dajobe/librdf/pull/6>
$(eval $(call gb_UnpackedTarball_add_patches,redland,\
external/redland/redland/redland-freebsd.patch.1 \
external/redland/redland/redland-msvc.patch.1 \
$(if $(filter-out WNT,$(OS)),external/redland/redland/redland-bundled-soname.patch.1) \
$(if $(filter ANDROID,$(OS)),external/redland/redland/redland-android.patch.1) \
$(if $(CROSS_COMPILING),external/redland/redland/redland-xcompile.patch.1) \
external/redland/redland/redland-format.patch.0 \
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: