This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 428384 - mkmf.rb requires libruby-static.a
mkmf.rb requires libruby-static.a
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: ruby (Show other bugs)
rawhide
All All
low Severity low
: ---
: ---
Assigned To: Jeroen van Meeuwen
Fedora Extras Quality Assurance
: Reopened, Triaged
: 545548 (view as bug list)
Depends On: 545548
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-11 03:22 EST by SATOH Fumiyasu
Modified: 2010-01-13 20:25 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-18 11:50:27 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description SATOH Fumiyasu 2008-01-11 03:22:46 EST
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 */

--------------------
Comment 1 Akira TAGOH 2008-01-15 23:50:23 EST
reverted the change in 1.8.6.111-7.fc9. libruby-static.a is back now.
Comment 2 Bug Zapper 2008-05-14 00:44:42 EDT
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
Comment 3 Patrice Dumas 2008-07-08 11:57:38 EDT
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.
Comment 4 Fedora Admin XMLRPC Client 2009-01-30 07:45:16 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 5 Jeroen van Meeuwen 2009-02-17 06:43:03 EST
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?
Comment 6 Patrice Dumas 2009-02-17 08:30:07 EST
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.
Comment 7 Jeroen van Meeuwen 2009-02-17 09:38:37 EST
(In reply to comment #6)
> It cannot be done, or the -devel package should
> require the static subpackage.

That's what I've done ;-)
Comment 8 Patrice Dumas 2009-02-18 06:05:57 EST
(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.
Comment 9 Bug Zapper 2009-06-09 19:21:51 EDT
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
Comment 10 Patrice Dumas 2009-06-10 06:07:43 EDT
I rebased to rawhide, assuming, from the comments that the issue wasn't fixed.
Comment 11 Bug Zapper 2009-11-16 03:00:09 EST
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
Comment 12 Mamoru TASAKA 2009-12-09 00:19:38 EST
*** Bug 545548 has been marked as a duplicate of this bug. ***
Comment 13 Mamoru TASAKA 2009-12-09 04:56:57 EST
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
Comment 14 Mamoru TASAKA 2009-12-18 11:50:27 EST
Once closing as the last modification seems to be working.
Comment 15 Fedora Update System 2010-01-13 20:25:00 EST
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.
Comment 16 Fedora Update System 2010-01-13 20:25:28 EST
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.

Note You need to log in before you can comment on or make changes to this bug.