[all-commits] [llvm/llvm-project] 429d3d: [Libomptarget] Build plugins with protected visibi...

Joseph Huber via All-commits all-commits at lists.llvm.org
Thu Oct 20 09:12:37 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 429d3d4e9d8dd9f8a07c5304b7d840395521c882
      https://github.com/llvm/llvm-project/commit/429d3d4e9d8dd9f8a07c5304b7d840395521c882
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-10-20 (Thu, 20 Oct 2022)

  Changed paths:
    M openmp/libomptarget/plugins/CMakeLists.txt
    M openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
    M openmp/libomptarget/plugins/cuda/CMakeLists.txt
    M openmp/libomptarget/plugins/ve/CMakeLists.txt

  Log Message:
  -----------
  [Libomptarget] Build plugins with protected visibility by default

The plugins all define the same interface symbols. This is generally not
a problem when calling the plugin directly from the dynamic library's
handle. However, when calling from within the plugin itself it is
possible for another plugin's symbols to preempt the symbols. This was
observed with the `__tgt_rtl_is_valid_binary` call in the
`__tgt_rtl_is_valid_binary_info` function being mapped to the x86_64
plugin.

This patch changes the default visibility to `protected` intead. This
visibility ensures that these symbols are all externally visible from
the plugin, but ensures their definitions are fixed within the shared
library. Having protected visiiblity makes such symbol preemption
impossible.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D136365




More information about the All-commits mailing list