Opened 3 years ago

Closed 3 years ago

#62490 closed defect (fixed)

ruby27: universal build is incorrect

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: kimuraw (kimura wataru)
Priority: Normal Milestone:
Component: ports Version: 2.6.99
Keywords: Cc:
Port: ruby27

Description

ruby27 installs with the universal variant, but what is installed is wrong, which causes other ports that use ruby27 to fail to build.

This is a regression; ruby26 universal is fine.

In ruby26, the file /opt/local/include/ruby-2.6.0/universal-darwin17/ruby/config.h contains for example:

#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32) || defined(ILP32)
#define SIZEOF_LONG 4
#elif defined(__LP64__) || defined(__LP64) || defined(_LP64) || defined(LP64)
#define SIZEOF_LONG 8
#endif

This is correct (or at least it allows other ports using ruby26 to build and it looks plausible although I don't know where __ILP32__ or __ILP32 or _ILP32 or ILP32 would be defined -- they are not standard defines that I'm aware of, whereas __LP64__ and _LP64 are both standard defines defined by clang in 64-bit mode). But in ruby27 the file /opt/local/include/ruby-2.7.0/x86_64-darwin17/ruby/config.h contains only:

#define SIZEOF_LONG 8

This is right for x86_64 but wrong for i386, hence when I try to build something that requires ruby27 (and I am building it universal) the build fails with:

In file included from /opt/local/include/ruby-2.7.0/ruby.h:33:
/opt/local/include/ruby-2.7.0/ruby/ruby.h:119:37: error: 'ruby_check_sizeof_long' declared as an array with a negative size
typedef char ruby_check_sizeof_long[SIZEOF_LONG == sizeof(long) ? 1 : -1];
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/ruby-2.7.0/x86_64-darwin17/ruby/config.h:61:21: note: expanded from macro 'SIZEOF_LONG'
#define SIZEOF_LONG 8
                    ^

Change History (2)

comment:2 Changed 3 years ago by kimura wataru <kimuraw@…>

Resolution: fixed
Status: assignedclosed

In 326540640e1c4658a12ccd518a520d08c8bad1fa/macports-ports (master):

lang/ruby27: fix +universal variant

use ruby's universal mechanism as same as ruby26 or earlier.

Closes: #62490

Note: See TracTickets for help on using tickets.