Bug 1256592 - clang compiled binary is missing D1 constructor for classes that don't have virtual base classes
Summary: clang compiled binary is missing D1 constructor for classes that don't have v...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: llvm
Version: el6
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Dave Johansen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 975551
TreeView+ depends on / blocked
 
Reported: 2015-08-25 05:23 UTC by Ben Woodard
Modified: 2020-11-30 15:16 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-30 15:16:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
clang compiled binary (767.51 KB, application/x-sharedlib)
2015-08-25 05:23 UTC, Ben Woodard
no flags Details
gcc compiled file (1.03 MB, application/x-sharedlib)
2015-08-25 05:26 UTC, Ben Woodard
no flags Details

Description Ben Woodard 2015-08-25 05:23:41 UTC
Created attachment 1066731 [details]
clang compiled binary

Description of problem:
Dodji and I were running abidiff against an ELF file compiled by clang and we discovered that at least the version of clang that ships with EPEL has an ABI compliance bug. The bug is that for classes that have a vtable, it is supposed to have 3 destructors. D0,D1, and D2. Clang is failing to emit D1. While GCC makes D1 an alias to D2. According to Jason this is a violation of ABI

Version-Release number of selected component (if applicable):
3.4.2 I haven't yet been able to get 3.6.2 to compile.

How reproducible:
at least sometimes.

Steps to Reproduce:
1. run abidiff on the two libraries provided
2. note how it appears that GCC adds the D1 destructor as an alias to the D2 destructor For example: 

Actual results:
  [A] 'method SpinLockHolder::~SpinLockHolder(int)'    {_ZN14SpinLockHolderD1Ev, aliases _ZN14SpinLockHolderD2Ev}


Expected results:
The D1 destructor aliases the D2 destructor.

Additional info:
I believe that this only happens when you don't have a virtual base class just virtual functions

Comment 1 Ben Woodard 2015-08-25 05:26:17 UTC
Created attachment 1066732 [details]
gcc compiled file

Comment 2 Ben Woodard 2015-08-25 05:29:46 UTC
https://mentorembedded.github.io/cxx-abi/abi.html#vtable is the source that Jason cited with regards to the ABI.

If 3.6.2 doesn't have this ABI compliance problem then a reasonable solution would be just to rebase EPEL to the latest version of the compiler. Simply trying to recompile the rawhide src.rpm does not appear to work for RHEL6.

Comment 3 Dave Johansen 2015-08-25 06:23:28 UTC
clang/LLVM 3.5 and later require C++11 support and the version of gcc that comes with RHEL 6 can't be used, so I think that this will have to be fixed as "won't fix" unless someone is will to create a patch for clang/LLVM 3.4.

Comment 4 Ben Woodard 2015-08-25 15:46:51 UTC
What about compiling it with DTS?

Comment 5 Dave Johansen 2015-08-25 16:28:20 UTC
devtoolset isn't available for use in EPEL. I've tried once or twice to see if that could be possible, but it never made it anywhere ( https://lists.fedoraproject.org/pipermail/epel-devel/2013-September/008737.html ).
The best bet would be to make a COPR because then it's pretty straightforward/simple to use devtoolset. I've been wanting to do that for a while, but just haven't had the time to do it. Hopefully, I can look into it in the not too distant future.

Comment 6 Ben Woodard 2015-08-25 18:44:07 UTC
I just noticed that this also impacts constructors as can be seen by:

  'method GoogleInitializer::~GoogleInitializer(int)'    {_ZN17GoogleInitializerD1Ev, aliases _ZN17GoogleInitializerD2Ev}
  'method SpinLockHolder::SpinLockHolder(SpinLock*)'    {_ZN14SpinLockHolderC1EP8SpinLock, aliases _ZN14SpinLockHolderC2EP8SpinLock}

Comment 7 Ben Cotton 2020-11-05 16:50:22 UTC
This message is a reminder that EPEL 6 is nearing its end of life. Fedora will stop maintaining and issuing updates for EPEL 6 on 2020-11-30. It is our policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of 'el6'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later EPEL version.

Thank you for reporting this issue and we are sorry that we were not able to fix it before EPEL 6 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged  change the 'version' to a later Fedora version prior this bug is closed as described in the policy above.

Comment 8 Ben Cotton 2020-11-30 15:16:52 UTC
EPEL el6 changed to end-of-life (EOL) status on 2020-11-30. EPEL el6 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
EPEL please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.