Ruby-1.6.8-preview4 compile fails in ncurses

Compiling ruby-1.6.8-preview fails with lots of undefined references
when trying to build curses. I have never had his problem with
previous versions: 1.6.6 and 1.6.7 built straight out of the box. I
think I have upgraded glibc-* packages since I last tried to build
ruby, so may be that is the reason?

Details:
AMD K6 233MHz
Linux 2.2.23
Red Hat 6.2
glibc-2.1.3-28 (rpm)
gcc 2.95.3
…/configure
–enable-shared

Here’s the log:

compiling Win32API
compiling curses
make[1]: Entering directory /usr/local/src/Build/Tools/ruby-1.6.8-preview4/ext/curses' gcc -shared -Wl,--no-undefined -L/usr/local/src/Build/Tools/ruby-1.6.8-preview4 -L/usr/local/lib -o curses.so curses.o -L. -lruby -lncurses -lc /usr/local/src/Build/Tools/ruby-1.6.8-preview4/libruby.so: undefined reference todlclose@GLIBC_2.0’
/lib/libc.so.6: undefined reference to _dl_init_next@GLIBC_2.0' /lib/libc.so.6: undefined reference to_dl_lazy@GLIBC_2.1.1’
/usr/local/src/Build/Tools/ruby-1.6.8-preview4/libruby.so: undefined reference to dlerror@GLIBC_2.0' /lib/libc.so.6: undefined reference to_dl_dst_substitute@GLIBC_2.1.1’
/lib/libc.so.6: undefined reference to _dl_relocate_object@GLIBC_2.0' /lib/libc.so.6: undefined reference to__libc_enable_secure@GLIBC_2.0’
/lib/libc.so.6: undefined reference to _dl_catch_error@GLIBC_2.0' /usr/local/src/Build/Tools/ruby-1.6.8-preview4/libruby.so: undefined reference tocrypt@GLIBC_2.0’
/usr/local/src/Build/Tools/ruby-1.6.8-preview4/libruby.so: undefined reference to dlopen@GLIBC_2.1' /lib/libc.so.6: undefined reference to_dl_platformlen@GLIBC_2.1.1’
/lib/libc.so.6: undefined reference to _dl_mcount@GLIBC_2.1' /lib/libc.so.6: undefined reference to_dl_dst_count@GLIBC_2.1.1’
/lib/libc.so.6: undefined reference to _dl_initial_searchlist@GLIBC_2.1' /lib/libc.so.6: undefined reference to_dl_start_profile@GLIBC_2.1’
/usr/local/src/Build/Tools/ruby-1.6.8-preview4/libruby.so: undefined reference to dlsym@GLIBC_2.0' /lib/libc.so.6: undefined reference to_dl_lookup_symbol@GLIBC_2.0’
/lib/libc.so.6: undefined reference to __libc_stack_end@GLIBC_2.1' /lib/libc.so.6: undefined reference to_dl_loaded@GLIBC_2.1’
/lib/libc.so.6: undefined reference to _dl_origin_path@GLIBC_2.1.1' /lib/libc.so.6: undefined reference to_dl_map_object@GLIBC_2.0’
/lib/libc.so.6: undefined reference to _dl_check_all_versions@GLIBC_2.0' /lib/libc.so.6: undefined reference to_dl_main_searchlist@GLIBC_2.1’
/lib/libc.so.6: undefined reference to _dl_debug_impcalls@GLIBC_2.0' /lib/libc.so.6: undefined reference to_dl_profile@GLIBC_2.1’
/lib/libc.so.6: undefined reference to _dl_debug_state@GLIBC_2.0' /lib/libc.so.6: undefined reference to_r_debug@GLIBC_2.0’
/lib/libc.so.6: undefined reference to _dl_debug_message@GLIBC_2.0' /lib/libc.so.6: undefined reference to_dl_unload_cache@GLIBC_2.1’
/lib/libc.so.6: undefined reference to _dl_signal_error@GLIBC_2.0' /lib/libc.so.6: undefined reference to_dl_map_object_deps@GLIBC_2.0’
/lib/libc.so.6: undefined reference to _dl_profile_map@GLIBC_2.1' /lib/libc.so.6: undefined reference to_dl_profile_output@GLIBC_2.1’
/lib/libc.so.6: undefined reference to _dl_fpu_control@GLIBC_2.1' /lib/libc.so.6: undefined reference to_dl_debug_initialize@GLIBC_2.0’
/lib/libc.so.6: undefined reference to _dl_global_scope_alloc@GLIBC_2.1' collect2: ld returned 1 exit status make[1]: *** [curses.so] Error 1 make[1]: Leaving directory/usr/local/src/Build/Tools/ruby-1.6.8-preview4/ext/curses’

Cheers,

Jeremy Henty

In article slrnb03c14.bd.jeremy@ganglion.demon.co.uk, Jeremy Henty
(ie. me) wrote:

Compiling ruby-1.6.8-preview fails with lots of undefined references
when trying to build curses. I have never had his problem with
previous versions: 1.6.6 and 1.6.7 built straight out of the box. I
think I have upgraded glibc-* packages since I last tried to build
ruby, so may be that is the reason?

Update: no it is not the reason. I went back to the ruby-1.6.7
source, ran ‘make distclean’, then rebuilt. No problem. Did the same
in ruby-1.6.8-preview. Same problem as before.

I notice that the ruby-1.6.8-preview build made the ruby executable
OK, but fell over compiling the first file of the first extension.
Which suggests that maybe the actual build for extensions is broken
rather than curses itself. I will investigate further.

Jeremy Henty

Hi,

···

At Thu, 19 Dec 2002 20:55:45 +0900, Jeremy Henty wrote:

Compiling ruby-1.6.8-preview fails with lots of undefined references
when trying to build curses. I have never had his problem with
previous versions: 1.6.6 and 1.6.7 built straight out of the box. I
think I have upgraded glibc-* packages since I last tried to build
ruby, so may be that is the reason?

Details:
AMD K6 233MHz
Linux 2.2.23
Red Hat 6.2
glibc-2.1.3-28 (rpm)
gcc 2.95.3
…/configure
–enable-shared

On my box, it worked fine. Whitch version is your ld?
$ ld -v
GNU ld version 2.11.92.0.10 20011021

Does this patch fix it?

Index: extmk.rb.in

RCS file: /cvs/ruby/src/ruby/ext/Attic/extmk.rb.in,v
retrieving revision 1.34.2.37
diff -u -2 -p -r1.34.2.37 extmk.rb.in
— extmk.rb.in 11 Dec 2002 15:13:37 -0000 1.34.2.37
+++ extmk.rb.in 19 Dec 2002 14:31:52 -0000
@@ -379,9 +379,9 @@ def create_makefile(target)
$DLDFLAGS = ‘@DLDFLAGS@’
if /linux/ =~ RUBY_PLATFORM and $configure_args[‘–enable-shared’] and “@GNU_LD@” == “yes”

  • $DLDFLAGS << " -Wl,–no-undefined"
  • $DLDFLAGS << " -Wl,–no-undefined -Wl,–allow-shlib-undefined"
    end

if $configure_args[‘–enable-shared’] or “@LIBRUBY@” != “@LIBRUBY_A@”

  • $libs = "@LIBRUBYARG@ " + $libs
  • optlibs = "@LIBRUBYARG@ @LIBS@ "
    $LIBPATH.unshift $topdir
    end
    @@ -449,5 +449,5 @@ target_prefix = #{target_prefix}
    "
    mfile.printf “LOCAL_LIBS = %s %s\n”, $LOCAL_LIBS, $local_flags
  • mfile.printf “LIBS = %s\n”, $libs
  • mfile.printf “LIBS = %s%s\n”, optlibs, $libs
    mfile.printf "OBJS = "
    if !$objs then


Nobu Nakada

Nobu,

Thank you for replying so quickly,

In article
200212191433.gBJEXcc18722@sharui.nakada.kanuma.tochigi.jp,

… Whitch version is your ld?
$ ld -v
GNU ld version 2.11.92.0.10 20011021

GNU ld version 2.9.5 (with BFD 2.9.5.0.22)

I fixed things myself by commenting out ext/extmk.rb.in , line 381.

381: $DLDFLAGS << " -Wl,–no-undefined"

Now ruby builds, tests and installs OK. Unfortunately your patch
gives me:

gcc -shared -Wl,–no-undefined -Wl,–allow-shlib-undefined -L/usr/local/src/Build/Tools/ruby-1.6.8-preview4 -L/usr/local/lib -o curses.so curses.o -L. -lruby -ldl -lcrypt -lm -lncurses -lc
/usr/bin/ld: unrecognized option `–allow-shlib-undefined’

Maybe Red Hat 6.3 is too old? :frowning:

HTH,

Jeremy Henty

···

nobu.nokada@softhome.net wrote:

Hi,

I fixed things myself by commenting out ext/extmk.rb.in , line 381.

381: $DLDFLAGS << " -Wl,–no-undefined"

Now ruby builds, tests and installs OK. Unfortunately your patch
gives me:

gcc -shared -Wl,–no-undefined -Wl,–allow-shlib-undefined -L/usr/local/src/Build/Tools/ruby-1.6.8-preview4 -L/usr/local/lib -o curses.so curses.o -L. -lruby -ldl -lcrypt -lm -lncurses -lc
/usr/bin/ld: unrecognized option `–allow-shlib-undefined’

What does reverting line 381 change?

Maybe Red Hat 6.3 is too old? :frowning:

Maybe.

···

At Fri, 20 Dec 2002 00:36:26 +0900, Jeremy Henty wrote:


Nobu Nakada

In article
200212191617.gBJGH7c27605@sharui.nakada.kanuma.tochigi.jp,

Hi,

I fixed things myself by commenting out ext/extmk.rb.in , line 381.

381: $DLDFLAGS << " -Wl,–no-undefined"

Now ruby builds, tests and installs OK. Unfortunately your patch
gives me:

gcc -shared -Wl,–no-undefined -Wl,–allow-shlib-undefined -L/usr/local/src/Build/Tools/ruby-1.6.8-preview4 -L/usr/local/lib -o curses.so curses.o -L. -lruby -ldl -lcrypt -lm -lncurses -lc
/usr/bin/ld: unrecognized option `–allow-shlib-undefined’

What does reverting line 381 change?

Same problem as before.

Maybe Red Hat 6.3 is too old? :frowning:

Maybe.

I have downloaded the latest binutils. I guess that should fix it.

Regards,

Jeremy

···

nobu.nokada@softhome.net wrote:

At Fri, 20 Dec 2002 00:36:26 +0900, > Jeremy Henty wrote:

In article slrnb069pq.6gp.jeremy@ganglion.demon.co.uk, Jeremy Henty
(ie. me) wrote:

I fixed things myself by commenting out ext/extmk.rb.in , line 381.

381: $DLDFLAGS << " -Wl,–no-undefined"

Now ruby builds, tests and installs OK. Unfortunately your patch
gives me:

gcc -shared -Wl,–no-undefined -Wl,–allow-shlib-undefined -L/usr/local/src/Build/Tools/ruby-1.6.8-preview4 -L/usr/local/lib -o curses.so curses.o -L. -lruby -ldl -lcrypt -lm -lncurses -lc
/usr/bin/ld: unrecognized option `–allow-shlib-undefined’

I have downloaded the latest binutils. I guess that should fix it.

Update: it did. Thanks to Nobu for all his suggestions.

Regards,

Jeremy Henty