Bug 493929 - -fvisibility=hidden is broken when inlining is enabled
Summary: -fvisibility=hidden is broken when inlining is enabled
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gcc44   
(Show other bugs)
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-03 10:21 UTC by mkhon
Modified: 2009-09-02 11:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 11:43:24 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1375 normal SHIPPED_LIVE gcc44 bug fix and enhancement update 2009-09-01 11:21:22 UTC

Description mkhon 2009-04-03 10:21:11 UTC
Test program:

--- cut here ---
#include <iostream>

int
main()
{
        std::cout << "Hello, world" << std::endl;
        return 0;
}
--- cut here ---

The program can not be compiled with -fvisibility=hidden and -O1 or higher, but adding -fno-inline helps:

kenny:~/work/ty$g++43 -fvisibility=hidden -O t.cc
/usr/bin/ld: a.out: hidden symbol `void std::__ostream_fill<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, long)' isn't defined
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
kenny:~/work/ty$g++43 -fvisibility=hidden -O -fno-inline t.cc
kenny:~/work/ty$

Environment:

kenny:~/work/ty$rpm -q gcc43 gcc43-c++ libstdc++43-devel libstdc++ binutils
gcc43-4.3.2-7.el5
gcc43-c++-4.3.2-7.el5
libstdc++43-devel-4.3.2-7.el5
libstdc++-4.1.2-44.el5
binutils-2.17.50.0.6-9.el5
kenny:~/work/ty$g++43 -v
Using built-in specs.
Target: i386-redhat-linux6E
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,fortran --disable-libgcj --with-cpu=generic --build=i386-redhat-linux6E
Thread model: posix
gcc version 4.3.2 20081007 (Red Hat 4.3.2-7) (GCC) 
kenny:~/work/ty$ld -v
GNU ld version 2.17.50.0.6-9.el5 20061020
kenny:~/work/ty$

Comment 9 Kevin Bowling 2009-07-23 05:54:38 UTC
I hit this when compiling just about anything since -O triggers it (obviously since any time iostream is used).  Any ETA on a fix?  Compiling with -fno-inline is a valid workaround but at the expense of size and speed of compiled binaries.

Comment 10 Michal Nowak 2009-07-23 11:38:46 UTC
(In reply to comment #9)

This bug has been verified against gcc44-4.4.0-6.el5. Do you experience problems with this version?

Comment 11 Kevin Bowling 2009-07-28 05:58:18 UTC
(In reply to comment #10)
> (In reply to comment #9)
> 
> This bug has been verified against gcc44-4.4.0-6.el5. Do you experience
> problems with this version?  

Sorry, I don't have access to a 5.4 box.  No chance of backporting a fix to 5.3?  -O and iostream is just about everything.  How this made is past internal testing must be embarrassing :-P.

Comment 12 Michal Nowak 2009-08-03 09:11:39 UTC
(In reply to comment #11)
> Sorry, I don't have access to a 5.4 box.  No chance of backporting a fix to
> 5.3?  

Ask support on how to escalate issues into EUS.

> -O and iostream is just about everything.  How this made is past internal
> testing must be embarrassing :-P.

Comment 14 errata-xmlrpc 2009-09-02 11:43:24 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1375.html


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