Bug #20431
closedRuby 3.3.0 build fail with make: *** [io_buffer.o] Error 1
Description
I'm trying to build ruby from scratch with openss1.1.0. But it's failing with below error.
In file included from ./include/ruby/internal/arithmetic/char.h:23,
from ./include/ruby/internal/arithmetic.h:24,
from ./include/ruby/ruby.h:28,
from ./include/ruby/encoding.h:19,
from ./include/ruby/io.h:16,
from io_buffer.c:9:
./include/ruby/internal/arithmetic/int.h: In function ‘rb_int2num_inline’:
./include/ruby/internal/arithmetic/int.h:241: warning: comparison is always true due to limited range of data type
./include/ruby/internal/arithmetic/int.h:241: warning: comparison is always true due to limited range of data type
./include/ruby/internal/arithmetic/int.h: In function ‘rb_uint2num_inline’:
./include/ruby/internal/arithmetic/int.h:256: warning: comparison is always true due to limited range of data type
io_buffer.c: In function ‘io_buffer_read_U8’:
io_buffer.c:1872: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c:1872: error: (Each undeclared identifier is reported only once
io_buffer.c:1872: error: for each function it appears in.)
io_buffer.c: In function ‘io_buffer_write_U8’:
io_buffer.c:1872: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_S8’:
io_buffer.c:1873: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_S8’:
io_buffer.c:1873: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_u16’:
io_buffer.c:1875: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_u16’:
io_buffer.c:1875: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_U16’:
io_buffer.c:1876: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_U16’:
io_buffer.c:1876: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_s16’:
io_buffer.c:1877: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_s16’:
io_buffer.c:1877: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_S16’:
io_buffer.c:1878: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_S16’:
io_buffer.c:1878: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_u32’:
io_buffer.c:1880: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_u32’:
io_buffer.c:1880: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_U32’:
io_buffer.c:1881: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_U32’:
io_buffer.c:1881: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_s32’:
io_buffer.c:1882: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_s32’:
io_buffer.c:1882: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_S32’:
io_buffer.c:1883: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_S32’:
io_buffer.c:1883: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_u64’:
io_buffer.c:1885: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_u64’:
io_buffer.c:1885: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_U64’:
io_buffer.c:1886: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_U64’:
io_buffer.c:1886: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_s64’:
io_buffer.c:1887: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_s64’:
io_buffer.c:1887: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_S64’:
io_buffer.c:1888: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_S64’:
io_buffer.c:1888: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_f32’:
io_buffer.c:1890: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_f32’:
io_buffer.c:1890: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_F32’:
io_buffer.c:1891: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_F32’:
io_buffer.c:1891: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_f64’:
io_buffer.c:1892: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_f64’:
io_buffer.c:1892: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_read_F64’:
io_buffer.c:1893: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘io_buffer_write_F64’:
io_buffer.c:1893: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
io_buffer.c: In function ‘Init_IO_Buffer’:
io_buffer.c:3702: error: ‘RB_IO_BUFFER_HOST_ENDIAN’ undeclared (first use in this function)
At top level:
cc1: warning: unrecognized command line option "-Wno-maybe-uninitialized"
cc1: warning: unrecognized command line option "-Wno-tautological-compare"
cc1: warning: unrecognized command line option "-Wno-self-assign"
cc1: warning: unrecognized command line option "-Wno-parentheses-equality"
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand"
cc1: warning: unrecognized command line option "-Wno-cast-function-type"
make: *** [io_buffer.o] Error 1
Updated by mame (Yusuke Endoh) 7 months ago
Could you elaborate your environment? OS and its version, C compiler and its version, etc.
Updated by mame (Yusuke Endoh) 7 months ago
- Has duplicate Bug #20430: Ruby 3.3.0 build fail with make: *** [io_buffer.o] Error 1 added
Updated by shubham_yadav (Shubham Yadav) 7 months ago · Edited
gcc version :
$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
OS and it's version:
$ lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.10 (Santiago)
Release: 6.10
Codename: Santiago
Please let me know If any more info is required.
Updated by mame (Yusuke Endoh) 7 months ago
- Status changed from Open to Feedback
Thank you. Currently ruby requires gcc 7 or higher. (#19353) Could you somehow prepare a new gcc and retry to build it?
BTW, as far as I know, RHEL 6 will end Extended Life-cycle Support soon. You might want to upgrade your OS as well. (However, RHEL 7 bundles gcc 4.8, which is still old for building ruby.)
Updated by nobu (Nobuyoshi Nakada) 7 months ago
- Status changed from Feedback to Closed
- Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN to 3.0: DONTNEED, 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED
The main cause is not only by old gcc.
Although newer gcc defines __BYTE_ORDER__
indeed, but other compilers may not.
And the use of REG_DWORD
in the fallback part was wrong.
REG_DWORD
is a constant used as a registry type on Windows, and REG_DWORD_LITTLE_ENDIAN
is an alias of it always, but REG_DWORD_BIG_ENDIAN
is not equal to it.
That is, the constant is not for portabilities.
Updated by hsbt (Hiroshi SHIBATA) 6 months ago
- Status changed from Closed to Open
@nobu (Nobuyoshi Nakada) What's the fixed commit? I can't fix this ticket with backport.
Updated by nagachika (Tomoyuki Chikanaga) 6 months ago
Maybe https://github.com/ruby/ruby/commit/1faeb44dfcf777ace28321e80d0ebf942161a0a7 is the fix for this issue?
Updated by hsbt (Hiroshi SHIBATA) 6 months ago
- Status changed from Open to Closed
@nagachika (Tomoyuki Chikanaga) @katei (Yuta Saito) also found https://github.com/ruby/ruby/pull/10572 for this. Thank you both!
Updated by hsbt (Hiroshi SHIBATA) 6 months ago
- Backport changed from 3.0: DONTNEED, 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED to 3.0: DONTNEED, 3.1: DONE, 3.2: REQUIRED, 3.3: REQUIRED
Updated by hsbt (Hiroshi SHIBATA) 6 months ago
https://github.com/ruby/ruby/pull/10831 is for Ruby 3.1
Updated by k0kubun (Takashi Kokubun) 5 months ago
- Backport changed from 3.0: DONTNEED, 3.1: DONE, 3.2: REQUIRED, 3.3: REQUIRED to 3.0: DONTNEED, 3.1: DONE, 3.2: REQUIRED, 3.3: DONE
ruby_3_3 b2eb7f47b3e5f5a4681aa364ed960a0809460cdb merged revision(s) 1faeb44dfcf777ace28321e80d0ebf942161a0a7,7f87ad9fc4bc45faf8cd33602a025f27c094b2fd.
Updated by nagachika (Tomoyuki Chikanaga) 4 months ago
- Backport changed from 3.0: DONTNEED, 3.1: DONE, 3.2: REQUIRED, 3.3: DONE to 3.0: DONTNEED, 3.1: DONE, 3.2: DONE, 3.3: DONE
ruby_3_2 db45554fef4c8e1b0ba494965449db13068e6051 merged revision(s) 1faeb44dfcf777ace28321e80d0ebf942161a0a7, 7f87ad9fc4bc45faf8cd33602a025f27c094b2fd.