From 2a9a13d9cc5fceeb2cdb293dffeca0bc326c479f Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 20 Oct 2022 10:38:27 -0500 Subject: [PATCH] [OpenMP] Remove `-Bsymbolic` flag for device linking in the GNU toolchain Previously, OpenMP linking would be done explicitly in a linker stage. For `x86_64` offloading this would just use the host linker, which could be the `bfd` linker. This linker had problems linking relocations against variables with protected visibility so we force `-Bsymbolic` when linking. After the deprecation of the old offloading driver this code is no longer used and can be removed. Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D136363 --- clang/lib/Driver/ToolChains/Gnu.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp index 9d3490f..f717ca3 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp @@ -586,13 +586,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-lm"); } - // If we are linking for the device all symbols should be bound locally. The - // symbols are already protected which makes this redundant. This is only - // necessary to work around a problem in bfd. - // TODO: Remove this once 'lld' becomes the only linker for offloading. - if (JA.isDeviceOffloading(Action::OFK_OpenMP)) - CmdArgs.push_back("-Bsymbolic"); - // Silence warnings when linking C code with a C++ '-stdlib' argument. Args.ClaimAllArgs(options::OPT_stdlib_EQ); -- 2.7.4