Errors building Ruby

Issue #156 resolved
Albert Vaca Cintora created an issue

I’m trying to compile Ruby on IBM i. However, when it gets to link the miniruby binary, I get the following error:

linking miniruby
ld: 0711-317 ERROR: Undefined symbol: .libutil_flock
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status
make: The error code from the last command is 1.

I have installed the last version of libutil available:

$ yum install libutil2 libutil-devel
Setting up Install Process
Package libutil2-0.10.0-1.ppc64 already installed and latest version
Package libutil-devel-0.10.0-1.ppc64 already installed and latest version

Comments (8)

  1. Kevin Adler

    libutil_flock is part of libutil as you have suspected. You can usually fix this when using autotools-based packages by adding -lutil to LIBS or LDFLAGS or another environment variable that ruby uses during its configure step, since it’s not a library that is linked with by default. You may find more info by looking at the output of ./configure --help.

  2. Albert Vaca Cintora reporter

    You are right, I was not passing -lutil in my LDFLAGS, that got me forward a bit but now I’m facing a completely different problem:

    linking miniruby
            ./tool/ifchange "--timestamp=.rbconfig.time" rbconfig.rb rbconfig.tmp
    generating encdb.h
    /bin/sh[3]: 51135 Illegal instruction(coredump)
    /bin/sh: 51134 Illegal instruction(coredump)
    make: The error code from the last command is 132.
    

    The binary that crashes is the miniruby it just built:

    $ ./miniruby 
    Illegal instruction (core dumped)
    

    As far as I know Ruby can be made to compile on IBM i… do you know if there are instructions somewhere on how to compile it, or even a pre-built version?

  3. Log in to comment