[Libreoffice-commits] core.git: Branch 'aoo/trunk' - solenv/gbuild
Damjan Jovanovic
damjan at apache.org
Tue Nov 28 05:09:35 UTC 2017
solenv/gbuild/Library.mk | 1 +
solenv/gbuild/LinkTarget.mk | 9 +++++++++
solenv/gbuild/platform/freebsd.mk | 2 ++
solenv/gbuild/platform/linux.mk | 2 ++
solenv/gbuild/platform/macosx.mk | 2 ++
solenv/gbuild/platform/os2.mk | 2 ++
solenv/gbuild/platform/solaris.mk | 2 ++
7 files changed, 20 insertions(+)
New commits:
commit 0c9f2c424899159f628527f0e88c07f35b30b5ca
Author: Damjan Jovanovic <damjan at apache.org>
Date: Tue Nov 28 04:44:42 2017 +0000
Add the ability to set a linker script in gbuild that is used to
version symbols.
This has been a bottleneck in continued gbuild porting and should
help further development considerably.
Patch by: me
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index ec46b2836913..68c000d860c0 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -133,6 +133,7 @@ $(eval $(foreach method,\
add_package_headers \
add_sdi_headers \
add_precompiled_header \
+ set_versionmap \
,\
$(call gb_Library__forward_to_Linktarget,$(method))\
))
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index b9c068e50825..18e79404a1aa 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -308,6 +308,8 @@ $(call gb_LinkTarget_get_headers_target,%) : $(call gb_LinkTarget_get_external_h
# files.
# - TARGETTYPE is the type of linktarget as some platforms need very different
# command to link different targettypes.
+# - VERSIONMAP is the linker script, usually used to version a dynamic
+# library's symbols (on *nix/Mac).
#
# Since most variables are set on the linktarget and not on the object, the
# object learns about these setting via GNU makes scoping of target variables.
@@ -351,6 +353,7 @@ $(call gb_LinkTarget_get_target,$(1)) : LINKED_STATIC_LIBS :=
$(call gb_LinkTarget_get_target,$(1)) : EXTERNAL_LIBS :=
$(call gb_LinkTarget_get_target,$(1)) : LIBS :=
$(call gb_LinkTarget_get_target,$(1)) : TARGETTYPE :=
+$(call gb_LinkTarget_get_target,$(1)) : VERSIONMAP :=
$(call gb_LinkTarget_get_headers_target,$(1)) \
$(call gb_LinkTarget_get_target,$(1)) : PCH_NAME :=
$(call gb_LinkTarget_get_target,$(1)) : PCHOBJS :=
@@ -373,6 +376,7 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : PCH_DEFS := $$(gb_LinkTarget_DEFAULT
$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE := $$(gb_LinkTarget_INCLUDE)
$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE_STL := $$(gb_LinkTarget_INCLUDE_STL)
$(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE :=
+$(call gb_LinkTarget_get_dep_target,$(1)) : VERSIONMAP :=
$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_NAME :=
endif
@@ -681,6 +685,11 @@ $(call gb_LinkTarget_get_target,$(1)) \
$(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE := $(2)
endef
+define gb_LinkTarget_set_versionmap
+$(call gb_LinkTarget_get_target,$(1)) \
+$(call gb_LinkTarget_get_dep_target,$(1)) : VERSIONMAP := $(2)
+endef
+
define gb_LinkTarget_set_dlltarget
$(call gb_LinkTarget_get_clean_target,$(1)) \
$(call gb_LinkTarget_get_target,$(1)) : DLLTARGET := $(2)
diff --git a/solenv/gbuild/platform/freebsd.mk b/solenv/gbuild/platform/freebsd.mk
index 2c7c64f45ce1..8e1fe297b4e2 100644
--- a/solenv/gbuild/platform/freebsd.mk
+++ b/solenv/gbuild/platform/freebsd.mk
@@ -256,6 +256,7 @@ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
$(gb_CXX) \
$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
+ $(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
@@ -298,6 +299,7 @@ gb_Library_STLEXT := port_gcc$(gb_Library_PLAINEXT)
else
gb_Library_STLEXT := port_gcc_stldebug$(gb_Library_PLAINEXT)
endif
+gb_Library_VERSIONMAPFLAG := -Wl,--version-script
ifeq ($(CPUNAME),X86_64)
gb_Library_OOOEXT := $(gb_Library_PLAINEXT)
diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk
index a4098b4875a9..29d006244bc2 100644
--- a/solenv/gbuild/platform/linux.mk
+++ b/solenv/gbuild/platform/linux.mk
@@ -245,6 +245,7 @@ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
$(gb_CXX) \
$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
+ $(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
@@ -288,6 +289,7 @@ gb_Library_STLEXT := port_gcc$(gb_Library_PLAINEXT)
else
gb_Library_STLEXT := port_gcc_stldebug$(gb_Library_PLAINEXT)
endif
+gb_Library_VERSIONMAPFLAG := -Wl,--version-script
ifeq ($(CPUNAME),X86_64)
gb_Library_OOOEXT := $(gb_Library_PLAINEXT)
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index ba286760ef14..e71036bb22d9 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -281,6 +281,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
+ $(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \
$(call gb_LinkTarget__get_liblinkflags,$(LINKED_LIBS)) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
@@ -319,6 +320,7 @@ endef
gb_Library_DEFS :=
gb_Library_TARGETTYPEFLAGS := -dynamiclib -single_module
+gb_Library_VERSIONMAPFLAG := -Wl,-exported_symbols_list
gb_Library_SYSPRE := lib
gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
gb_Library_PLAINEXT := .dylib
diff --git a/solenv/gbuild/platform/os2.mk b/solenv/gbuild/platform/os2.mk
index 48a350ac0526..2ff75021c9aa 100644
--- a/solenv/gbuild/platform/os2.mk
+++ b/solenv/gbuild/platform/os2.mk
@@ -322,6 +322,7 @@ $(call gb_Helper_abbreviate_dirs_native,\
$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \
$(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
+ $(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \
$(T_LDFLAGS) \
@$${RESPONSEFILE} \
$(if $(DLLTARGET), $(DLLDEF)) \
@@ -361,6 +362,7 @@ endef
gb_Library_DEFS := -D_DLL_
gb_Library_TARGETTYPEFLAGS := -Zdll
+gb_Library_VERSIONMAPFLAG := -Wl,--version-script
gb_Library_get_rpath :=
gb_Library_SYSPRE :=
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index 47f38ff7c68e..e28309e8ca00 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -205,6 +205,7 @@ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
$(gb_CXX) \
$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
+ $(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
@@ -246,6 +247,7 @@ gb_Library_STLEXT := port_sunpro$(gb_Library_PLAINEXT)
else
gb_Library_STLEXT := port_sunpro_debug$(gb_Library_PLAINEXT)
endif
+gb_Library_VERSIONMAPFLAG := -M
ifeq ($(CPUNAME),INTEL)
gb_Library_OOOEXT := $(gb_Library_PLAINEXT)
More information about the Libreoffice-commits
mailing list