| Summary: | sys-devel/gcc-5 bugs with -fdevirtualize | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Tupone Alfredo <tupone> |
| Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
| Status: | RESOLVED NEEDINFO | ||
| Severity: | normal | ||
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
|
Description
Tupone Alfredo
2016-04-17 08:35:25 UTC
please a reduced description of the issue and the fix you deployed Probably gcc is confused when getting a virtual method with a sort of inline.
What gcc does is in this case is not defining the body of the virtual function, but requiring the entry in the virtual table.
And during link it raise
undefined reference to non-virtual thunk to csImageMemory::GetImageData()
My fix is in this case defining the body of the method in a cpp file and not in the header.
e.g.
I changed
virtual const void* GetImageData () { return GetImagePtr (); }
in the header with
virtual const void* GetImageData ();
and add
const void* csImageMemory::GetImageData ()
{
return GetImagePtr ();
}
in the body.
|