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 to
dlclose@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 to
crypt@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
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? 
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? 
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? 
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