diff options
author | Richard PALO <richard@NetBSD.org> | 2014-11-10 17:36:30 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-11-12 13:17:24 +0000 |
commit | 573506c778410fc0eb6afc0c07bdd849613503a8 (patch) | |
tree | 62ecdd9cc3b4988d52efd91ebf99e328bf337b15 | |
parent | c22480ada409325a1c9a67dd06ce95b1028cb07e (diff) |
in general, SOLARIS should use /usr/bin/ld.
Make equivalent to unxgcc.mk (with gld).
NB: use $(READELF) updated in configure.ac and config_host.mk.in
Signed-off-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit d6afd367167ed406cd97192da358b776dbf5158e)
Conflicts:
solenv/gbuild/platform/solaris.mk
note: while cherry-picking to master, removed all mention of toolchains
that are unsupported on master due to lack of C++11 support (GCC < 4.6).
Change-Id: Iaf175fb7db095c567e9837eac8456c0c3809e334
Reviewed-on: https://gerrit.libreoffice.org/12384
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | solenv/gbuild/platform/solaris.mk | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index 1d3c256b07c0..3b44e8c34517 100644 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -25,15 +25,6 @@ ifneq ($(origin AR),default) gb_AR := $(AR) endif -# use CC/CXX if they are nondefaults -ifneq ($(origin CC),default) -gb_CC := $(CC) -gb_GCCP := $(CC) -endif -ifneq ($(origin CXX),default) -gb_CXX := $(CXX) -endif - ifeq ($(CPUNAME),SPARC) gb_CPUDEFS := -D__sparcv8plus endif @@ -61,7 +52,7 @@ gb_CXXFLAGS := \ -fPIC \ -Wshadow \ -Woverloaded-virtual \ - -std=c++0x \ + $(CXXFLAGS_CXX11) \ # enable debug STL ifeq ($(gb_ENABLE_DBGUTIL),$(true)) @@ -77,8 +68,6 @@ gb_LinkTarget_LDFLAGS += \ -Wl,--sysroot=$(SYSBASE) endif -#JAD# -Wl,-rpath-link,$(SYSBASE)/lib:$(SYSBASE)/usr/lib \ - gb_LinkTarget_LDFLAGS += \ -L$(SYSBASE)/lib \ -L$(SYSBASE)/usr/lib \ @@ -104,6 +93,12 @@ else gb_LINKEROPTFLAGS := -Wl,-O1 endif +ifeq ($(gb_SYMBOL),$(true)) +gb_LINKERSTRIPDEBUGFLAGS := +else +gb_LINKERSTRIPDEBUGFLAGS := -Wl,-zredlocsym -Wl,-znoldynsym +endif + # LinkTarget class define gb_LinkTarget__get_rpath_for_layer @@ -122,18 +117,20 @@ gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CFLAGS_WERROR) ifeq ($(gb_SYMBOL),$(true)) -gb_LinkTarget_CXXFLAGS += -ggdb2 -gb_LinkTarget_CFLAGS += -ggdb2 +gb_LinkTarget_CXXFLAGS += $(GGDB2) +gb_LinkTarget_CFLAGS += $(GGDB2) endif # 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) define gb_LinkTarget__command_dynamiclink $(call gb_Helper_abbreviate_dirs,\ $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ - $(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--soname=$(notdir $(1)) \ - -Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT)) \ + $(gb_LTOFLAGS) \ + $(if $(SOVERSIONSCRIPT),-Wl$(COMMA)-soname=$(notdir $(1)) \ + ) \ $(subst \d,$$,$(RPATH)) \ $(T_LDFLAGS) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ @@ -147,12 +144,12 @@ $(call gb_Helper_abbreviate_dirs,\ $(call gb_StaticLibrary_get_target,$(lib))) \ $(T_LIBS) \ -Wl$(COMMA)--end-group \ - -Wl$(COMMA)--no-as-needed \ + -Wl$(COMMA)-zrecord \ $(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 ../../ure-link/lib/$(notdir $(1)) $(ILIBTARGET))) $(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\ - readelf -d $(1) | grep SONAME > $(WORKDIR)/LinkTarget/$(2).exports.tmp; \ + $(READELF) -d $(1) | grep SONAME > $(WORKDIR)/LinkTarget/$(2).exports.tmp; \ $(NM) --dynamic --extern-only --defined-only --format=posix $(1) \ | cut -d' ' -f1-2 \ >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \ @@ -164,6 +161,7 @@ define gb_LinkTarget__command_staticlink $(call gb_Helper_abbreviate_dirs,\ rm -f $(1) && \ $(gb_AR) -rsu $(1) \ + $(if $(LD_PLUGIN),--plugin $(LD_PLUGIN)) \ $(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))) \ @@ -183,7 +181,7 @@ endef # Library class gb_Library_DEFS := -gb_Library_TARGETTYPEFLAGS := -shared +gb_Library_TARGETTYPEFLAGS := -shared -Wl,-M/usr/lib/ld/map.noexstk -mimpure-text gb_Library_UDK_MAJORVER := 3 gb_Library_SYSPRE := lib gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_ @@ -221,7 +219,7 @@ gb_Library_LAYER := \ $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \ define gb_Library__get_rpath -$(if $(1),$(strip '-Wl,-rpath,$(1)')) +$(if $(1),$(strip -Wl,-z,origin '-Wl,-rpath,$(1)' -L$(INSTDIR)/ure/lib -L$(INSTDIR)/program)) endef define gb_Library_get_rpath @@ -230,6 +228,7 @@ 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) @@ -248,7 +247,7 @@ gb_Executable_LAYER := \ define gb_Executable__get_rpath -$(if $(1),'-Wl$(COMMA)-rpath$(COMMA)$(1)') +$(strip -Wl,-z,origin $(if $(1),'-Wl$(COMMA)-rpath$(COMMA)$(1)') -L$(INSTDIR)/ure/lib -L$(INSTDIR)/program) endef define gb_Executable_get_rpath @@ -322,6 +321,9 @@ $(call gb_InstallModuleTarget_add_defs,$(1),\ $(gb_CPUDEFS) \ $(gb_OSDEFS) \ -DCOMID=gcc3 \ + -DSHORTSTDC3=$(gb_SHORTSTDC3) \ + -DSHORTSTDCPP3=$(gb_SHORTSTDCPP3) \ + -D_gcc3 \ ) endef |