[LLVMbugs] [Bug 10038] New: clang++ generates HIDDEN symbols where g++ doesn't
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri May 27 10:00:21 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=10038
Summary: clang++ generates HIDDEN symbols where g++ doesn't
Product: clang
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: fischman at chromium.org
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=6661)
--> (http://llvm.org/bugs/attachment.cgi?id=6661)
repro case for clang++/g++ differenc
For the attached source file, I get this:
$ clang++ -c -fvisibility-inlines-hidden -fvisibility=hidden visibility.cc &&
readelf -Ws visibility.o |c++filt |fgrep 'std::basic_string<unsigned short,
base::string16_char_traits, std::allocator<unsigned short> >::insert(unsigned
long, unsigned short const*)' && g++ -c -fvisibility-inlines-hidden
-fvisibility=hidden visibility.cc && readelf -Ws visibility.o |c++filt |fgrep
'std::basic_string<unsigned short, base::string16_char_traits,
std::allocator<unsigned short> >::insert(unsigned long, unsigned short const*)'
630: 0000000000000000 79 FUNC WEAK HIDDEN 458
std::basic_string<unsigned short, base::string16_char_traits,
std::allocator<unsigned short> >::insert(unsigned long, unsigned short const*)
582: 0000000000000000 66 FUNC WEAK DEFAULT 399
std::basic_string<unsigned short, base::string16_char_traits,
std::allocator<unsigned short> >::insert(unsigned long, unsigned short const*)
Note that whereas clang++ generates a HIDDEN symbol, g++ generates a DEFAULT
(public) symbol. What's up with that?
(note that both -fvisibility-inlines-hidden -fvisibility=hidden are specified;
if only one is specified then different symbols in std::basic_string are
DEFAULT or HIDDEN, depending on whether they got inlined or not).
This came up in the context of making chromium's component=shared_library build
work with clang (it works fine w/ gcc). For details on this build style see
https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/846e33b3952f726/80ca2a622a05ed85#
Version info: this is all on a lucid ubuntu box and:
clang version 3.0 (trunk 131935)
Target: x86_64-unknown-linux-gnu
Thread model: posix
and:
g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3
--
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.
More information about the llvm-bugs
mailing list