File tree Expand file tree Collapse file tree 5 files changed +7
-25
lines changed Expand file tree Collapse file tree 5 files changed +7
-25
lines changed Original file line number Diff line number Diff line change @@ -150,24 +150,6 @@ struct PluginManager {
150
150
HostPtrToTableMapTy HostPtrToTableMap;
151
151
std::mutex TblMapMtx; // /< For HostPtrToTableMap
152
152
153
- // Work around for plugins that call dlopen on shared libraries that call
154
- // tgt_register_lib during their initialisation. Stash the pointers in a
155
- // vector until the plugins are all initialised and then register them.
156
- bool delayRegisterLib (__tgt_bin_desc *Desc) {
157
- if (RTLsLoaded)
158
- return false ;
159
- DelayedBinDesc.push_back (Desc);
160
- return true ;
161
- }
162
-
163
- void registerDelayedLibraries () {
164
- // Only called by libomptarget constructor
165
- RTLsLoaded = true ;
166
- for (auto *Desc : DelayedBinDesc)
167
- __tgt_register_lib (Desc);
168
- DelayedBinDesc.clear ();
169
- }
170
-
171
153
// / Return the number of usable devices.
172
154
int getNumDevices () { return getExclusiveDevicesAccessor ()->size (); }
173
155
@@ -196,9 +178,6 @@ struct PluginManager {
196
178
void addRequirements (int64_t Flags) { Requirements.addRequirements (Flags); }
197
179
198
180
private:
199
- bool RTLsLoaded = false ;
200
- llvm::SmallVector<__tgt_bin_desc *> DelayedBinDesc;
201
-
202
181
// List of all plugin adaptors, in use or not.
203
182
llvm::SmallVector<std::unique_ptr<PluginAdaptorTy>> PluginAdaptors;
204
183
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ EXTERN void __tgt_register_requires(int64_t Flags) {
46
46
// / adds a target shared library to the target execution image
47
47
EXTERN void __tgt_register_lib (__tgt_bin_desc *Desc) {
48
48
TIMESCOPE ();
49
- if (PM->delayRegisterLib (Desc))
50
- return ;
51
-
52
49
PM->registerLib (Desc);
53
50
}
54
51
Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ __attribute__((constructor(101))) void init() {
51
51
PM->init ();
52
52
53
53
Profiler::get ();
54
- PM->registerDelayedLibraries ();
55
54
}
56
55
57
56
__attribute__ ((destructor(101 ))) void deinit() {
Original file line number Diff line number Diff line change
1
+
Original file line number Diff line number Diff line change
1
+ // RUN: %clang-generic -fPIC -shared %S/../Inputs/empty.c -o %T/liba.so
2
+ // RUN: %clang-generic -fPIC -shared %S/../Inputs/empty.c -o %T/libb.so
3
+ // RUN: %clang-generic -rpath %T -L %T -l a -l b %s -o %t
4
+ // RUN: %t
5
+
6
+ int main () {}
You can’t perform that action at this time.
0 commit comments