[Openmp-commits] [PATCH] D117231: [Libomptarget] Fix multiply defined symbol during linking

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jan 13 08:57:53 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4746e38f67a9: [Libomptarget] Fix multiply defined symbol during linking (authored by jhuber6).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117231/new/

https://reviews.llvm.org/D117231

Files:
  openmp/libomptarget/DeviceRTL/src/Configuration.cpp
  openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h


Index: openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
===================================================================
--- openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
+++ openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
@@ -32,6 +32,7 @@
 #define ALIGN(N) __attribute__((aligned(N)))
 #define PLUGIN_ACCESSIBLE                                                      \
   __attribute__((used))   /* Don't discard values the plugin reads */          \
+  __attribute__((weak))   /* We may have multiple definitions */               \
   __attribute__((retain)) /* Also needed to keep values alive */               \
   __attribute__((visibility("default"))) /* Access via SHT_HASH */             \
   __attribute__((section(".data")))      /* Not .bss, can write before load */
Index: openmp/libomptarget/DeviceRTL/src/Configuration.cpp
===================================================================
--- openmp/libomptarget/DeviceRTL/src/Configuration.cpp
+++ openmp/libomptarget/DeviceRTL/src/Configuration.cpp
@@ -24,7 +24,7 @@
 
 // TODO: We want to change the name as soon as the old runtime is gone.
 DeviceEnvironmentTy CONSTANT(omptarget_device_environment)
-    __attribute__((used, retain));
+    __attribute__((used, retain, weak));
 
 uint32_t config::getDebugKind() {
   return __omp_rtl_debug_kind & omptarget_device_environment.DebugKind;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117231.399691.patch
Type: text/x-patch
Size: 1385 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220113/30132513/attachment.bin>


More information about the Openmp-commits mailing list