Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 580298 - sys-devel/gcc-5 bugs with -fdevirtualize
Summary: sys-devel/gcc-5 bugs with -fdevirtualize
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-17 08:35 UTC by Tupone Alfredo
Modified: 2019-01-27 22:31 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tupone Alfredo gentoo-dev 2016-04-17 08:35:25 UTC
See bug #571274

Reproducible: Always
Comment 1 SpanKY gentoo-dev 2016-04-17 16:29:39 UTC
please a reduced description of the issue and the fix you deployed
Comment 2 Tupone Alfredo gentoo-dev 2016-04-17 18:11:09 UTC
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.