Bug #7647

Ruby 1.9.3 doesn't build on m68k due to alignment of structs

Added by Alan Hourihane over 1 year ago. Updated over 1 year ago.

[ruby-core:51224]
Status:Closed
Priority:Normal
Assignee:-
Category:-
Target version:-
ruby -v:0 Backport:

Description

I'd built Ruby 1.8 without any problems, but 1.9.3 shows up an issue with Ruby due to alignment checking.

When executing Initvartables(), we execute....

CONSTID(autoload, "autoload_");

We end up, in rbintern3() and use the RString struct to pass into rbencassociate() which checks alignment with SPECIALCONSTP(x) via IMMEDIATE(x) and uses the RUBYIMMEDIATE_MASK which is defined as 0x03.

This can fail on m68k as structs can be aligned on 16bit boundaries. I had to change....

struct RString fake_str;

to

struct RString fakestr _attribute__ ((aligned (4)));

To get miniruby to build, but I'm not sure of other lurkers and whether this strict use of IMMEDIATE(x) is really valid.

Associated revisions

Revision 38741
Added by Nobuyoshi Nakada over 1 year ago

ruby.h: align

  • include/ruby/ruby.h (RBasic): to be aligned on a VALUE size boundary. [Bug #7647]

History

#1 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38741.
Alan, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


ruby.h: align

  • include/ruby/ruby.h (RBasic): to be aligned on a VALUE size boundary. [Bug #7647]

Also available in: Atom PDF