[LLVMbugs] [Bug 11690] Support building chromium in shared_library mode
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Jan 3 10:16:28 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=11690
Ami Fischman <fischman at chromium.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
--- Comment #4 from Ami Fischman <fischman at chromium.org> 2012-01-03 12:16:28 CST ---
The reduced test cases are fixed at r147441, but net_unittests still doesn't
link out of the box. Some more reduced differences:
v2.cc:
template<class T> void Method() {}
extern template __attribute__((visibility("default"))) void Method<char>();
template void Method<char>();
$ echo; clang++ -c -fvisibility-inlines-hidden -fvisibility=hidden v2.cc &&
readelf -Ws v2.o |c++filt |fgrep 'Method<' && g++ -c
-fvisibility-inlines-hidden -fvisibility=hidden v2.cc && readelf -Ws v2.o
|c++filt |fgrep 'Method<'
9: 0000000000000000 1 FUNC WEAK HIDDEN 5 void Method<char>()
10: 0000000000000000 6 FUNC WEAK DEFAULT 5 void Method<char>()
Another difference:
#include <string>
struct string16_char_traits {
typedef int value_type;
typedef short char_type;
typedef std::streamoff off_type;
typedef mbstate_t state_type;
typedef std::fpos<state_type> pos_type;
static void assign(short& c1, const short& c2) {}
static bool eq(const short& c1, const short& c2) { return c1 == c2; }
static bool lt(const short& c1, const short& c2) { return c1 < c2; }
static int compare(const short* s1, const short* s2, size_t n) { return 42; }
static size_t length(const short* s) { return 42; }
static const short* find(const short* s, size_t n, const short& a) { return
0; }
static short* move(short* s1, const short* s2, int n) { return s1; }
static short* copy(short* s1, const short* s2, size_t n) { return s1; }
static short* assign(short* s, size_t n, short a) { return s; }
static int not_eof(const int& c) { return 42; }
static short to_short(const int& c) { return 42; }
static int to_int(const short& c) { return 42; }
static bool eq_int(const int& c1, const int& c2) { return true; }
static int eof() { return 42; }
};
extern template class std::basic_string<short, string16_char_traits>;
typedef std::basic_string<short, string16_char_traits> string16;
template class std::basic_string<short, string16_char_traits>;
$ echo; clang++ -c -fvisibility-inlines-hidden -fvisibility=hidden v2.cc &&
readelf -Ws v2.o |c++filt |fgrep '::size()' && g++ -c
-fvisibility-inlines-hidden -fvisibility=hidden v2.cc && readelf -Ws v2.o
|c++filt |fgrep '::size()'
536: 0000000000000000 30 FUNC WEAK HIDDEN 275
std::basic_string<short, string16_char_traits, std::allocator<short> >::size()
const
474: 0000000000000000 29 FUNC WEAK DEFAULT 338
std::basic_string<short, string16_char_traits, std::allocator<short> >::size()
const
Accomodating these differences with changes in chromium
(http://codereview.chromium.org/9071010) lets net_unittests link (yay!).
I haven't gotten as far as trying to get chrome itself to link yet because of
unrelated issues. I suspect a few more similar cases will pop up.
--
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