Bug 505453 - g++ -static cannot produce programs because of missing libm.a
Summary: g++ -static cannot produce programs because of missing libm.a
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 11
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-11 23:24 UTC by djk
Modified: 2009-06-12 06:42 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-06-12 06:42:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description djk 2009-06-11 23:24:33 UTC
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):

glibc-devel-2.10.1-1.i586
How reproducible:


Steps to Reproduce:
1. echo 'int main(){return 0;}'>broken.cpp
2. g++ -static broken.cpp
3.
  
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 06:42:34 UTC
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:
http://people.redhat.com/drepper/no_static_linking.html


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