Bug 493929 - -fvisibility=hidden is broken when inlining is enabled
-fvisibility=hidden is broken when inlining is enabled
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gcc44 (Show other bugs)
5.3
All Linux
low Severity medium
: rc
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-03 06:21 EDT by mkhon
Modified: 2009-09-02 07:43 EDT (History)
4 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description mkhon 2009-04-03 06:21:11 EDT
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 01:54:38 EDT
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 07:38:46 EDT
(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 01:58:18 EDT
(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 05:11:39 EDT
(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 07:43:24 EDT
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.