Bug 234183 - Change g++ to use --as-needed
Summary: Change g++ to use --as-needed
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
(Show other bugs)
Version: rawhide
Hardware: All Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Whiteboard: bzcl34nup
Depends On:
TreeView+ depends on / blocked
Reported: 2007-03-27 16:30 UTC by Bryan Mason
Modified: 2008-05-07 01:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-07 01:22:13 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Bryan Mason 2007-03-27 16:30:10 UTC
+++ This bug was initially created as a clone of Bug #191162 +++

Here's the simplest of all "hello world" programs :

   % cat foo.C
   #include <iostream>

   int main()
     std::cout << "Hello world" << std::endl;

When compiled and linked with default gcc4 options on RHEL4 I get:

   % x86_64-rhel4-4.0.2-g++ foo.C -o foo
   % ldd -u -r foo
   Unused direct dependencies:

[Using "g++ -o foo foo.cc -v" shows that] libm is indeed being pulled in
(newlines added for legibility):

   -m elf_x86_64
   -dynamic-linker /lib64/ld-linux-x86-64.so.2
   -o foo

   -L/usr/lib/gcc/x86_64-redhat-linux/4.0.2/../../.. -L/lib/../lib64
   -L/usr/lib/../lib64 /tmp/ccgaawQ2.o



It sounds plausible that this happens because libstdc++ may sometimes need
it, so the remaining question is why -Wl,--as-needed is not the default.

Comment 2 Bug Zapper 2008-04-03 23:50:29 UTC
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 3 Bug Zapper 2008-05-07 01:22:11 UTC
This bug has been in NEEDINFO for more than 30 days since feedback was
first requested. As a result we are closing it.

If you can reproduce this bug in the future against a maintained Fedora
version please feel free to reopen it against that version.

The process we're following is outlined here:

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