[llvm-dev] __clang_call_terminate referenced in ...; defined in discarded section

Riyaz Puthiyapurayil via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 16 09:37:44 PDT 2016

I am looking for hints on what could be the cause for the following error:

`__clang_call_terminate' referenced in section `.text' of [...]: defined in discarded section `.text.__clang_call_terminate[__clang_call_terminate]' of [...]

The clang version is 3.8.1 running on redhat 5 (old). clang 3.4 works without issues on the same platform. The above error occurs only when -g is used (possibly the reference to __clang_call_terminate gets removed when optimizations are enabled). There is another issue (a run-time crash in the executable generated by clang that I am trying to debug when the above error was exposed).

I know that __clang_call_terminate is defined in libc++abi. But the executable I am building is built with -static-libgcc and -static-libstdc++ options. libc++ or libc++abi are not used.

In case, it is relevant, the clang++ compiler that I am using was first built from release_38 branch using g++ 4.8.3 and libstdc++ and then rebuilt with that clang++ and libc++/libc++abi.

I will try to create a standalone test case but if you can provide any hints to possible causes, it would help.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160616/5fb55898/attachment.html>

More information about the llvm-dev mailing list