office-gobmx/solenv/gbuild/platform/unxgcc.mk
Stephan Bergmann ba2a0eb880 Don't run ExternalExecutable_python with LD_LIBRARY_PATH
257bcb1a11 "get internal python invocations
working" had made this use LD_LIBRARY_PATH or similar on the various platforms,
but without giving any reason what it would actually be good for.
5d8f48c81e "solver doesn't solve anything..." then
(somewhat by chance?) removed it for solenv/gbuild/platform/macosx.mk,
apparently without loss of functionality, but left it intact for other
platforms.

But at least in some Jenkins Linux build environments presence of
LD_LIBRARY_PATH (pointing at instdir/program/) appears to cause subtle problems:
Builds like <https://ci.libreoffice.org/job/lo_tb_master_linux/49844/>
occasionally crashed with

[...]
> make -O
[...]
> [build PAT] python3
> [build PRJ] python3
[...]
> [build PKG] python3
> [build EPK] python3
[...]
> [build BIN] python3
[...]
> [build MOD] python3
[...]
> [build PRJ] nss
[...]
> make[1]: *** Deleting file '/home/tdf/lode/jenkins/workspace/lo_tb_master_linux/workdir/UIConfig/sfx.a11yerrors'
> [build UIA] sfx
> Suppression file: /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/solenv/sanitizers/ui/sfx.suppr
> False positive file: /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/solenv/sanitizers/ui/sfx.false
> sfx2/uiconfig/ui/documentinfopage.ui: WARNING: 'GtkLabel' 'label8' does not specify what it labels within 'interface'
> 1 new warning (64 suppressed by /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/solenv/sanitizers/ui/sfx.suppr, please fix them)
> 0 new fatals (12 suppressed by /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/solenv/sanitizers/ui/sfx.suppr, please fix them)
> Explanations are available on https://wiki.documentfoundation.org/Development/Accessibility
>
> /bin/sh: line 1: 31655 Segmentation fault      (core dumped) LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/program" PYTHONHOME="$I/program/python-core-3.8.12" PYTHONPATH="${PYPATH:+$PYPATH:}$I/program/python-core-3.8.12/lib:$I/program/python-core-3.8.12/lib/lib-dynload" $I/program/python.bin $S/bin/gla11y -P $S/ -f $S/solenv/sanitizers/ui/sfx.false -s $S/solenv/sanitizers/ui/sfx.suppr --widgets-suffixignored +ValueSet,HBox,VBox,ToolBox,Preview,PreviewWin,PreviewWindow,PrevWindow --widgets-button +svtlo-ManagedMenuButton --fatal-all --not-fatal-type duplicate-mnemonic --not-fatal-type labelled-by-and-mnemonic --not-fatal-type orphan-label -o $W/UIConfig/sfx.a11yerrors $S/sfx2/uiconfig/ui/alienwarndialog.ui $S/sfx2/uiconfig/ui/addtargetdialog.ui $S/sfx2/uiconfig/ui/autoredactdialog.ui $S/sfx2/uiconfig/ui/bookmarkdialog.ui $S/sfx2/uiconfig/ui/bookmarkmenu.ui $S/sfx2/uiconfig/ui/charmapcontrol.ui $S/sfx2/uiconfig/ui/charviewmenu.ui $S/sfx2/uiconfig/ui/checkin.ui $S/sfx2/uiconfig/ui/classificationbox.ui $S/sfx2/uiconfig/ui/cmisinfopage.ui $S/sfx2/uiconfig/ui/cmisline.ui $S/sfx2/uiconfig/ui/commandpopup.ui $S/sfx2/uiconfig/ui/custominfopage.ui $S/sfx2/uiconfig/ui/deck.ui $S/sfx2/uiconfig/ui/descriptioninfopage.ui $S/sfx2/uiconfig/ui/developmenttool.ui $S/sfx2/uiconfig/ui/devtoolsmenu.ui $S/sfx2/uiconfig/ui/documentfontspage.ui $S/sfx2/uiconfig/ui/documentinfopage.ui $S/sfx2/uiconfig/ui/documentpropertiesdialog.ui $S/sfx2/uiconfig/ui/editdocumentdialog.ui $S/sfx2/uiconfig/ui/editdurationdialog.ui $S/sfx2/uiconfig/ui/emojicontrol.ui $S/sfx2/uiconfig/ui/extrabutton.ui $S/sfx2/uiconfig/ui/errorfindemaildialog.ui $S/sfx2/uiconfig/ui/floatingrecord.ui $S/sfx2/uiconfig/ui/helpbookmarkpage.ui $S/sfx2/uiconfig/ui/helpcontrol.ui $S/sfx2/uiconfig/ui/helpcontentpage.ui $S/sfx2/uiconfig/ui/helpindexpage.ui $S/sfx2/uiconfig/ui/helpmanual.ui $S/sfx2/uiconfig/ui/helpsearchpage.ui $S/sfx2/uiconfig/ui/helpwindow.ui $S/sfx2/uiconfig/ui/infobar.ui $S/sfx2/uiconfig/ui/inputdialog.ui $S/sfx2/uiconfig/ui/licensedialog.ui $S/sfx2/uiconfig/ui/linefragment.ui $S/sfx2/uiconfig/ui/linkeditdialog.ui $S/sfx2/uiconfig/ui/loadtemplatedialog.ui $S/sfx2/uiconfig/ui/managestylepage.ui $S/sfx2/uiconfig/ui/navigator.ui $S/sfx2/uiconfig/ui/newstyle.ui $S/sfx2/uiconfig/ui/notebookbar.ui $S/sfx2/uiconfig/ui/optprintpage.ui $S/sfx2/uiconfig/ui/panel.ui $S/sfx2/uiconfig/ui/password.ui $S/sfx2/uiconfig/ui/notebookbarpopup.ui $S/sfx2/uiconfig/ui/printeroptionsdialog.ui $S/sfx2/uiconfig/ui/querysavedialog.ui $S/sfx2/uiconfig/ui/saveastemplatedlg.ui $S/sfx2/uiconfig/ui/safemodequerydialog.ui $S/sfx2/uiconfig/ui/searchdialog.ui $S/sfx2/uiconfig/ui/securityinfopage.ui $S/sfx2/uiconfig/ui/singletabdialog.ui $S/sfx2/uiconfig/ui/startcenter.ui $S/sfx2/uiconfig/ui/stylecontextmenu.ui $S/sfx2/uiconfig/ui/tabbar.ui $S/sfx2/uiconfig/ui/tabbarcontents.ui $S/sfx2/uiconfig/ui/tabbutton.ui $S/sfx2/uiconfig/ui/templatedlg.ui $S/sfx2/uiconfig/ui/templatecategorydlg.ui $S/sfx2/uiconfig/ui/templatepanel.ui $S/sfx2/uiconfig/ui/urlbox.ui $S/sfx2/uiconfig/ui/versionsofdialog.ui $S/sfx2/uiconfig/ui/versioncommentdialog.ui $S/sfx2/uiconfig/ui/versionscmis.ui
> /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/solenv/gbuild/UIConfig.mk:157: recipe for target '/home/tdf/lode/jenkins/workspace/lo_tb_master_linux/workdir/UIConfig/sfx.a11yerrors' failed
> make[1]: *** [/home/tdf/lode/jenkins/workspace/lo_tb_master_linux/workdir/UIConfig/sfx.a11yerrors] Error 139
> make[1]: *** Waiting for unfinished jobs....

where the crashed instdir/program/python.bin is at

> (gdb) thread apply all backtrace
>
> Thread 1 (Thread 0x2af0920e1a40 (LWP 30414)):
> #0  0x0000000000000ae0 in ?? ()
> #1  0x00002af0920b008a in _dl_fini () from /lib64/ld-linux-x86-64.so.2
> #2  0x00002af093404ce9 in __run_exit_handlers () from /lib64/libc.so.6
> #3  0x00002af093404d37 in exit () from /lib64/libc.so.6
> #4  0x00002af0933ed55c in __libc_start_main () from /lib64/libc.so.6
> #5  0x000000000040068e in _start ()

with

> (gdb) info sharedlibrary
> From                To                  Syms Read   Shared Object Library
> 0x00002af09232e2f0  0x00002af09253270c  Yes         /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/instdir/program/libpython3.8.so.1.0
> 0x00002af09286fe30  0x00002af092874cec  Yes (*)     /lib64/libcrypt.so.1
> 0x00002af092aab8f0  0x00002af092ab6db1  Yes (*)     /lib64/libpthread.so.0
> 0x00002af092cc2e50  0x00002af092cc394e  Yes (*)     /lib64/libdl.so.2
> 0x00002af092ec6e90  0x00002af092ec77a4  Yes (*)     /lib64/libutil.so.1
> 0x00002af0930ce350  0x00002af093139336  Yes (*)     /lib64/libm.so.6
> 0x00002af0933ea9f0  0x00002af09353ab6f  Yes (*)     /lib64/libc.so.6
> 0x00002af093799a50  0x00002af09379a05a  Yes (*)     /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/instdir/program/libfreebl3.so
> 0x00002af0920a0af0  0x00002af0920bc060  Yes (*)     /lib64/ld-linux-x86-64.so.2
> 0x00002af09a0e3be0  0x00002af09a10aa53  Yes         /home/tdf/lode/jenkins/workspace/lo_tb_master_linux/instdir/program/python-core-3.8.12/lib/lib-dynload/pyexpat.cpython-3.8.so

What is suspicious is that it uses instdir/program/libfreebl3.so when
external/nss has been built ("[build PRJ] nss") but has not yet been fully
delivered (no "[build PKG] nss").  It uses instdir/program/libfreebl3.so because
on that machine instdir/program/python.bin has a DT_NEEDED of libcrypt.so.1 and
/lib64/libcrypt.so.1 has a DT_NEEDED of libfreebl3.so, which the LD_LIBRARY_PATH
then resolves with instdir/program/libfreebl3.so rather than with the expected
/lib64/libfreebl3.so.

So remove setting of LD_LIBRARY_PATH on all the platforms where it was still
used, in the hope that it isn't actually necessary on any of them.  Only on
Windows, setting PATH is still needed (in line with how the Executable_python
wrapper modifies it too) to avoid build failures like

> instdir/program/python-core-3.8.12/bin/python.exe: error while loading shared libraries: python38_d.dll: cannot open shared object file: No such file or directory

Change-Id: I398aa89166a6a7f3db58c4e65237840b73bec74b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130470
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-24 09:42:39 +01:00

423 lines
16 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/.
#
# 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
include $(GBUILDDIR)/platform/com_GCC_defs.mk
gb_MKTEMP := mktemp -t gbuild.XXXXXX
ifneq ($(origin AR),default)
gb_AR := $(AR)
endif
gb_OSDEFS := \
-D$(OS) \
-D_PTHREADS \
-DUNIX \
-DUNX \
$(PTHREAD_CFLAGS) \
$(LFS_CFLAGS) \
gb_CFLAGS := \
$(gb_CFLAGS_COMMON) \
-fPIC \
-Wshadow \
# 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
gb_CXXFLAGS := \
$(gb_CXXFLAGS_COMMON) \
-fPIC \
-Wshadow \
-Woverloaded-virtual \
$(CXXFLAGS_CXX11) \
$(gb_CXX_LINKFLAGS) \
ifneq ($(strip $(SYSBASE)),)
gb_CXXFLAGS += --sysroot=$(SYSBASE)
gb_CFLAGS += --sysroot=$(SYSBASE)
gb_LinkTarget_LDFLAGS += \
-Wl,--sysroot=$(SYSBASE)
endif
ifeq (,$(DISABLE_DYNLOADING))
gb_LinkTarget_LDFLAGS += \
-Wl,-rpath-link,$(SYSBASE)/lib:$(SYSBASE)/usr/lib \
-Wl,-z,combreloc \
endif
ifeq ($(HAVE_LD_HASH_STYLE),TRUE)
gb_LinkTarget_LDFLAGS += \
-Wl,--hash-style=$(WITH_LINKER_HASH_STYLE) \
endif
ifneq ($(HAVE_LD_BSYMBOLIC_FUNCTIONS),)
gb_LinkTarget_LDFLAGS += -Wl,-Bsymbolic-functions
endif
gb_LINKEROPTFLAGS := -Wl,-O1
gb_LINKERSTRIPDEBUGFLAGS := -Wl,-S
# LinkTarget class
define gb_LinkTarget__get_rpath_for_layer
$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS)))
endef
gb_LinkTarget__RPATHS := \
URELIB:\dORIGIN \
UREBIN:\dORIGIN \
OOO:\dORIGIN \
SDKBIN:\dORIGIN/../../program \
OXT: \
NONE:\dORIGIN/../Library \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
gb_LinkTarget__cmd_lockfile = $(if $(LOCKFILE),$(LOCKFILE),$(call gb_Executable_get_command,lockfile))
gb_LinkTarget__Lock := $(WORKDIR)/LinkTarget/link.lock
# 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)" ; \
)
$(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,$(GENNASMOBJECTS),$(call gb_GenNasmObject_get_target,$(object))) \
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)), \
-Wl$(COMMA)--start-group \
$(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)) \
-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 $(call gb_LinkTarget__WantLock,$(2)),; RC=$$? ; rm -f $(gb_LinkTarget__Lock); if test $$RC -ne 0; then exit $$RC; fi))
$(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\
$(READELF) -d $(1) | grep SONAME > $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
$(NM) $(gb_LTOPLUGINFLAGS) --dynamic --extern-only --defined-only --format=posix $(1) \
| cut -d' ' -f1-2 >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
$(call gb_Helper_replace_if_different_and_touch,$(WORKDIR)/LinkTarget/$(2).exports.tmp, \
$(WORKDIR)/LinkTarget/$(2).exports,$(1))))
$(if $(and $(filter CppunitTest Executable,$(TARGETTYPE)),$(filter EMSCRIPTEN,$(OS)),$(filter TRUE,$(ENABLE_QT5))), \
cp $(QT5_PLATFORMS_SRCDIR)/qtlogo.svg $(QT5_PLATFORMS_SRCDIR)/qtloader.js $(dir $(1)) ; \
sed -e 's/@APPNAME@/$(subst $(gb_Executable_EXT),,$(notdir $(1)))/' $(QT5_PLATFORMS_SRCDIR)/wasm_shell.html > $(dir $(1))qt_$(notdir $(1)) ; \
ln -sf $(call gb_CustomTarget_get_workdir,static/emscripten_fs_image)/soffice.data $(dir $(1))/soffice.data ; \
ln -sf $(call gb_CustomTarget_get_workdir,static/emscripten_fs_image)/soffice.data.js.metadata $(dir $(1))/soffice.data.js.metadata ; \
)
endef
define gb_LinkTarget__command_staticlink
$(call gb_Helper_abbreviate_dirs,\
rm -f $(1) && \
$(gb_AR) $(gb_LTOPLUGINFLAGS) -rsu $(1) \
$(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,$(GENNASMOBJECTS),$(call gb_GenNasmObject_get_target,$(object))) \
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \
$(if $(findstring s,$(MAKEFLAGS)),2> /dev/null))
endef
define gb_LinkTarget__command
$(call gb_Output_announce,$(2),$(true),LNK,4)
$(call gb_Trace_StartRange,$(2),LNK)
$(if $(filter CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2)))
$(if $(filter Library,$(TARGETTYPE)),$(if $(filter TRUE,$(DISABLE_DYNLOADING)),$(call gb_LinkTarget__command_staticlink,$(1)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2))))
$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1)))
$(call gb_Trace_EndRange,$(2),LNK)
endef
# Library class
gb_Library_DEFS :=
gb_Library_SYSPRE := lib
gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
ifeq ($(DISABLE_DYNLOADING),TRUE)
gb_Library_PLAINEXT := .a
gb_Library_PLAINEXT_FOR_BUILD := .so
gb_Library_DLLEXT := .a
else
gb_Library_TARGETTYPEFLAGS := -shared -Wl,-z,noexecstack
gb_Library_UDK_MAJORVER := 3
gb_Library_PLAINEXT := .so
gb_Library_PLAINEXT_FOR_BUILD := .so
gb_Library_DLLEXT := .so
endif
gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT)
gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
gb_Library_FILENAMES := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
$(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \
ifeq ($(DISABLE_DYNLOADING),TRUE)
gb_Library_FILENAMES += \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
else
gb_Library_FILENAMES += \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT).$(gb_Library_UDK_MAJORVER)) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT).$(gb_Library_UDK_MAJORVER)) \
endif
gb_Library_LAYER := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
$(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
$(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \
define gb_Library__get_rpath
$(if $(1),$(strip -Wl,-z,origin '-Wl,-rpath,$(1)' -Wl,-rpath-link,$(INSTDIR)/program))
endef
define gb_Library_get_rpath
$(call gb_Library__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1))))
endef
define gb_Library_Library_platform
$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1))
endef
gb_Library__set_soversion_script_platform = $(gb_Library__set_soversion_script)
gb_Library_get_sdk_link_dir = $(INSTDIR)/$(SDKDIRNAME)/lib
gb_Library_get_sdk_link_lib = $(gb_Library_get_versionlink_target)
# Executable class
gb_Executable_EXT :=
gb_Executable_LAYER := \
$(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
$(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
$(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
$(foreach exe,$(gb_Executable_NONE),$(exe):NONE) \
define gb_Executable__get_rpath
$(strip -Wl,-z,origin $(if $(1),'-Wl$(COMMA)-rpath$(COMMA)$(1)') -Wl,-rpath-link,$(INSTDIR)/program)
endef
define gb_Executable_get_rpath
$(call gb_Executable__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1))))
endef
define gb_Executable_Executable_platform
$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Executable_get_rpath,$(1))
endef
# CppunitTest class
gb_CppunitTest_CPPTESTPRECOMMAND := \
$(call gb_Helper_extend_ld_path,$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs)
gb_CppunitTest_get_filename = libtest_$(1).so
gb_CppunitTest_get_ilibfilename = $(gb_CppunitTest_get_filename)
gb_CppunitTest_malloc_check := -ex 'set environment MALLOC_CHECK_=2; set environment MALLOC_PERTURB_=153'
define gb_CppunitTest_CppunitTest_platform
$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,NONE))
endef
define gb_CppunitTest_postprocess
$(SRCDIR)/solenv/bin/gdb-core-bt.sh $(1) $(2) $(3)
endef
# JunitTest class
ifneq ($(OOO_TEST_SOFFICE),)
gb_JunitTest_SOFFICEARG:=$(OOO_TEST_SOFFICE)
else
ifneq ($(gb_JunitTest_DEBUGRUN),)
gb_JunitTest_SOFFICEARG:=connect:pipe,name=$(USER)
else
gb_JunitTest_SOFFICEARG:=path:$(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice
endif
endif
define gb_JunitTest_JunitTest_platform
$(call gb_JunitTest_get_target,$(1)) : DEFS := \
-Dorg.openoffice.test.arg.env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
-Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) \
-Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \
-Dorg.openoffice.test.arg.postprocesscommand=$(SRCDIR)/solenv/bin/gdb-core-bt.sh \
-Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \
endef
# PythonTest class
gb_PythonTest_PRECOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND)
# Module class
define gb_Module_DEBUGRUNCOMMAND
OFFICESCRIPT=`mktemp` && \
printf 'if [ -e $(INSTROOT)/program/ooenv ]; then . $(INSTROOT)/program/ooenv; fi\n' > $${OFFICESCRIPT} && \
printf "PYTHONWARNINGS=default gdb $(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice.bin" >> $${OFFICESCRIPT} && \
printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' %s\"" \
"$(subst ","\\\"",$(value gb_DBGARGS))" >> $${OFFICESCRIPT} && \
$(SHELL) $${OFFICESCRIPT} && \
rm $${OFFICESCRIPT}
endef
# InstallModuleTarget class
define gb_InstallModuleTarget_InstallModuleTarget_platform
$(call gb_InstallModuleTarget_add_defs,$(1),\
$(gb_CPUDEFS) \
$(gb_OSDEFS) \
-DCOMID=gcc3 \
-D_gcc3 \
)
endef
# InstallScript class
gb_InstallScript_EXT := .ins
# CliAssemblyTarget class
gb_CliAssemblyTarget_POLICYEXT :=
gb_CliAssemblyTarget_get_dll :=
# Extension class
gb_Extension_LICENSEFILE_DEFAULT := $(INSTROOT)/LICENSE
# UnpackedTarget class
gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION)
# UnoApiHeadersTarget class
ifeq ($(DISABLE_DYNLOADING),TRUE)
gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
else
gb_UnoApiHeadersTarget_select_variant = $(2)
endif
# UIMenubarTarget class
define gb_UIMenubarTarget__command
$(call gb_Output_announce,$(2),$(true),UIM,1)
$(call gb_Trace_StartRange,$(2),UIM)
cp $(3) $(1)
$(call gb_Trace_EndRange,$(2),UIM)
endef
gb_UIMenubarTarget_UIMenubarTarget_platform :=
# Python
gb_Python_PRECOMMAND := PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$${PYPATH:+$$PYPATH:}$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload"
gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(INSTROOT)/program/python
# this is passed to gdb as executable when running tests
gb_Python_INSTALLED_EXECUTABLE_GDB := $(INSTROOT)/program/python.bin
include $(GBUILDDIR)/platform/com_GCC_class.mk
# vim: set noet sw=4: