https://bugs.llvm.org/show_bug.cgi?id=33285

            Bug ID: 33285
           Summary: Linkerror with __declspec(selectany) (multiple
                    definitions)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

I get error from the linker when compiling ChakraCore 
https://github.com/Microsoft/ChakraCore
with clang trunk. I happen with ld.gold and ld.lld. Surprisingly it doesn't
happen when compiling with clang-3.8, so clearly there is a regression.

The link error is:
/usr/bin/ld: error: duplicate symbol: BVUnitT<unsigned long>::ShiftValue
>>> defined at 
>>> /home/prazek/devirtualization-results/ChakraCore/bin/GCStress/GCStress.cpp
>>>            
>>> bin/GCStress/CMakeFiles/GCStress.dir/GCStress.cpp.o:(BVUnitT<unsigned 
>>> long>::ShiftValue)
>>> defined at 
>>> /home/prazek/devirtualization-results/ChakraCore/lib/Common/Memory/HeapAllocator.cpp
>>>            HeapAllocator.cpp.o:(.rodata+0x4) in archive 
>>> lib/libChakraCoreStatic.a


This template is defined here
https://github.com/Microsoft/ChakraCore/blob/master/lib/Common/DataStructures/UnitBitVector.h#L491

The reproduced is simple:
1. git clone [email protected]:Microsoft/ChakraCore.git
3. cd ChakraCore
2. ./build.sh -n --cxx=[pathToBuildDir]/bin/clang++
--cc=[pathToBuildDir]/bin/clang

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to