[OpenMP] Add -Bsymbolic to arguments for GNU linker
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 4 Feb 2022 17:51:10 +0000 (12:51 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 4 Feb 2022 20:13:32 +0000 (15:13 -0500)
commiteeb29c8477d96ad821b3283dad8ed060a3426118
tree77cdef59493eded379812848213cbb3046104dd2
parentb8ec430de71766d9a35a6b737c8a789c0c7cf812
[OpenMP] Add -Bsymbolic to arguments for GNU linker

This patch adds the '-Bsymbolic' flag when we perform linking for the
offloading device. We already pass '-fvisibility=protected' but this is
not properly handled when using the bfd linker as is described in
https://maskray.me/blog/2021-05-16-elf-interposition-and-bsymbolic.
Previously this caused linker errors when creating the shared library.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D119018
clang/lib/Driver/ToolChains/Gnu.cpp