# -*- 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/. # # This file incorporates work covered by the following license notice: # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed # with this work for additional information regarding copyright # ownership. The ASF licenses this file to you under the Apache # License, Version 2.0 (the "License"); you may not use this file # except in compliance with the License. You may obtain a copy of # the License at http://www.apache.org/licenses/LICENSE-2.0 . #
# to block heavy exception handling that try to acquire the solarmutex export LO_LEAN_EXCEPTION=1
# At least libstdc++ needs -pthread when including various C++ headers like <thread>, see # <https://gcc.gnu.org/onlinedocs/gcc-8.3.0/libstdc++/manual/manual/using.html # #manual.intro.using.flags>: ifneq ($(HAVE_LIBSTDCPP),)
gb_CXX_LINKFLAGS := -pthread endif # libc++ needs it too ifneq ($(HAVE_LIBCPP),)
gb_CXX_LINKFLAGS := -pthread endif
# No newline or space before endef! define gb_LinkTarget__WantLock
$(if $(strip $(and \
$(call gb_CondExeLockfile,$(true)), \
$(filter-out Executable/lockfile,$(1)), \
$(if $(filter FUZZERS,$(BUILD_TYPE)),,$(DISABLE_DYNLOADING)), \
$(filter CppunitTest Executable,$(TARGETTYPE)) \
)),$(true)) endef
# In theory would need to track, if any of the linked objects is C++ code, so for the static build we assume yes :-(
gb_LinkTarget__NeedsCxxLinker = $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS)$(filter-out XTRUE,X$(ENABLE_RUNTIME_OPTIMIZATIONS)$(DISABLE_DYNLOADING)),$(true))
# note that `cat $(extraobjectlist)` is needed to build with older gcc versions, e.g. 4.1.2 on SLED10 # we want to use @$(extraobjectlist) in the long run # link with C compiler if there are no C++ files (pyuno_wrapper depends on this) # But always link with C++ compiler e.g. under -fsanitize=undefined, as sal uses # __ubsan_handle_dynamic_type_cache_miss_abort and __ubsan_vptr_type_cache from # libclang_rt.ubsan_cxx-x86_64.a, and oosplash links against sal but itself only # contains .c sources: define gb_LinkTarget__command_dynamiclink
$(if $(call gb_LinkTarget__WantLock,$2), \ echo"$(call gb_Output_announce_str,$(2): wait for lock at $$(date -u),$(true),LNK,5)" ; \
$(gb_LinkTarget__cmd_lockfile) -r -1 $(gb_LinkTarget__Lock) ; \ echo"$(call gb_Output_announce_str,$(2): got link lock at $$(date -u),$(true),LNK,5)" ; \
)
+$(if $(filter EMSCRIPTEN,$(OS)),unset PYTHONWARNINGS &&) \
$(call gb_Helper_abbreviate_dirs,\
$(if $(call gb_LinkTarget__NeedsCxxLinker),$(or $(T_CXX),$(gb_CXX)) $(gb_CXX_LINKFLAGS),$(or $(T_CC),$(gb_CC))) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(T_LTOFLAGS) \
$(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--soname=$(notdir $(1)) \
-Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT)) \
$(subst \d,$$,$(RPATH)) \
$(T_USE_LD) $(T_LDFLAGS) $(foreach pre_js,$(T_PREJS), --pre-js $(pre_js)) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
$(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \
$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
$(foreach object,$(GENASMOBJECTS),$(call gb_GenAsmObject_get_target,$(object))) \
$(foreach object,$(GENNASMOBJECTS),$(call gb_GenNasmObject_get_target,$(object))) \
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)), \
-Wl$(COMMA)--start-group \
$(shell echo -n \
$(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(patsubst %.$(gb_Library_UDK_MAJORVER),%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \
$(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
$(patsubst $(gb_LinkTarget__syslib),%,$(T_LIBS)) \
$(if $(call gb_LinkTarget__NeedsCxxLinker),$(T_STDLIBS_CXX)) \
| tee $@.linkdeps) \
-Wl$(COMMA)--end-group \
, \
-Wl$(COMMA)--start-group \
$(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
$(T_LIBS) \
$(if $(call gb_LinkTarget__NeedsCxxLinker),$(T_STDLIBS_CXX)) \
-Wl$(COMMA)--end-group \
-Wl$(COMMA)--no-as-needed \
$(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(patsubst %.$(gb_Library_UDK_MAJORVER),%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \
) \
-o $(1) \
$(if $(SOVERSIONSCRIPT),&& ln -sf ../../program/$(notdir $(1)) $(ILIBTARGET)) \
$(if $(filter EMSCRIPTEN,$(OS)),$(if $(filter TRUE,$(HAVE_EXTERNAL_DWARF)),&& emdwp -e $(patsubst %$(gb_Executable_EXT),%.wasm,$(1)) -o $(patsubst %$(gb_Executable_EXT),%.wasm.dwp,$(1)))) \
$(if $(call gb_LinkTarget__WantLock,$(2)),; RC=$$? ; rm -f $(gb_LinkTarget__Lock); if test $$RC -ne 0; then exit $$RC; fi))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.