Topic
  • No replies
Dwayne_M
Dwayne_M
9 Posts

Pinned topic Name Mangling issue with xlC++ v10

‏2010-02-01T14:17:27Z |

re-posted from the AIX Forum for Developers forum on developerWorks
Hello Guys,

I am trying to compile google protocol buffer on AIX using
xlC v10 on AIX 5.3 but I am facing too many issues doing that.
I have pasted
compile string and corresponding error I received also. I tried to preprocess
file and pasted that one here too. I have also attached preprocessed file with
this thread.

Compile String for preprocessing :

xlc++_r -DHAVE_CONFIG_H -I. -I.
-I.. -I../gtest/include -I../gtest/include -D_THREAD_SAFE -E -qnamemangling=v10
-qnostaticinline -qlanglvl=extended -D__IBMCPP_TR1__ -qidirfirst
-I/usr/vacpp/include -c -o protobuf_test-repeated_field_unittest.o `test -f
'google/protobuf/repeated_field_unittest.cc' || echo
'./'`google/protobuf/repeated_field_unittest.cc

From preprocessed
file:

typedef internal::RepeatedPtrIterator<Element>
iterator;
typedef internal::RepeatedPtrIterator<const Element>
const_iterator;

Compile String:

xlc++_r -DHAVE_CONFIG_H -I. -I.
-I.. -I../gtest/include -I../gtest/include -D_THREAD_SAFE -g -qnamemangling=v10
-qnostaticinline -qlanglvl=extended -D__IBMCPP_TR1__ -qidirfirst
-I/usr/vacpp/include -c -o protobuf_test-repeated_field_unittest.o `test -f
'google/protobuf/repeated_field_unittest.cc' || echo
'./'`google/protobuf/repeated_field_unittest.cc

Actual Error encountered
:

"./google/protobuf/repeated_field.h", line 978.19: 1540-0704 (S) The
definitions of "google::protobuf::internal::RepeatedPtrIterator<const <br />
std::basic_string<char,std::char_traits<char>,std::allocator<char>
goog..." and
"google::protobuf::internal::RepeatedPtrIterator<std::basic_string<char,std::char_traits<char>,std::allocator<char>
google::pr..." have the same linkage signature
"__pl__Q3_6google8protobuf8internalFQ4_6google8protobuf8internal19RepeatedPtrIteratorXTQ2_3std12basic_stringXTcTQ2_3std11char_trai...".

Please
help me to figure out solution for this. I am planning to contribute solution to
google protobuf so it will be really great help.

Thanks &
Regards,
Vikram


Attachments:
repeated_field_unittest.i
Updated on 2010-11-02T18:59:42Z at 2010-11-02T18:59:42Z by Annie_Cheng
  • camorton
    camorton
    10 Posts

    Re: Name Mangling issue with xlC++ v10

    ‏2010-03-05T19:40:08Z  

    Sorry for the delay in responding to this message.
    I had a look at the testcase and it appears this is a defect in the compiler, can we get this officially reported?
    So far I have not come up with a workaround for the issue, but I will post one if I can.
  • camorton
    camorton
    10 Posts

    Re: Name Mangling issue with xlC++ v10

    ‏2010-03-12T13:55:48Z  
    • camorton
    • ‏2010-03-05T19:40:08Z

    Sorry for the delay in responding to this message.
    I had a look at the testcase and it appears this is a defect in the compiler, can we get this officially reported?
    So far I have not come up with a workaround for the issue, but I will post one if I can.
    I've confirmed that this is a name mangling problem. It can be worked around by using -qnamemangling=v5 or #pragma namemangling(v5). Note that the pragma is already in the preprocessed source setting namemangling to v7, these override the option. Also note that using a different name mangling will cause issues with binary compatibility.
  • vikram_vap
    vikram_vap
    1 Post

    Re: Name Mangling issue with xlC++ v10

    ‏2010-07-26T18:16:45Z  
    • camorton
    • ‏2010-03-12T13:55:48Z
    I've confirmed that this is a name mangling problem. It can be worked around by using -qnamemangling=v5 or #pragma namemangling(v5). Note that the pragma is already in the preprocessed source setting namemangling to v7, these override the option. Also note that using a different name mangling will cause issues with binary compatibility.

    Hi,
    So did you fille issue for the compiler changes ? If yes could you be able to provide issue number.
    Thanks & Regards
    Vikram
  • Annie_Cheng
    Annie_Cheng
    6 Posts

    Re: Name Mangling issue with xlC++ v10

    ‏2010-11-02T18:59:42Z  

    Hi,
    So did you fille issue for the compiler changes ? If yes could you be able to provide issue number.
    Thanks & Regards
    Vikram
    Hi Vikram,

    The issue will be fixed in the next release under a new name mangling option/pragma. We have had internal item opened.

    Meanwhile, you can work around the problem by using an older name mangling as suggested. In your source, you had #pragma namemangling(v7), #pragma namemangling(v8), ect. It's not a good idea to use different name mangling schemes across the board. It confuses the compiler. If you change them to #pragma namemangling(v5), the source can be compiled.

    For support in the V10.1 compiler, please open a PMR. Thank you!

    --Annie