Description of problem: The mkmf.rb always requires libruby-static.a to do "have_library("libname"), but it fails because ruby-devel packages does NOT have libruby-static.a. Version-Release number of selected component (if applicable): ruby-1.8.6.111-3 How reproducible: $ sudo yum install ruby ruby-devel rpm-devel db4-devel popt-devel $ rpm -i /path/to/ruby-rpm-1.2.3-3.fc9.src.rpm $ rpmbuild -bb /path/to/src/rpm/SPECS/ruby-rpm.spec Actual results: BUILD/ruby-rpm-1.2.3/ext/rpm/mkmf.log said: have_header: checking for popt.h... -------------------- yes "gcc -E -I/usr/lib/ruby/1.8/i386-linux-gnu -I/usr/lib/ruby/1.8/i386-linux-gnu -I/usr/inclu de/rpm -O0 -g -pipe -m32 -march=i386 -mtune=pentium4 -Wall -fPIC conftest.c -o conftest .i" checked program was: /* begin */ #include <popt.h> /* end */ -------------------- have_library: checking for main() in -lpopt... -------------------- no "gcc -o conftest -I/usr/lib/ruby/1.8/i386-linux-gnu -I/usr/lib/ruby/1.8/i386-linux-gnu -I/ usr/include/rpm -O0 -g -pipe -m32 -march=i386 -mtune=pentium4 -Wall -fPIC conftest.c -L "/usr/lib" -L"/usr/lib" -lruby-static -lpopt -ldl -lcrypt -lm -lc" /usr/bin/ld: cannot find -lruby-static collect2: ld returned 1 exit status checked program was: /* begin */ /*top*/ int main() { return 0; } int t() { main(); return 0; } /* end */ "gcc -o conftest -I/usr/lib/ruby/1.8/i386-linux-gnu -I/usr/lib/ruby/1.8/i386-linux-gnu -I/ usr/include/rpm -O0 -g -pipe -m32 -march=i386 -mtune=pentium4 -Wall -fPIC conftest.c -L "/usr/lib" -L"/usr/lib" -lruby-static -lpopt -ldl -lcrypt -lm -lc" /usr/bin/ld: cannot find -lruby-static collect2: ld returned 1 exit status checked program was: /* begin */ /*top*/ int main() { return 0; } int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; } /* end */ --------------------
reverted the change in 1.8.6.111-7.fc9. libruby-static.a is back now.
Changing version to '9' as part of upcoming Fedora 9 GA. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
In that case, the link against static ruby is checked when -lpopt is checked, however it is not used for the final link. So this approach seems buggy to me. In my opinion have_library should be more clever and try the link with shared libs only before trying with static libs. Or, alternatively, in fedora, #$LIBRUBYARG_STATIC should be removed from Config::CONFIG in link_command.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
For ruby-1.9.1, I'm thinking about shipping the static library in a -static subpackage to comply with packaging guidelines, would that help?
That's the objective, but as long as the issue I explained (maybe confusingly) in Comment #3 is still there, it cannot be done. Or the -devel package should require the static subpackage.
(In reply to comment #6) > It cannot be done, or the -devel package should > require the static subpackage. That's what I've done ;-)
(In reply to comment #7) > (In reply to comment #6) > > It cannot be done, or the -devel package should > > require the static subpackage. > > That's what I've done ;-) In that case we don't gain much. The bug in linking command issued should be fixed such that the static library is never used in the build.
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
I rebased to rawhide, assuming, from the comments that the issue wasn't fixed.
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle. Changing version to '12'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
*** Bug 545548 has been marked as a duplicate of this bug. ***
The problem is that as Patrice said in comment 3, when trying $ ruby -e "require 'mkmf' ; have_library 'z'" link_command() (called by have_library() in the end) always tries to use libruby-static.a as: ======================================================== 268 def link_command(ldflags, opt="", libpath=$DEFLIBPATH|$LIBPATH) 269 conf = Config::CONFIG.merge('hdrdir' => $hdrdir.quote, 270 'src' => CONFTEST_C, 271 'INCFLAGS' => $INCFLAGS, 272 'CPPFLAGS' => $CPPFLAGS, 273 'CFLAGS' => "#$CFLAGS", 274 'ARCH_FLAG' => "#$ARCH_FLAG", 275 'LDFLAGS' => "#$LDFLAGS #{ldflags}", 276 'LIBPATH' => libpathflag(libpath), 277 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs", 278 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS") 279 Config::expand(TRY_LINK.dup, conf) 280 end ======================================================== This should be okay with LIBRUBYARG_SHARED. Note that changing to LIBRUBYARG_SHARED requires some more hacks when building ruby itself. Modified on 1.8.6.383-5
Once closing as the last modification seems to be working.
ruby-1.8.6.383-6.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
ruby-1.8.6.383-6.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.