crashtesting: assert on reimport of docx export of ooo102874-2.doc
[LibreOffice.git] / bridges / Library_cpp_uno.mk
blob94f17f0149b00c6f9539ae0e0b0b96665dfe03ab
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval $(call gb_Library_Library,$(CPPU_ENV)_uno))
12 ifeq ($(CPUNAME),ARM)
14 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
15 bridges_SELECTED_BRIDGE := gcc3_linux_arm
16 bridge_noopt_objects := cpp2uno except uno2cpp
17 # HACK
18 $(call gb_Library_get_linktarget_target,gcc3_uno) : \
19 $(gb_CustomTarget_workdir)/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.objectlist
20 $(call gb_Library_get_linktarget_target,gcc3_uno) : \
21 EXTRAOBJECTLISTS += $(gb_CustomTarget_workdir)/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.objectlist
22 endif
24 else ifeq ($(CPUNAME),AARCH64)
26 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX MACOSX NETBSD OPENBSD,$(OS)),)
27 bridges_SELECTED_BRIDGE := gcc3_linux_aarch64
28 bridge_asm_objects := vtableslotcall
29 bridge_exception_objects := abi cpp2uno uno2cpp
31 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno, \
32 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/callvirtualfunction, \
33 $(if $(HAVE_GCC_STACK_CLASH_PROTECTION),-fno-stack-clash-protection) \
34 $(if $(COM_IS_CLANG),-fasynchronous-unwind-tables) \
37 else ifeq ($(OS),iOS)
38 bridges_SELECTED_BRIDGE := gcc3_ios
39 bridge_noopt_objects := cpp2uno except uno2cpp
40 bridge_asm_objects := ios64_helper
42 else ifeq ($(COM),MSC)
43 bridges_SELECTED_BRIDGE := msvc_win32_arm64
44 bridge_exception_objects := cpp2uno uno2cpp abi
45 bridge_noopt_objects := except
46 bridge_asm_objects := callvirtualfunction vtableslotcall
48 endif
50 else ifeq ($(CPUNAME),AXP)
52 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
53 bridges_SELECTED_BRIDGE := gcc3_linux_alpha
54 bridge_exception_objects := cpp2uno except uno2cpp
55 endif
57 else ifeq ($(CPUNAME),HPPA)
59 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
60 bridges_SELECTED_BRIDGE := gcc3_linux_hppa
61 bridge_noopt_objects := call cpp2uno except uno2cpp
62 endif
64 else ifeq ($(CPUNAME),IA64)
66 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
67 bridges_SELECTED_BRIDGE := gcc3_linux_ia64
68 bridge_asm_objects := call
69 bridge_exception_objects := except
70 bridge_noopt_objects := cpp2uno uno2cpp
71 endif
73 else ifeq ($(CPUNAME),INTEL)
75 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU,$(OS)),)
76 bridges_SELECTED_BRIDGE := gcc3_linux_intel
77 bridge_asm_objects := call
78 bridge_exception_objects := cpp2uno except uno2cpp
79 bridge_noncallexception_objects := callvirtualmethod
80 else ifeq ($(COM),MSC)
81 bridges_SELECTED_BRIDGE := msvc_win32_intel
82 bridge_exception_objects := cpp2uno uno2cpp
83 bridge_noopt_objects := except
84 else ifeq ($(OS),EMSCRIPTEN)
85 bridges_SELECTED_BRIDGE := gcc3_wasm
86 bridge_exception_objects := abi cpp2uno uno2cpp
87 $(eval $(call gb_Library_add_generated_asmobjects,$(CPPU_ENV)_uno, \
88 CustomTarget/bridges/gcc3_wasm/generated-asm \
90 $(eval $(call gb_Library_add_generated_exception_objects,$(CPPU_ENV)_uno, \
91 CustomTarget/bridges/gcc3_wasm/generated-cxx \
93 $(eval $(call gb_Library_use_static_libraries,$(CPPU_ENV)_uno, \
94 emscriptencxxabi \
96 endif
98 else ifeq ($(CPUNAME),M68K)
100 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
101 bridges_SELECTED_BRIDGE := gcc3_linux_m68k
102 bridge_noopt_objects := cpp2uno except uno2cpp
103 endif
105 else ifeq ($(CPUNAME),MIPS)
107 ifneq ($(filter LINUX,$(OS)),)
108 bridges_SELECTED_BRIDGE := gcc3_linux_mips
109 bridge_noopt_objects := cpp2uno uno2cpp
110 bridge_exception_objects := except
111 endif
113 else ifeq ($(CPUNAME),MIPS64)
115 ifneq ($(filter LINUX,$(OS)),)
116 bridges_SELECTED_BRIDGE := gcc3_linux_mips64
117 bridge_asm_objects := call
118 bridge_noopt_objects := cpp2uno uno2cpp
119 bridge_exception_objects := except
120 endif
122 else ifeq ($(CPUNAME),LOONGARCH64)
124 ifneq ($(filter LINUX,$(OS)),)
125 bridges_SELECTED_BRIDGE := gcc3_linux_loongarch64
126 bridge_asm_objects := call
127 bridge_noopt_objects := abi cpp2uno uno2cpp
128 bridge_exception_objects := except
129 endif
131 else ifeq ($(CPUNAME),RISCV64)
133 ifneq ($(filter LINUX,$(OS)),)
134 bridges_SELECTED_BRIDGE := gcc3_linux_riscv64
135 bridge_asm_objects := call
136 bridge_noopt_objects := abi cpp2uno uno2cpp
137 bridge_exception_objects := except
138 endif
140 else ifeq ($(CPUNAME),POWERPC)
142 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
143 bridges_SELECTED_BRIDGE := gcc3_linux_powerpc
144 bridge_noopt_objects := uno2cpp
145 bridge_exception_objects := cpp2uno except
146 endif
148 else ifeq ($(CPUNAME),POWERPC64)
150 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
151 bridges_SELECTED_BRIDGE := gcc3_linux_powerpc64
152 bridge_noopt_objects := cpp2uno uno2cpp
153 bridge_exception_objects := except
154 endif
156 else ifeq ($(CPUNAME),S390X)
158 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
159 bridges_SELECTED_BRIDGE := gcc3_linux_s390x
160 bridge_exception_objects := cpp2uno except uno2cpp
161 endif
163 else ifeq ($(CPUNAME),SPARC)
165 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
166 bridges_SELECTED_BRIDGE := gcc3_linux_sparc
167 bridge_asm_objects := call
168 bridge_noopt_objects := except
169 bridge_exception_objects := cpp2uno uno2cpp
170 endif
172 else ifeq ($(OS)-$(CPUNAME),LINUX-SPARC64)
174 bridges_SELECTED_BRIDGE := gcc3_linux_sparc64
175 bridge_asm_objects := call
176 bridge_noopt_objects := cpp2uno uno2cpp
177 bridge_exception_objects := except
179 else ifeq ($(CPUNAME),X86_64)
181 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU,$(OS)),)
182 bridges_SELECTED_BRIDGE := gcc3_linux_x86-64
183 bridge_asm_objects := call
184 bridge_noncallexception_noopt_objects := callvirtualmethod
185 bridge_exception_objects := abi cpp2uno except rtti uno2cpp
186 else ifneq ($(filter MACOSX iOS,$(OS)),)
187 bridges_SELECTED_BRIDGE := gcc3_macosx_x86-64
188 bridge_exception_objects := abi call cpp2uno except uno2cpp
189 bridge_noncallexception_noopt_objects := callvirtualmethod
190 else ifeq ($(COM),MSC)
191 bridges_SELECTED_BRIDGE := msvc_win32_x86-64
192 bridge_exception_objects := cpp2uno uno2cpp
193 bridge_noopt_objects := except
194 bridge_asm_objects := call
195 endif
197 endif
199 $(eval $(call gb_Library_use_internal_comprehensive_api,$(CPPU_ENV)_uno,\
200 udkapi \
203 ifeq ($(OS),MACOSX)
204 ifeq ($(CPUNAME),AARCH64)
205 $(eval $(call gb_Library_use_internal_comprehensive_api,$(CPPU_ENV)_uno,\
206 offapi \
208 endif
209 endif
211 $(eval $(call gb_Library_set_include,$(CPPU_ENV)_uno,\
212 -I$(SRCDIR)/bridges/inc \
213 $$(INCLUDE) \
216 ifeq ($(HAVE_POSIX_FALLOCATE),YES)
217 $(eval $(call gb_Library_add_defs,$(CPPU_ENV)_uno,\
218 -DHAVE_POSIX_FALLOCATE \
220 endif
222 # In case someone enabled the non-standard -fomit-frame-pointer which does not
223 # work with the .cxx sources of this library.
224 # LTO causes crashes when enabled for this library
225 # In case the compiler supports AVX this code segfaults so specifically turn
226 # it off.
227 ifeq ($(COM),GCC)
228 $(eval $(call gb_Library_add_cxxflags,gcc3_uno,\
229 -fno-omit-frame-pointer \
230 -fno-strict-aliasing \
231 -fno-lto \
232 $(if $(filter TRUE,$(HAVE_GCC_AVX)),-mno-avx) \
235 ifeq ($(filter ANDROID WNT DRAGONFLY FREEBSD NETBSD OPENBSD MACOSX iOS HAIKU,$(OS)),)
236 $(eval $(call gb_Library_add_libs,gcc3_uno,\
237 -ldl \
239 endif
240 endif
242 ifeq ($(COM),GCC)
243 ifneq ($(COM_IS_CLANG),TRUE)
244 bridges_NON_CALL_EXCEPTIONS_FLAGS := -fnon-call-exceptions
245 endif
246 endif
248 $(eval $(call gb_Library_use_libraries,$(CPPU_ENV)_uno,\
249 cppu \
250 sal \
253 $(foreach obj,$(bridge_exception_objects),\
254 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
255 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj))) \
257 $(foreach obj,$(bridge_noncallexception_objects),\
258 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
259 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
260 , $(bridges_NON_CALL_EXCEPTIONS_FLAGS) )) \
262 $(foreach obj,$(bridge_noopt_objects),\
263 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
264 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
265 , $(gb_COMPILERNOOPTFLAGS))) \
267 $(foreach obj,$(bridge_noncallexception_noopt_objects),\
268 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
269 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
270 , $(gb_COMPILERNOOPTFLAGS) $(bridges_NON_CALL_EXCEPTIONS_FLAGS) )) \
272 $(foreach obj,$(bridge_cxx_objects),\
273 $(eval $(call gb_Library_add_cxxobjects,$(CPPU_ENV)_uno,\
274 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj))) \
276 $(foreach obj,$(bridge_asm_objects),\
277 $(eval $(call gb_Library_add_asmobjects,$(CPPU_ENV)_uno,\
278 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj))) \
281 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
282 bridges/source/cpp_uno/shared/bridge \
283 bridges/source/cpp_uno/shared/component \
284 bridges/source/cpp_uno/shared/types \
285 bridges/source/cpp_uno/shared/unointerfaceproxy \
286 bridges/source/cpp_uno/shared/vtablefactory \
287 bridges/source/cpp_uno/shared/vtables \
290 ifeq ($(COM),MSC)
291 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
292 bridges/source/cpp_uno/msvc_shared/cpp2uno \
293 bridges/source/cpp_uno/msvc_shared/except \
295 endif
297 $(eval $(call gb_Library_add_cxxobjects,$(CPPU_ENV)_uno,\
298 bridges/source/cpp_uno/shared/cppinterfaceproxy \
299 , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
302 ifeq ($(DISABLE_DYNLOADING),TRUE)
303 $(eval $(call gb_Library_set_plugin_for_nodep,$(CPPU_ENV)_uno,cppu))
304 endif
306 # vim: set noet sw=4 ts=4: