Bug 505453

Summary: g++ -static cannot produce programs because of missing libm.a
Product: [Fedora] Fedora Reporter: djk
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: jakub
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-06-12 06:42:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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