Archived

This forum has been archived. Please start a new discussion on GitHub.

[3.4b] ruby bindings fail to build

make -C rb
make: Entering directory `/tmp/Ice-3.4b/rb'
making all in src
make[1]: Entering directory `/tmp/Ice-3.4b/rb/src'
making all in IceRuby
make[2]: Entering directory `/tmp/Ice-3.4b/rb/src/IceRuby'
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  Connection.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  Communicator.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  Endpoint.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  Init.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  ImplicitContext.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  Logger.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  ObjectFactory.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  Operation.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  Properties.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  Proxy.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  Slice.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  Types.cpp
c++ -c -I. -I..  -I../../../cpp/include -I/usr/lib64/ruby/1.8/x86_64-linux -m64 -Wall -D_REENTRANT -fPIC -g  Util.cpp
Util.cpp: In function 'Ice::Long IceRuby::getLong(VALUE)':
Util.cpp:161: error: invalid conversion from 'void*' to 'unsigned int*'
make[2]: *** [Util.o] Error 1

A static_cast allows the build to finish:
--- ./Ice-3.4b/rb/src/IceRuby/Util.cpp.orig     2010-02-03 14:46:16.000000000 +0100
+++ ./Ice-3.4b/rb/src/IceRuby/Util.cpp  2010-02-03 14:24:34.000000000 +0100
@@ -158,7 +158,7 @@
         {
             throw RubyException(rb_eRangeError, "bignum too big to convert into long");
         }
-        BDIGIT *ds = RBIGNUM_DIGITS(v);
+        BDIGIT *ds = static_cast<unsigned int *>(RBIGNUM_DIGITS(v));
         BDIGIT_DBL num = 0;
         while(len--)
         {

Comments

  • mes
    mes California
    Welcome to the forum, and thanks for the post.

    What flavor of Linux and which version of GCC are you using?

    Regards,
    Mark
  • Thanks, I forgot to add the details: Gentoo (amd64) and gcc-4.3.4.
    Portage 2.2_rc55 (default/linux/amd64/10.0/desktop, gcc-4.3.4, glibc-2.10.1-r1, 2.6.31-gentoo-r6 x86_64)
    =================================================================
    System uname: Linux-2.6.31-gentoo-r6-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9400_@_2.66GHz-with-gentoo-1.12.13
    Timestamp of tree: Wed, 03 Feb 2010 06:30:01 +0000
    
    dev-util/cmake:      2.8.0
    sys-devel/autoconf:  2.63-r1
    sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
    sys-devel/binutils:  2.18-r3
    sys-devel/gcc:       3.4.6-r2, 4.1.2, 4.3.4
    sys-devel/libtool:   1.3.5, 2.2.6b
    CBUILD="x86_64-pc-linux-gnu"
    CFLAGS="-mtune=nocona -O2 -pipe -msse4"
    CHOST="x86_64-pc-linux-gnu"
    LDFLAGS="-Wl,-O1"
    
  • xdm
    xdm La Coruña, Spain
    Hi Reto,

    I have tested Ice Ruby on Gentoo 64 and was not able to reproduce the problem, our setup are very similar, seems to me that differences in CXXFLAGS could be the cause of this, we will further investigate that and include a fix in 3.4 release.
    saturno rb # uname -s -v -p -m
    Linux #1 SMP Sat Oct 3 14:30:31 GMT 2009 x86_64 Quad-Core AMD Opteron(tm) Processor 2344 HE
    saturno rb # gcc-config -l
     [1] x86_64-pc-linux-gnu-4.1.2
     [2] x86_64-pc-linux-gnu-4.3.4 *
    saturno rb # gcc -v
    Using built-in specs.
    Target: x86_64-pc-linux-gnu
    Configured with: /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.4 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.4 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.4/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.4/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --disable-libgcj --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.4 p1.0, pie-10.1.5'
    Thread model: posix
    gcc version 4.3.4 (Gentoo 4.3.4 p1.0, pie-10.1.5)
    saturno rb # ruby -v
    ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]
    
    CFLAGS="-O2 -pipe"
    CXXFLAGS="-O2 -pipe"
    CHOST="x86_64-pc-linux-gnu"
    

    Bests,
    José
  • xdm
    xdm La Coruña, Spain
    Hi Reto,

    actually i was wrong about CXXFLAGS, as Ice source distribution doesn't use portage CXXFLAGS to build.

    What ruby version were you using?

    i have that:
    [ebuild   R   ] dev-lang/ruby-1.9.1_p243  USE="berkdb gdbm ipv6 ssl -debug -doc -emacs -examples -rubytests -socks5 -tk -xemacs" 0 kB
    

    Bests Regards,
    José
  • Hi José

    nice catch. Unmasking, keywording and installing ruby-1.9 seems to do the trick:
    # echo "=dev-lang/ruby-1.9.1_p243" >> /etc/portage/package.unmask
    # echo "=dev-lang/ruby-1.9.1_p243 ~amd64" >> /etc/portage/package.keywords
    

    even though ruby1.8 is still active:
    # eselect ruby list
    Available Ruby profiles:
      [1]   ruby18 (with Rubygems) *
      [2]   ruby19 (with Rubygems)
    

    Looks like Ice-3.4b depends on ruby1.9 ?
  • xdm
    xdm La Coruña, Spain
    Looks like Ice-3.4b depends on ruby1.9 ?

    Ice For Ruby requires ruby >= 1.8.1

    In my other gentoo setup (x86) it builds fine with 1.8.7
    Available Ruby profiles:
      [1]   ruby18 *
    pepone@marte /usr/src $ ruby -v
    ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]
    pepone@marte /usr/src $ gcc-config -l
     [1] i686-pc-linux-gnu-4.3.4 *
    

    What Ruby 1.8 version do you have?

    Bests Regards,
    José
  • I don't have a x86 gentoo, but a second x86_64:
    $ uname -a
    Linux i7 2.6.31-gentoo-r6 #19 SMP Wed Dec 23 19:24:02 CET 2009 x86_64 Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz GenuineIntel GNU/Linux
    

    and both fail with 1.8.7_p249
    # eix dev-lang/ruby
    [I] dev-lang/ruby
         Available versions:
            (1.8)   1.8.6_p388 1.8.7_p249
            (1.9)   {M}(~)1.9.1_p243
            {berkdb debug doc emacs examples gdbm ipv6 rubytests socks5 ssl threads tk xemacs}
         Installed versions:  1.8.7_p249(1.8)(08:02:33 PM 01/20/2010)(berkdb gdbm ssl -debug -doc -emacs -examples -ipv6 -rubytests -socks5 -threads -tk -xemacs)
                              1.9.1_p243(1.9)(08:13:08 AM 02/05/2010)(berkdb gdbm ssl -debug -doc -emacs -examples -ipv6 -rubytests -socks5 -tk -xemacs)
         Homepage:            http://www.ruby-lang.org/
         Description:         An object-oriented scripting language
    

    e.g.
    $ ruby -v
    ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
    
  • xdm
    xdm La Coruña, Spain
    I was able to reproduce the bug in gentoo linux x86 and x86_64 with

    dev-lang/ruby-1.8.7_p249 and gcc-4.3.4

    Previous 1.8.7 versions seems not affected, ruby 1.8.7 (2009-06-12 patchlevel
    174) just works fine.

    We will include a fix in 3.4.0 final release.

    Thanks for point this out, and help to track it down.

    Bests Regards,
    José