patchCERTI - Patches: patch #8975, 2 possible patchs to fix...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #8975: 2 possible patchs to fix compilation/linkage on recent Ubuntu/GCC versions

Submitter:  Sebastien Mamessier <smamessier>
Submitted:  Mon 11 Apr 2016 03:33:39 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open

Mon 11 Apr 2016 03:33:39 PM UTC, original submission:  

It looks like RTIfedTime.cc defines methods whose declaration include `throw` of RTI::Exception types. Therefore, linker is looking for the typeinfo (as I read in https://gcc.gnu.org/wiki/Visibility) and doesn't find it as the RTI-> FedTime dependency is not explicitely made in the CMake file (I understood this was made on purpose to avoid a circular dependency).

As explained here (https://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html), in GCC, the typeinfo object (for polymorphic classes) is written in the translation unit of the definition of the first non-inline virtual method. (which is the RTI::Exception destructor in this case (baseTypes.hh/line 31: virtual ~Exception();)

Since the definition of RTI::Exception destructor is in RTITypes.cc, I assume typeinfo objects are only in libRTI.so.

So we need to force the compiler to transfer the RTI::Exception typeinfo to libFedTime (if you want to keep those signatures as such).

2-character solution
Make RTI::Exception destructor purely virtual (This way, there is no non-inline virtual function and so GCC seems to copy the typeinfo object to libFedTime - as it does not assume it must be somewhere else -)

2-line solution
Copy the destructor definition to RTIfedTime.cc
RTI::Exception::~Exception()
{
    if (NULL!=_reason) {
        free(_reason);
    }
}

I tested with GCC only, they both work.

Attached are the two possible patchs I came up with.

Sebastien Mamessier <smamessier>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by smamessier (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-04-11 smamessier Attached File- Added patch_purevirtual.txt, #36893
        Attached File- Added patch_copydestructor.txt, #36894

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code