[OpenMP] Use weak attribute in interface only for static library
authorJoachim Protze <protze@itc.rwth-aachen.de>
Thu, 30 Jul 2020 07:28:17 +0000 (09:28 +0200)
committerJoachim Protze <protze@itc.rwth-aachen.de>
Fri, 31 Jul 2020 10:29:05 +0000 (12:29 +0200)
commit03116a9f8c2fc98577e153083aaf9b6a701ab8f9
treee65941b5b55b958d6b2ffdb70d3a56d9b949ca4c
parent161882816540fc011554e4a820ab896278491b6a
[OpenMP] Use weak attribute in interface only for static library

This is to address the issue reported at:
https://bugs.llvm.org/show_bug.cgi?id=46863

Since weak is meaningless for a shared library interface function, this patch
disables the attribute, when the OpenMP library is built as shared library.

ompt_start_tool is not an interface function, but a internally called function
possibly implemented by an OMPT tool.
This function needs to be weak if possible to allow overwriting ompt_start_tool
with a function implementation built into the application.

Differential Revision: https://reviews.llvm.org/D84871
openmp/runtime/src/kmp_ftn_entry.h
openmp/runtime/src/kmp_os.h
openmp/runtime/src/ompt-specific.cpp