Bug 21382

Summary: -fvisibility-inlines-hidden breaks OpenEXR-1.2.2 build.
Product: gcc Reporter: Pawel Sikora <pawel_sikora>
Component: otherAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: gcc-bugs, hjl.tools, mmazur
Priority: P2    
Version: 4.0.0   
Target Milestone: ---   
Host: amd64 & ppc Target: amd64 & ppc
Build: amd64 & ppc Known to work:
Known to fail: Last reconfirmed:
Attachments: build log.
build log.

Description Pawel Sikora 2005-05-04 15:07:42 UTC
on both archs shared objects are build with:
-O2 -ggdb -fvisibility-inlines-hidden -fPIC -DPIC

linking fails with an error:

/usr/bin/ld: .libs/IexBaseExc.o: relocation R_X86_64_PC32 against
`_ZNSsD1Ev@@GLIBCXX_3.4' can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: final link failed: Bad value

without -fvisiblity-inlines-hidden everything is ok on all archs.

is this a gcc or binutils bug?

# gcc-4.0.0 (+fixes for PRs 20973,21173)
# binutils-2.16.90.0.2
Comment 1 Pawel Sikora 2005-05-04 15:08:09 UTC
Created attachment 8818 [details]
build log.
Comment 2 Pawel Sikora 2005-05-04 15:08:35 UTC
Created attachment 8819 [details]
build log.
Comment 3 H.J. Lu 2005-05-04 17:15:18 UTC
Known gcc bug. Check out my patch in bug 19664:

http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00180.html

You may need to fix libstdc++ header files also.

*** This bug has been marked as a duplicate of 19664 ***
Comment 4 Pawel Sikora 2005-05-17 08:27:00 UTC
(In reply to comment #3) 
> Known gcc bug. Check out my patch in bug 19664: 
>  
> http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00180.html 
>  
> You may need to fix libstdc++ header files also. 
 
in PR19664 i see discussion about the libstdc++ headers 
but don't see any patch. 
Comment 5 Paolo Carlini 2005-05-17 08:57:20 UTC
Assuming that the intertwined compiler issues get fixed, the libstdc++ patch 
should be trivial, I'm attaching to 19664 an old draft that maybe has now some 
hunks wrong about copyright dates (if you can rework those and update it, would
be great)