diff options
author | Richard PALO <richard@NetBSD.org> | 2014-11-10 17:36:30 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-11-23 14:32:22 +0100 |
commit | 5652b71b622ca5b2b94d37cef57aac12726bd60a (patch) | |
tree | f7721802a93208b07b537f1c469172ef6c6f7d05 /solenv | |
parent | 8be07bbdeeef755919fc2aedd69b9ac8764e2d9f (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
Change-Id: Iaf175fb7db095c567e9837eac8456c0c3809e334
Signed-off-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/platform/solaris.mk | 74 |
1 files changed, 45 insertions, 29 deletions
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index a781a6c88a48..8256620e9aef 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,18 +52,21 @@ gb_CXXFLAGS := \ -fPIC \ -Wshadow \ -Woverloaded-virtual \ - -Wno-non-virtual-dtor \ - -# enable debug STL -ifeq ($(gb_ENABLE_DBGUTIL),$(true)) -gb_COMPILERDEFS += \ - -D_GLIBCXX_DEBUG \ - -endif ifeq ($(COM_GCC_IS_CLANG),) gb_GccLess460 := $(shell expr $(GCC_VERSION) \< 406) +# Only GCC 4.6 has a fix for <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7302> +# "-Wnon-virtual-dtor should't complain of protected dtor" and supports #pragma +# GCC diagnostic push/pop required e.g. in cppuhelper/propertysetmixin.hxx to +# silence warnings about a protected, non-virtual dtor in a class with virtual +# members and friends: +ifeq ($(gb_GccLess460),1) +gb_CXXFLAGS += -Wno-non-virtual-dtor +else +gb_CXXFLAGS += -Wnon-virtual-dtor +endif + #At least SLED 10.2 gcc 4.3 overly aggressively optimizes uno::Sequence into #junk, so only strict-alias on >= 4.6.0 gb_StrictAliasingUnsafe := $(gb_GccLess460) @@ -81,12 +75,23 @@ ifeq ($(gb_StrictAliasingUnsafe),1) gb_CFLAGS += -fno-strict-aliasing gb_CXXFLAGS += -fno-strict-aliasing endif + +else # Clang +gb_CXXFLAGS += -Wnon-virtual-dtor +endif + + +# enable debug STL +ifeq ($(gb_ENABLE_DBGUTIL),$(true)) +gb_COMPILERDEFS += \ + -D_GLIBCXX_DEBUG \ + endif ifeq ($(HAVE_CXX11),TRUE) #Currently, as well as for its own merits, c++11/c++0x mode allows use to use #a template for SAL_N_ELEMENTS to detect at compiler time its misuse -gb_CXXFLAGS += -std=c++0x +gb_CXXFLAGS += $(CXXFLAGS_CXX11) #We have so many std::auto_ptr uses that we need to be able to disable #warnings for those so that -Werror continues to be useful, seeing as moving @@ -107,8 +112,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 \ @@ -134,6 +137,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 @@ -152,18 +161,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))) \ @@ -177,12 +188,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 && \ @@ -194,6 +205,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))) \ @@ -213,7 +225,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_ @@ -251,7 +263,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 @@ -260,6 +272,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) @@ -278,7 +291,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 @@ -352,6 +365,9 @@ $(call gb_InstallModuleTarget_add_defs,$(1),\ $(gb_CPUDEFS) \ $(gb_OSDEFS) \ -DCOMID=gcc3 \ + -DSHORTSTDC3=$(gb_SHORTSTDC3) \ + -DSHORTSTDCPP3=$(gb_SHORTSTDCPP3) \ + -D_gcc3 \ ) endef |