Re: Building for Mac OS X Lion

Duncan Grisby <[email protected]> Mon, 13 Feb 2012 10:20:46 +0000
Newsgroups gmane.comp.corba.omniorb.devel
Message-ID <1329128446.8295.11.camel@localhost>
--=-skNDBQviBYpXnvDAD4Up
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

On Sat, 2012-02-11 at 19:03 -0800, Thomas Lockhart wrote:

> I'm trying to get code running on Mac OS X including omniORB and omniORBpy.

They work fine for me, just running configure; make, which uses the gcc
compiler front-end.

[...]
> /Developer/usr/bin/clang++ -o catior -L/opt/local/lib -arch x86_64 -pipe 
> -O2 -arch x86_64 -fno-common -bind_at_load -L../../../../lib 
> -L../../../../lib catior.o -lomniORB4 -lomnithread
> Undefined symbols for architecture x86_64:
>    "operator<<=(unsigned int&, cdrStream&)", referenced from:
>        
> _CORBA_Unbounded_Sequence<IOP::TaggedProfile>::operator<<=(cdrStream&) 
> in catior.o
> 
> Which I see is indeed undefined in both catior.o and in 
> libomniORB4.dylib (along with undefined operators for a few other int 
> types). I'm guessing it is an implicit template issue but...

It's an inline function declared in include/omniORB4/cdrStream.h, so
it's right that it's not defined in the object files. The functions are
somewhat trickily defined as friend functions within the cdrStream
class, and the clang front-end is clearly somewhat confused by it. 

Luckily the IBM xlC compiler has the same problem, so there are already
pre-processor defines for a work-around. This little patch fixes it.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- [email protected]     --
   -- http://www.grisby.org --


--=-skNDBQviBYpXnvDAD4Up
Content-Disposition: attachment; filename="clang.patch"
Content-Type: text/x-patch; name="clang.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit

Index: include/omniORB4/CORBA_sysdep.h
===================================================================
--- include/omniORB4/CORBA_sysdep.h	(revision 6071)
+++ include/omniORB4/CORBA_sysdep.h	(working copy)
@@ -231,6 +231,11 @@
 #endif
 
 
+#if defined(__clang__)
+#  define OMNI_NO_INLINE_FRIENDS
+#endif
+
+
 //
 // Windows DLL hell
 //

--=-skNDBQviBYpXnvDAD4Up
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
omniORB-dev mailing list
[email protected]
http://www.omniorb-support.com/mailman/listinfo/omniorb-dev

--=-skNDBQviBYpXnvDAD4Up--