http://llvm.org/bugs/show_bug.cgi?id=17964

            Bug ID: 17964
           Summary: [regression] weak_odr global crashes linker on OS X
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: MC
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

For this module

---
; ModuleID = 'booltest.ll'
@foo = weak_odr thread_local global i8 1
define i32 @main() {
    ret i32 0
}
---

running "llc -filetype=obj booltest.ll && clang booltest.o" yields:

---
0  0x10feeb098  __assert_rtn + 144
1  0x10ff78b48  ld::passes::tlvp::doPass(Options const&, ld::Internal&) + 1674
2  0x10feeb416  main + 520
3  0x10fedccd4  start + 52
A linker snapshot was created at:
    /tmp/a.out-2013-10-17-022718.ld-snapshot
ld: Assertion failed: (0 && "wrong content type for target in tlv defs"),
function doPass, file /SourceCache/ld64/ld64-136/src/ld/passes/tlvp.cpp, line
278.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
---

(LLVM r94929, ld64-136)


Because of this bug, LDC is still stuck with LLVM 3.2 on OS X (also see bug
15972). It also means that the following is likely not going to work with Clang
either:
---
template <int N> struct Foo { __thread static int a; };
template <int N> __thread int Foo<N>::a = N;
int main() { return Foo<0>::a; }
---

-- 
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

Reply via email to