http://llvm.org/bugs/show_bug.cgi?id=10123
Summary: Linker error when mixing visibility
Product: clang
Version: 2.9
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Created an attachment (id=6727)
--> (http://llvm.org/bugs/attachment.cgi?id=6727)
Example project
If I define a new non-POD type in a header and then include this header from
two sources, respectively compiled with -fvisibility=hidden and
-fvisibility=default *and* -m32 then I get a linker error if both sources
instantiate the non-POD type, example of error:
ld: bad codegen, pointer diff in _main to global weak symbol
__ZNSt6vectorIiSaIiEED1Ev for architecture i386
This is even though the shared header is enclosed in #pragma GCC visibility
push(default) … pop.
Note though that it *does* link without problems when building with -m64.
I have attached an example project with a build.sh which shows the problem.
If you wonder why I mix visibility for my sources then it is due to issue
10113, which prevents me from compiling all my sources with visibility set to
hidden.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs