Project

General

Profile

Actions

Bug #12657

closed

[PATCH] ANSI aliasing fix for XL compiler

Added by Zarko (Zarko Todorovski) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:76747]

Description

This is related to Bug #12191.

Changing in internal.h:983-985

from :

-#define RBASIC_CLEAR_CLASS(obj)        (((struct RBasicRaw *)((VALUE)(obj)))->klass = 0)
-#define RBASIC_SET_CLASS_RAW(obj, cls) (((struct RBasicRaw *)((VALUE)(obj)))->klass = (cls))

to:

#ifdef __ibmxl__
    #define RBASIC_SET_CLASS_RAW(obj, cls) memcpy(&((struct RBasicRaw *)((VALUE)(obj)))->klass, &(cls), sizeof(VALUE))
#else
    #define RBASIC_SET_CLASS_RAW(obj, cls) (((struct RBasicRaw *)((VALUE)(obj)))->klass = (cls))
#endif

#ifdef __ibmxl__
    #define RBASIC_CLEAR_CLASS(obj)        memset(&(((struct RBasicRaw *)((VALUE)(obj)))->klass), 0, sizeof(((struct RBasicRaw *)((VALUE)(obj)))->klass))
#else
    #define RBASIC_CLEAR_CLASS(obj)        (((struct RBasicRaw *)((VALUE)(obj)))->klass = 0)
#endif

This allows for ruby to build using XL compiler. Otherwise build fails because of ANSI aliasing issues.


Files

RBASIC_aliasing.patch (1.04 KB) RBASIC_aliasing.patch Zarko (Zarko Todorovski), 08/05/2016 04:41 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #12191: Violation of ANSI aliasing rules causing problems while compilingClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0