Bug 505453 - g++ -static cannot produce programs because of missing libm.a
g++ -static cannot produce programs because of missing libm.a
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
i686 Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-06-11 19:24 EDT by djk
Modified: 2009-06-12 02:42 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-06-12 02:42:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description djk 2009-06-11 19:24:33 EDT
Description of problem:
c++ programs cannot be built as static programs.

g++ -static fails to link because of a missing /usr/lib/libm.a
glibc-devel-2.10.1-1.i586.rpm has been installed.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. echo 'int main(){return 0;}'>broken.cpp
2. g++ -static broken.cpp
Actual results:
/usr/bin/ld: cannot find -lm

Expected results:

Additional info:
libm.a was provided by glibc-devel-2.9-3.i386 in F10.
Comment 1 Jakub Jelinek 2009-06-12 02:42:34 EDT
You need to install glibc-static if you want to link statically.  And it is not installed by default intentionally, static linking is not recommended:

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