eclipse-omr / omr

Eclipse OMR™ Cross platform components for building reliable, high performance language runtimes
http://www.eclipse.org/omr
Other
948 stars 396 forks source link

DDR: ddrgen yields duplicate constants on OSX #3354

Open keithc-ca opened 5 years ago

keithc-ca commented 5 years ago

See https://github.com/eclipse/openj9/issues/3483#issuecomment-447373684:

ddrgen is having trouble with openj9/runtime/gc_structs/ClassLoaderClassesIterator.hpp:

class GC_ClassLoaderClassesIterator
{
    enum { TABLE_CLASSES, SYSTEM_CLASSES, ANONYMOUS_CLASSES } _mode;
    // ...
};

That header file is included in multiple compilation units and the linker uses a single definition of the enum for the _mode field, but repeats the enum type declaration in j9gc29.dylib as if the source were (this illegal) code:

class GC_ClassLoaderClassesIterator
{
    enum { TABLE_CLASSES, SYSTEM_CLASSES, ANONYMOUS_CLASSES } _mode;
    enum { TABLE_CLASSES, SYSTEM_CLASSES, ANONYMOUS_CLASSES };
    // ...
};

The result is that the blob and superset contain duplicates of those constants. As a workaround, openj9 will have to temporarily blacklist that type.

pshipton commented 5 years ago

Note https://github.com/eclipse/openj9/pull/4071 changes the anonymous enum used by _mode, which fixed the immediate DDR issue without blacklisting GC_ClassLoaderClassesIterator. Now that DDR is enabled for all platforms (except z/OS), the original code will no longer compile in OpenJ9 builds (i.e. omr acceptance to OpenJ9 would fail).