13f6d80330
A full `make check screenshot` required lots of little "harmless" fixes in pixman and cairo to address: > cairo-image-compositor.c:133:34: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' during CppunitTest_emfio_emf > pixman-fast-path.c:3089:23: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' during CppunitTest_emfio_emf > pixman-sse2.c:5019:17: runtime error: load of misaligned address 0x7f99303dbac5 for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment during CppunitTest_emfio_emf > cairo-fixed-private.h:64:14: runtime error: left shift of negative value -8388608 during CppunitTest_emfio_wmf > pixman-sse2.c:6443:20: runtime error: left shift of 198 by 24 places cannot be represented in type 'int' during CppunitTest_filter_svg > pixman-sse2.c:5976:6: runtime error: load of misaligned address 0x629000163202 for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment during CppunitTest_filter_svg > pixman-sse2.c:3259:10: runtime error: load of misaligned address 0x606000c85761 for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment during CppunitTest_oox_vml > pixman-sse2.c:521:18: runtime error: load of misaligned address 0x607000ca9d41 for type 'const uint32_t' (aka 'const unsigned int'), which requires 4 byte alignment during CppunitTest_oox_vml > pixman-gradient-walker.c:196:14: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' during CppunitTest_sc_tiledrendering > pixman-combine32.c:786:1: runtime error: left shift of 255 by 24 places cannot be represented in type 'int32_t' (aka 'int') during CppunitTest_vcl_backend_test > pixman-fast-path.c:2761:29: runtime error: left shift of negative value -99 during CppunitTest_xmloff_draw > pixman-bits-image.c:243:31: runtime error: left shift of negative value -99 during CppunitTest_xmloff_draw > pixman-bits-image.c:244:31: runtime error: left shift of negative value -9 during CppunitTest_sd_tiledrendering > pixman-fast-path.c:2762:29: runtime error: left shift of negative value -84 during CppunitTest_sw_rtfexport2 > cairo-gstate.c:2300:14: runtime error: null pointer passed as argument 1, which is declared to never be null during CppunitTest_sw_ooxmlexport8 > pixman-access.c:389:2: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' during CppunitTest_sw_ooxmlexport15 > ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ff264ae275c at pc 0x7ff238941795 bp 0x7fff6bbadb10 sp 0x7fff6bbadb08 > READ of size 4 at 0x7ff264ae275c thread T0 > #0 in _add_clipped_edge at workdir/UnpackedTarball/cairo/src/cairo-polygon.c:351:24 (instdir/program/libcairo.so.2 +0x88c794) during CppunitTest_sw_odfexport > cairo-tor-scan-converter.c:1619:34: runtime error: left shift of negative value -39 during CppunitTest_sw_odfexport > ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fe6ca085750 at pc 0x000000325c3a bp 0x7fff899bedd0 sp 0x7fff899be580 > READ of size 16 at 0x7fe6ca085750 thread T0 > #0 in __asan_memcpy at /home/sbergman/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 (workdir/LinkTarget/Executable/cppunittester +0x325c39) during CppunitTest_sw_odfexport > pixman-sse2.c:3352:14: runtime error: left shift of 65535 by 16 places cannot be represented in type 'int' during CppunitTest_sw_odfexport > cairo-gstate.c:2355:14: runtime error: null pointer passed as argument 1, which is declared to never be null during CppunitTest_basctl_dialogs_test > pixman-sse2.c:3537:10: runtime error: load of misaligned address 0x615000167682 for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment during CppunitTest_sc_screenshots > cairo-image-source.c:512:10: runtime error: load of misaligned address 0x6180037aee6f for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment during UITest_writer_tests7 Change-Id: Icd2a211df4751d8dbfd5903bfba424b4c4672999 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104572 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
102 lines
5 KiB
Makefile
102 lines
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_ExternalProject_ExternalProject,cairo))
|
|
|
|
$(eval $(call gb_ExternalProject_use_external_project,cairo,pixman))
|
|
|
|
$(eval $(call gb_ExternalProject_use_externals,cairo,\
|
|
freetype \
|
|
libpng \
|
|
zlib \
|
|
))
|
|
|
|
ifeq ($(OS),ANDROID)
|
|
$(eval $(call gb_ExternalProject_use_unpacked,cairo,fontconfig))
|
|
$(eval $(call gb_ExternalProject_use_unpacked,cairo,libpng))
|
|
endif
|
|
|
|
$(eval $(call gb_ExternalProject_register_targets,cairo,\
|
|
build \
|
|
))
|
|
|
|
ifeq ($(OS),WNT)
|
|
|
|
$(call gb_ExternalProject_get_state_target,cairo,build) :
|
|
$(call gb_Trace_StartRange,cairo,EXTERNAL)
|
|
$(call gb_ExternalProject_run,build,\
|
|
$(MAKE) -f Makefile.win32 CFG=release ZLIB3RDLIB=zlib.lib \
|
|
)
|
|
$(call gb_Trace_EndRange,cairo,EXTERNAL)
|
|
|
|
|
|
else
|
|
|
|
# Including -rtlib=compiler-rt in pixman_LIBS is a BAD HACK: At least when compiling with Clang
|
|
# -fsanitize=undefined on Linux x86-64, the generated code references __muloti4, which is an
|
|
# extension provided by libclang_rt.builtins-x86_64.a runtime, but not by GCC's libgcc_s.so.1 (which
|
|
# ultimately boils down to a bug in LLVM, I would say). I am not sure whether it should in general
|
|
# work to mix uses of the (default on Linux, at least) GCC libgcc_s and LLVM's libclang_rt.builtins
|
|
# runtime libraries in one process, but for this specific case of libcairo.so it appears to work
|
|
# well: For one, the only symbol referenced by libcairo.so from the runtime library is __muloti4;
|
|
# for another, at least in my LLVM build, lib/clang/12.0.0/lib/linux/libclang_rt.builtins-x86_64.a
|
|
# is only provided as a static archive; so libcairo.so will only contain a "harmless" copy of
|
|
# __muloti4 and not have a DT_NEEDED of any libclang_rt.builtins dynamic library that it would pull
|
|
# in at runtime.
|
|
# But passing -rtlib=compiler-rt into cairo's configure via the more obvious LDFLAGS would fail at
|
|
# least when building with -fsanitize=address and -fsanitize=undefined, as then the executable
|
|
# compiled by configure when "checking whether the C compiler works" would reference
|
|
# _Unwind_Backtrace etc. that are provided by GCC's libgcc_s.so.1 but not by LLVM's
|
|
# libclang_rt.builtins-x86_64.a (and whatever the reason for that inconsistency). So
|
|
# -rtlib=compiler-rt must be passed just into the linking of libcairo.so, but not generally into
|
|
# cairo's configure. And pixman_LIBS happens to offer that. (The -Wc is necessary so that libtool
|
|
# does not throw away the -rtlib=compiler-rt which it does not understand.)
|
|
|
|
# overwrite src/cairo-version.h because that is just a dummy file and included
|
|
# from cairo.h in non-overridable way
|
|
|
|
$(call gb_ExternalProject_get_state_target,cairo,build) :
|
|
$(call gb_Trace_StartRange,cairo,EXTERNAL)
|
|
$(call gb_ExternalProject_run,build,\
|
|
./configure \
|
|
$(if $(debug),STRIP=" ") \
|
|
$(if $(filter ANDROID iOS,$(OS)),CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS) $(gb_VISIBILITY_FLAGS)") \
|
|
$(if $(filter-out ANDROID iOS,$(OS)),CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS)" ) \
|
|
$(if $(filter ANDROID iOS,$(OS)),PKG_CONFIG=./dummy_pkg_config) \
|
|
LIBS="$(ZLIB_LIBS)" \
|
|
$(if $(filter -fsanitize=%,$(LDFLAGS)),LDFLAGS="$(LDFLAGS) -fuse-ld=bfd") \
|
|
pixman_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,pixman)/pixman" \
|
|
pixman_LIBS="-L$(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs -lpixman-1 \
|
|
$(if $(filter LINUX,$(OS)),-Wl$(COMMA)-z$(COMMA)origin \
|
|
-Wl$(COMMA)-rpath$(COMMA)\\\$$\$$ORIGIN) \
|
|
$(if $(filter -fsanitize=%,$(CC)), \
|
|
$(if $(filter LINUX-X86_64-TRUE,$(OS)-$(CPUNAME)-$(COM_IS_CLANG)), \
|
|
-Wc$(COMMA)-rtlib=compiler-rt))" \
|
|
png_REQUIRES="trick_configure_into_using_png_CFLAGS_and_LIBS" \
|
|
png_CFLAGS="$(LIBPNG_CFLAGS)" png_LIBS="$(LIBPNG_LIBS)" \
|
|
$(if $(SYSTEM_FREETYPE),,FREETYPE_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,freetype)/include") \
|
|
$(if $(SYSTEM_FONTCONFIG),,FONTCONFIG_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,fontconfig)") \
|
|
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
|
|
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,$(if $(filter ANDROID,$(OS)),--disable-shared,--disable-static)) \
|
|
$(if $(filter ANDROID iOS,$(OS)),--disable-xlib --disable-xcb,$(if $(filter TRUE,$(DISABLE_GUI)),--disable-xlib --disable-xcb,--enable-xlib --enable-xcb)) \
|
|
$(if $(filter iOS,$(OS)),--enable-quartz --enable-quartz-font) \
|
|
--disable-valgrind \
|
|
$(if $(filter iOS,$(OS)),--disable-ft,--enable-ft --enable-fc) \
|
|
--disable-svg --enable-gtk-doc=no --enable-test-surfaces=no \
|
|
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
|
|
$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no ax_cv_c_float_words_bigendian=no)) \
|
|
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
|
|
&& cp cairo-version.h src/cairo-version.h \
|
|
&& cd src && $(MAKE) \
|
|
)
|
|
$(call gb_Trace_EndRange,cairo,EXTERNAL)
|
|
|
|
endif
|
|
|
|
# vim: set noet sw=4 ts=4:
|