Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Template error

807575Mar 28 2008 — edited Mar 31 2008
Hi,
i played with templates and maybe found a bug in SunStudio. Source code is a bit longer so i place here link: [http://www.box.net/shared/3n0inz5348]
I don't intend to use it seriously, i just tested implementation of callbacks in C++. It uses partially specialized templates and templates with default parameters. In the beginning are macros which can be used to select which kind of functions will be tested.
#define STATIC_FUNCTIONS
//#define STATIC_MEMBER_FUNCTIONS
#define MEMBER_FUNCTIONS
#define CONST_MEMBER_FUNCTIONS
Some combinations are not possible because C++ does not allow them, but the combination above failed with compiler/linker error.
SunStudio 11 (CC: Sun C++ 5.8 Patch 121017-10 2007/02/21) failed during compilation with this output:
Assertion failed at line 1351 of ../src/omfi.c
*** Error code 1
SunStudio 12 (CC: Sun Ceres C++ 5.9 SunOS_sparc 2008/01/28) failed during linking with output:
ld: fatal: file Sun-sparc-Solaris/main.o: section .group%Callback<__type_1,__type_2>*makeCallback<Test,int,int>(__type_0&,__type_1): has invalid sh_link: 0
ld: fatal: file Sun-sparc-Solaris/main.o: section .group%Callback<__type_1,void>*makeCallback<Test,int>(__type_0&,__type_1): has invalid sh_link: 0
ld: fatal: file Sun-sparc-Solaris/main.o: section .group%Callback<void,void>*makeCallback<Test>(__type_0&,__type_1): has invalid sh_link: 0
ld: fatal: file Sun-sparc-Solaris/main.o: section .group%Callback<__type_1,__type_2>*makeCallback<Test,int,int>(__type_0&,__type_1): SHF_GROUP flag set, but no corresponding SHT_GROUP section found
ld: fatal: file Sun-sparc-Solaris/main.o: section .text%Callback<__type_1,__type_2>*makeCallback<Test,int,int>(__type_0&,__type_1): SHF_GROUP flag set, but no corresponding SHT_GROUP section found
ld: fatal: file Sun-sparc-Solaris/main.o: section .group%Callback<__type_1,void>*makeCallback<Test,int>(__type_0&,__type_1): SHF_GROUP flag set, but no corresponding SHT_GROUP section found
ld: fatal: file Sun-sparc-Solaris/main.o: section .text%Callback<__type_1,void>*makeCallback<Test,int>(__type_0&,__type_1): SHF_GROUP flag set, but no corresponding SHT_GROUP section found
ld: fatal: file Sun-sparc-Solaris/main.o: section .group%Callback<void,void>*makeCallback<Test>(__type_0&,__type_1): SHF_GROUP flag set, but no corresponding SHT_GROUP section found
ld: fatal: file Sun-sparc-Solaris/main.o: section .text%Callback<void,void>*makeCallback<Test>(__type_0&,__type_1): SHF_GROUP flag set, but no corresponding SHT_GROUP section found
ld: fatal: file Sun-sparc-Solaris/main.o: section .exception_ranges%Callback<__type_1,__type_2>*makeCallback<Test,int,int>(__type_0&,__type_1): SHF_GROUP flag set, but no corresponding SHT_GROUP section found
ld: fatal: file Sun-sparc-Solaris/main.o: section .exception_ranges%Callback<__type_1,void>*makeCallback<Test,int>(__type_0&,__type_1): SHF_GROUP flag set, but no corresponding SHT_GROUP section found
ld: fatal: file Sun-sparc-Solaris/main.o: section .exception_ranges%Callback<void,void>*makeCallback<Test>(__type_0&,__type_1): SHF_GROUP flag set, but no corresponding SHT_GROUP section found
ld: fatal: File processing errors. No output written to Sun-sparc-Solaris/test
*** Error code 1
If you think that it should be posted as a bug and if you understand my English :D post here any suggestions thanks.

Comments

807575
The assertion comes from the code generator, and an assertion is always a bug.

Please be sure you have all the current patches for Sun Studio 11, the C++ patch, and the "compilers back end" patch. You can get all patches here:
http://developers.sun.com/sunstudio/downloads/patches/

If you do not need to support Solaris 8, you should upgrade to Sun Studio 12 (also with current patches).

If after patching the problem is still there, please file a bug report at bugs.sun.com. You will need to include enough information so that we can reproduce the problem. A pointer to a web site with the source code is OK, but please also provide exact instructions for reproducing the compiler assertion.
marc1842fr
Do you get the same error if you recompile with the additional option: -Qoption ccfe -abiopt=mangle6 ? This looks fairly similar to bug 6532605, which cannot be fixed (but is not present on solaris-x64 or linux).
807575
-Qoption ccfe -abiopt=mangle6
Yes this options solve this problem.
I installed latest patches for SS 11 but the problem was still there. I use Sun Update Manager but some patches must be downloaded manually. I think its not possible to have SS12 installed from package with SS11 together so i use SS12 Express-February. The assert error of SS11 is there only with -g option otherwise the same error as SS12.
807575
Side note: it is perfectly all right to install several versions of Sun Studio from packages; just tell the installer to use different base directories, that's all.
1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 28 2008
Added on Mar 28 2008
4 comments
315 views