From 96bd8631edfebdcc7cd571bb9e57d6f3511c8eb3 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 15 Mar 2024 04:19:32 +0000 Subject: [PATCH] Fix OpenMP patch --- ...mp-implicit-rpath-disabled-by-default.patch | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch b/0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch index 3269365..f8448c1 100644 --- a/0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch +++ b/0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch @@ -33,26 +33,10 @@ diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolC index faceee85a2f8..c058df97160b 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -1124,6 +1124,39 @@ static void addOpenMPDeviceLibC(const ToolChain &TC, const ArgList &Args, +@@ -1124,6 +1124,23 @@ static void addOpenMPDeviceLibC(const ToolChain &TC, const ArgList &Args, llvm::append_range(CmdArgs, Libraries); } -+void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, -+ const ArgList &Args, -+ ArgStringList &CmdArgs) { -+ -+ if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath, -+ options::OPT_fno_openmp_implicit_rpath, false)) { -+ // Default to clang lib / lib64 folder, i.e. the same location as device -+ // runtime -+ SmallString<256> DefaultLibPath = -+ llvm::sys::path::parent_path(TC.getDriver().Dir); -+ llvm::sys::path::append(DefaultLibPath, CLANG_INSTALL_LIBDIR_BASENAME); -+ CmdArgs.push_back("-rpath"); -+ CmdArgs.push_back(Args.MakeArgString(DefaultLibPath)); -+ } -+} -+ + +void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, + const ArgList &Args,