[tao-bugs] EXTERNAL: Re: PortableServer: Servant_Base.cpp fails to compile on Solaris

Melton, Jim jim.melton at lmco.com
Tue Apr 12 20:29:26 CDT 2016


Bob,

On the surface, it looks like you uncovered the bug I reported almost a year ago. Although our configurations are slightly different (I don’t use stlport4), the error appears to be the same. The main difference is that you solved it ☺

Here is my bug for your edification. I’d be interested if your fix solves it too.


    TAO VERSION: 2.3.0

    ACE VERSION: 6.3.0



    HOST MACHINE and OPERATING SYSTEM: Oracle SunFire X4270 M2 / Solaris 11.2



    TARGET MACHINE and OPERATING SYSTEM: same

    COMPILER NAME AND VERSION: Solaris Studio 12.4 (CC 5.13)



    THE $ACE_ROOT/ace/config.h FILE: config-sunos5.10.h



    THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:

ace_for_tao=1

fast=0

rwho=0

buildbits=64

threads=1

CFLAGS += -features=zla

include $(ACE_ROOT)/include/makeinclude/platform_sunos5_sunc++.GNU



    CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features: N/A



    AREA/CLASS/EXAMPLE AFFECTED: tao_idl generated user code does not compile



    DOES THE PROBLEM AFFECT:

        COMPILATION?

        LINKING?

        EXECUTION?

        OTHER?



    SYNOPSIS:

There appears to be an issue related to template instantiation of user-defined types as arguments to functions when building with the Solaris Studio 12.4 compiler.



    DESCRIPTION:

IDL-generated code fails to compile. The Studio 12.4 is a more strictly standards-conforming compiler. All the classes required to instantiate a template must at least be declared before a template is instantiated. It seems like that is the issue here, but I can't figure out a way to coerce it to compile, even manually modifying the generated files.



    REPEAT BY:

In file Mine.idl:

---------------

module Mine

{

    typedef sequence<octet> Val;

};



In file Func.idl:

----------------

#include "Mine.idl"

module Mine

{

interface Func

{

    void put(in string name, in Mine:Val payload); }; };



IDL compilation:

------------------

tao_idl -Cw -w -hc _c.hh -hs _s.hh -cs _c.cc -ss _s.cc -Yp,/devel/SolarisStudio12.4/bin/CC Mine.idl tao_idl -Cw -w -hc _c.hh -hs _s.hh -cs _c.cc -ss _s.cc -Yp,/devel/SolarisStudio12.4/bin/CC Func.idl



C++ compilation:

------------------

/devel/SolarisStudio12.4/bin/CC -g0 -errtags +w -xbuiltin=%all -fns -xlibmil -xlibmopt -m64 -Kpic -mt -template=extdef -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS -features=zla -DACE_LACKS_PRAGMA_ONCE -DACE_HAS_KSTAT -DACE_HAS_CUSTOM_EXPORT_MACROS=0 -DACE_HAS_SCTP -DACE_HAS_LKSCTP -o Func_c.o -c Func_c.cc "/devel/include/ace/Thread_Manager.h", line 349: Warning, hidef: ACE_Thread_Descriptor::reset hides the function ACE_Thread_Descriptor_Base::reset().

"/devel/include/tao/Any_Insert_Policy_T.h" line 44: Error: The operation "CORBA::Any<<= const Mine::Val" is illegal.

"/devel/include/tao/Var_Size_Argument_T.cpp", line 32:     Where, temwhileinst: While instantiating "static TAO::Any_Insert_Policy_Stream<Mine::Val>::any_insert(CORBA::Any*, const Mine::Val&)".

"/devel/include/tao/Var_Size_Argument_T.cpp", line 32:     Where, teminstfrom: Instantiated from TAO::In_Var_Size_Argument_T<Mine::Val, Any_Insert_Policy_Stream>::interceptor_value(CORBA::Any*) const.

     Where, teminstend: Instantiated from non-template code.

1 Error(s) and 1 Warning(s) detected.



    SAMPLE FIX/WORKAROUND:

None


--
Jim Melton
Software Architect, Fusion Programs
Lockheed Martin IS&GS
(720) 922-5584


From: tao-bugs [mailto:tao-bugs-bounces at list.isis.vanderbilt.edu] On Behalf Of Bob Johnson
Sent: Tuesday, April 12, 2016 9:35 AM
To: jwillemsen at remedy.nl; tao-bugs at list.isis.vanderbilt.edu
Subject: EXTERNAL: Re: [tao-bugs] PortableServer: Servant_Base.cpp fails to compile on Solaris

I did some digging and it looks like this is not a compiler bug.  This version of the compiler just adheres more strictly to the namespace lookup rules in the C++ standard.
http://en.cppreference.com/w/cpp/language/dependent_name#Lookup_rules

There was already a #define to handle this properly for another compiler so I was able to fix the issue by adding the following like to my config.h
#define ACE_ANY_OPS_USE_NAMESPACE

For a proper fix, you probably want something like this in one of the config-sunos*.h files:

#if defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)
#define ACE_ANY_OPS_USE_NAMESPACE
#endif


On 4/12/2016 1:41 AM, Johnny Willemsen wrote:

Hi,



Thanks for using the PRF form. TAO isn't tested/maintained with this

recent Solaris Studio compiler. I have seen this error in some user

reports and with some experiments I did locally some time ago.



As far as I could determine this is a bug in the compiler, please

contact the Oracle Sun Studio compiler group to let them have a look at

the code and the error you got.



Best regards,

Johnny Willemsen

Remedy IT

Postbus 81 | 6930 AB Westervoort | The Netherlands

http://www.remedy.nl



On 04/11/2016 09:50 PM, Bob Johnson wrote:

TAO VERSION: 2.3.3

ACE VERSION: 6.3.3



HOST MACHINE and OPERATING SYSTEM:

SunOS 5.11 11.3 sun4v sparc



TARGET MACHINE and OPERATING SYSTEM, if different from HOST:

same as HOST



COMPILER NAME AND VERSION (AND PATCHLEVEL):

Oracle Solaris Studio 12.4

CC: Sun C++ 5.13 SunOS_sparc 151845-12 2016/01/26



THE $ACE_ROOT/ace/config.h FILE

#include <ace/config-sunos5.11.h>



THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE

ssl=1

exceptions=1

buildbits=64

debug=0

optimize=1

stlport=1

INSTALL_PREFIX = $(HOME)/3rdparty

include $(ACE_ROOT)/include/makeinclude/platform_sunos5_sunc++.GNU

CCFLAGS += -features=zla



CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features

ssl=1

ace_qtreactor    = 0

ace_xtreactor    = 0

ace_tkreactor    = 0

ace_flreactor    = 0

ace_foxreactor   = 0

tao_qtresource    = 0

tao_xtresource    = 0

tao_tkresource    = 0

tao_flresource    = 0

tao_foxresource   = 0

gl            = 0

x11           = 0

debug=0

optimize=1





AREA/CLASS/EXAMPLE AFFECTED:

TAO/tao/PortableServer/GNUmakefile.PortableServer

Servant_Base.cpp



DOES THE PROBLEM AFFECT:

COMPILATION?

yes



LINKING?

no



EXECUTION?

N/A



OTHER (please specify)?

N/A



SYNOPSIS:

$TAO_ROOT/tao/PortableServer/Servant_Base.cpp fails to compile.



DESCRIPTION:

Make fails with the following output:

CC -mt -m64 -xO4 -features=zla  -library=stlport4 -DACE_HAS_KSTAT

-DACE_HAS_CUSTOM_EXPORT_MACROS=0 -D_POSIX_PTHREAD_SEMANTICS -DNDEBUG

-I/scratch/build_2300/internal/3rdparty/ACE_wrappers -DACE_NDEBUG

-DACE_HAS_SCTP -DACE_HAS_LKSCTP -D__ACE_INLINE__ -DACE_HAS_STLPORT

-I../../.. -I../.. -DTAO_HAS_VALUETYPE_OUT_INDIRECTION

-DTAO_PORTABLESERVER_BUILD_DLL -c -KPIC -o .shobj/Servant_Base.o

Servant_Base.cpp

"../../tao/Any_Insert_Policy_T.h", line 42: Error: The operation

"CORBA::Any<<= CORBA::Object*const" is illegal.

"../../tao/PortableServer/Object_SArgument_T.cpp", line 118: Where:

While instantiating "static

TAO::Any_Insert_Policy_Stream<CORBA::Object*>::any_insert(CORBA::Any*,

CORBA::Object*const&)".

"../../tao/PortableServer/Object_SArgument_T.cpp", line 118: Where:

Instantiated from TAO::Ret_Object_SArgument_T<CORBA::Object*,

TAO_Pseudo_Var_T<CORBA::Object>,

Any_Insert_Policy_Stream>::interceptor_value(CORBA::Any*) const.

    Where: Instantiated from non-template code.

1 Error(s) detected.

make[1]: *** [.shobj/Servant_Base.o] Error 2



REPEAT BY:

cd $TAO_ROOT/tao ; make



SAMPLE FIX/WORKAROUND:

N/A



_______________________________________________

tao-bugs mailing list

tao-bugs at list.isis.vanderbilt.edu<mailto:tao-bugs at list.isis.vanderbilt.edu>

http://list.isis.vanderbilt.edu/cgi-bin/mailman/listinfo/tao-bugs

--
Bob Johnson | Principal Applications Engineer
Phone: +16125875083<tel:+16125875083> | Fax: +16125875083<fax:+16125875083>
Oracle NMS Development
900 Second Avenue South Suite 900 | Minneapolis, MN 55402
Oracle is committed to developing practices and products that help protect the environment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.isis.vanderbilt.edu/pipermail/tao-bugs/attachments/20160413/326a3d16/attachment-0001.html>


More information about the tao-bugs mailing list