Build of C++ project with clang++ fails (local symbol 1: discarded in section `xxx')

I have C++ project that builds fine with g++.
But when I try to replace g++ with clang++ I get such errors (see below) during link.
What might be a problem?

Yuri

--- errors are like this ---
local symbol 1: discarded in section `.text.SomeSymbolHere1'
local symbol 2: discarded in section `.text.SomeSymbolHere2'
...

Hello Yuri,

Did you look at http://cfe.llvm.org/compatibility.html yet?

--Sam

I couldn't find any clues there. This site mostly talks about C++ issues stemming from C++ templates.

But here is what I noticed: linker complains several times on the same weak symbol (W in 'nm' output) for some inline function that occurs in various .o files in various .a libraries being linked into executable.

For example, linker complains on an implicit (compiler-generated) destructor for one class from the header included into many .cpp files. This destructor appears many times as 'W' symbol in all .o files for these .cpp files.

Why would linker not ignore W symbols and instead produce such weird error messages?

Yuri