- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ICC 19.1.3.20200925 seem to use GNU linkonce section instead of COMMON section for `__gxx_personality_v0` function.
GNU linkonce is a old way to do so-called "vague linking", and COMDAT superseded it very long ago.
`__gxx_personality_v0` is a function used by the C++ runtime to handle exceptions. That function is provided by libc.
If you use a linker that doesn't support GNU linkonce (such as LLVM lld or mold) to statically-link ICC-generated object files with GCC-generated object files, you'll get a duplicate symbol error for `__gxx_personality_v0` because the linker fails to de-duplicate symbols.
I believe ICC generate COMDAT sections most of the time. `__gxx_personality_v0` is an exception in which ICC for some reason generate a GNU linkonce section. There might be legacy code in ICC which is used only for `__gxx_personality_v0`.
My question is, is there any reason to stick with GNU linkonce? Can ICC always generate COMDAT?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for posting on Intel Communities.
You could use "ffunction-sections" optimization option which places each function in its own COMDAT section. By default it's in "OFF" state.
Please refer below link for help regarding "ffunction-sections" compiler option.
Best Regards,
Shanmukh.SS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that you misunderstood my point. I'm a compiler toolchain developer (I was working for Google in the LLVM team), and I'm pointing out an ICC's issue. Can you please forward my message to the compiler team?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Regrets for inconvenience caused regarding the difference in understanding. We are looking into your mentioned issue. We will get back to you soon.
Best regards,
Shanmukh.SS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you tell us the OS, gcc version you have?
Does this issue occur with the latest ICC 2021.5 ( in oneAPI2022.1.2 HPC toolkits)?
Would you also provide a reproducer and steps to show a "duplicate symbol error for gxx_personality_v0?
Thanks,
Viet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you give us a test case and steps to produce a "duplicate symbol error for gxx_personality_v0?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can no longer produce the duplicate symbol error because I made a change to the mold linker to ignore ICC-generated .gnu.linkonce.d sections.
Here is a bug: https://github.com/rui314/mold/issues/271
So, searchbv.cpp.o in libsse_icc.a uses .gnu.linkonce instead of COMDAT. As I wrote in the first post, the use of .gnu.linkonce is effectively deprecated and major tools have migrated to COMDAT more than a decade ago. I want ICC to also stop producing .gnu.linkonce sections and instead use COMDAT.
Thanks,
Rui
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I followed your github link, but don't see any test case to reproduce it.
Does this issue occur with ICC2021.5?
AFAIK, we don't support other linkers (llvm lld, mold) to link objects built with icc/icpc.
Thanks,
viet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The user of the linker uses ICC, but I don't have a copy of ICC.
You don't need a tool to see what's in the object file. Just run `readelf -a` on `searchbv.cpp.o` in `libsse_icc.a`. I believe you'll see .gnu.linkonce section in the output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I could do that. But I need to have a source code to compile and generate the object to investigate.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If this is still an issue, please provide it a reproducer at source code level. If not, we can close this thread.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Let's close this thread for now. If you have a reproducer, please reply to this thread.
Thanks,
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page