[omniORB-dev] Linking libCOS against libomniDynamic on all platforms
Floris Bruynooghe
flub at devork.be
Sun Aug 8 15:44:15 BST 2010
Hi
Attached is the patch I've made in Debian to link libCOS with
libomniDynamic and link libCOSDynamic with libCOS (in version 4.1.4).
Both these libraries use symbols from these libraries however the
default UNIX build did not bother resolving them because (I presume)
any application using them would be linking against these libs anyway.
Both AIX and Cygwin linkers where not happy with this and had
exceptions added to them however. But it also turns out that the new
GOLD linker in GNU binutils is not too happy with leaving these
symbols not resolved either (though it's not a hard failure), see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=558942.
So the attached patch does add the linking by default to any UNIX
platform. Do you have any comments on this? Is this a very bad idea
or is this something you'd accept upstream? Is there a better way of
doing this?
Thanks
Floris
--
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org
-------------- next part --------------
--- a/src/services/mklib/dir.mk
+++ b/src/services/mklib/dir.mk
@@ -121,13 +121,17 @@
dynimps := $(skshared) $(patsubst $(DLLDebugSearchPattern),$(DLLNoDebugSearchPattern), \
$(OMNIORB_LIB))
else
-imps := $(OMNIORB_LIB_NODYN)
-dynimps := $(OMNIORB_LIB)
+# Link COS with omniDynamic and COSDynamic with COS so all symbols are
+# resolved at link time. Leaving symbols unresolved is ok for the normal
+# GNU and SysV linkers but not for more restrictive linkers like GOLD.
+# $(soext) is used in the $(skshared) target.
+soext := $(OMNIORB_MAJOR_VERSION).so.$(OMNIORB_MINOR_VERSION).$(OMNIORB_MICRO_VERSION)
+imps := $(OMNIORB_LIB_NODYN) -lomniDynamic$(OMNIORB_MAJOR_VERSION)
+dynimps := $(OMNIORB_LIB) -Lshared -lCOS$(OMNIORB_MAJOR_VERSION)
endif
ifdef AIX
-# AIX thinks the skeleton stubs depend on omniDynamic and also that
-# COSDynamic depends on COS.
+# AIX has special library names.
oov = $(OMNIORB_MAJOR_VERSION)$(OMNIORB_MINOR_VERSION)
oovm = $(oov)$(OMNIORB_MICRO_VERSION)
imps := -lomniORB$(oov) -lomniDynamic$(oov) $(OMNITHREAD_LIB)
@@ -149,8 +153,9 @@
$(skshared): $(patsubst %, shared/%, $(COS_SK_OBJS))
@(namespec="$(sknamespec)"; extralibs="$(imps) $(extralibs)"; \
$(MakeCXXSharedLibrary))
+ ln -s libCOS$(soext) shared/libCOS$(OMNIORB_MAJOR_VERSION).so
-$(dynskshared): $(patsubst %, shared/%, $(COS_DYNSK_OBJS))
+$(dynskshared): $(skshared) $(patsubst %, shared/%, $(COS_DYNSK_OBJS))
@(namespec="$(dynsknamespec)"; extralibs="$(dynimps)"; \
$(MakeCXXSharedLibrary))
More information about the omniORB-dev
mailing list