Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Intel C++ Compiler 18 update 2 MacOS thread local compilation failure

Zhong_C_Intel
Employee
352 Views
#include <iostream>

template <class T> class wrapper {
public:
  static T get() {
    static thread_local T thing(12);
    return thing;
  }
};

int main() {
  std::cout<<wrapper<int>::get()<<std::endl;  
}

And I get this, it compile and function as expected using clang++

icpc -std=c++11  -g thread_local.cc

0  0x10b0cf2c0  __assert_rtn + 129

1  0x10b196eb3  ld::passes::tlvp::doPass(Options const&, ld::Internal&) + 1987

2  0x10b0d016b  main + 913

3  0x7fff70f9c015  start + 1

A linker snapshot was created at:

    /tmp/a.out-2018-03-19-204307.ld-snapshot

ld: Assertion failed: (0 && "wrong content type for target in tlv defs"), function doPass, file /Library/Caches/com.apple.xbs/Sources/ld64/ld64-351.8/src/ld/passes/tlvp.cpp, line 293.

0 Kudos
1 Reply
Viet_H_Intel
Moderator
352 Views

Hi,

I've reported this case to our developer and will keep you updated. Case number is CMPLRS-50042. 

Thanks,

Viet

0 Kudos
Reply