Description of problem: Ruby packages which use the autoconf.rb mechanism fail to compile on ppc64. I experienced this problem when I downloaded eruby from http://www.modruby.net/en/index.rbx/eruby/download.html and tried to compile it. The .o files are generated as 64-bit, but the make process tries to link them as a 32-bit app or lib. This is due to missing -m64 flag in the link command line. The compile and link flags are obtained from /usr/lib64/ruby/1.8/powerpc64-linux/rbconfig.rb. If I hand edit the file to include the flag in CONFIG["LDFLAGS"] and CONFIG["LDSHARED"], then I can successfuly build the application. Another alternative IMHO is to change CONFIG["CC"] to gcc -m64, then the -m64 which is currently in CONFIG["CFLAGS"] is not necessary anymore. Version-Release number of selected component (if applicable): ruby-libs-1.8.6.230-4.fc9.ppc64 How reproducible: Always Steps to Reproduce: 1. Download eruby from http://www.modruby.net/en/index.rbx/eruby/download.html 2. cd eruby-1.0.5 3. RUBYLIB=/usr/lib64/ruby/1.8/powerpc64-linux ./configure.rb 4. make Actual results: gcc -L. -rdynamic -Wl,-export-dynamic -L/usr/lib64 eruby_logo.o eruby_main.o liberuby.a -lruby -lpthread -ldl -lcrypt -lm -o eruby /usr/bin/ld: skipping incompatible /usr/lib64/libruby.so when searching for -lruby /usr/bin/ld: skipping incompatible /usr/lib64/libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib64/libpthread.a when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib64/libdl.so when searching for -ldl /usr/bin/ld: skipping incompatible /usr/lib64/libdl.a when searching for -ldl /usr/bin/ld: skipping incompatible /usr/lib64/libcrypt.so when searching for -lcrypt /usr/bin/ld: skipping incompatible /usr/lib64/libcrypt.a when searching for -lcrypt /usr/bin/ld: skipping incompatible /usr/lib64/libm.so when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib64/libm.a when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib64/libc.so when searching for -lc /usr/bin/ld: skipping incompatible /usr/lib64/libc.a when searching for -lc /usr/bin/ld: powerpc:common64 architecture of input file `eruby_logo.o' is incompatible with powerpc:common output /usr/bin/ld: powerpc:common64 architecture of input file `eruby_main.o' is incompatible with powerpc:common output /usr/bin/ld: powerpc:common64 architecture of input file `liberuby.a(eruby_lib.o)' is incompatible with powerpc:common output eruby_main.o: In function `defout_write': /home/bauermann/scratchpad/lamp-fixes/eruby/eruby-1.0.5/eruby_main.c:396: relocation truncated to fit: R_PPC64_REL24 against `r b_obj_as_string' /home/bauermann/scratchpad/lamp-fixes/eruby/eruby-1.0.5/eruby_main.c:397: relocation truncated to fit: R_PPC64_REL24 against `r b_str_cat' eruby_main.o: In function `print_http_headers': /home/bauermann/scratchpad/lamp-fixes/eruby/eruby-1.0.5/eruby_main.c:295: relocation truncated to fit: R_PPC64_REL24 against `g etenv' eruby_main.o: In function `printf': /usr/include/bits/stdio2.h:105: relocation truncated to fit: R_PPC64_REL24 against `__printf_chk' eruby_main.o: In function `print_http_headers': /home/bauermann/scratchpad/lamp-fixes/eruby/eruby-1.0.5/eruby_main.c:298: relocation truncated to fit: R_PPC64_REL24 against `g etenv' <SNIP> eruby_main.o: In function `print_http_headers': /home/bauermann/scratchpad/lamp-fixes/eruby/eruby-1.0.5/eruby_main.c:302: additional relocation overflows omitted from the output collect2: ld returned 1 exit status make: *** [eruby] Error 1 Expected results: gcc -m64 -L. -rdynamic -Wl,-export-dynamic -L/usr/lib64 eruby_logo.o eruby_main.o liberuby.a -lruby -lpthread -ldl -lcrypt -lm -o eruby gcc -m64 -shared -o eruby.so eruby_ext.o -L/usr/lib64 liberuby.a -lruby -lpthread -ldl -lcrypt -lm $
I'd say this isn't a ruby's fault. all of the parameters in rbconfig.rb was auto-generated from config.status which was generated by configure script with some envvars and options from %configure macro in rpm. usually CFLAGS and LDFLAGS are used together to build autotoolized and libtoolized applications. however just giving CFLAGS to ld directly isn't acceptable way. which autoconf.rb would takes. So I'd suggest to add -m64 to LDFLAGS in %configure macro for 64bit archs unless we don't do that intentionally. Or the kind of $RPM_OPT_FLAGS for LDFLAGS may be helpful for non-libtoolized applications. reassigning to redhat-rpm-config so far.
LDSHARED also needs to have -m64. There's a school of thought which says that ABI-changing options such as -m64 should go in CC and not CFLAGS. See: http://www.mail-archive.com/autoconf@gnu.org/msg17168.html I don't really have an opinion, though.
This message is a reminder that Fedora 9 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 9. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '9'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 9's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 9 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed.