@@ -3177,12 +3177,16 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
3177
3177
}
3178
3178
}
3179
3179
3180
- static bool runBundler (const SmallVectorImpl<StringRef> &BundlerArgs ,
3180
+ static bool runBundler (const SmallVectorImpl<StringRef> &InputArgs ,
3181
3181
Compilation &C) {
3182
3182
// Find bundler.
3183
3183
StringRef ExecPath (C.getArgs ().MakeArgString (C.getDriver ().Dir ));
3184
3184
llvm::ErrorOr<std::string> BundlerBinary =
3185
3185
llvm::sys::findProgramByName (" clang-offload-bundler" , ExecPath);
3186
+ SmallVector<StringRef, 6 > BundlerArgs;
3187
+ BundlerArgs.push_back (BundlerBinary.getError () ? " clang-offload-bundler"
3188
+ : BundlerBinary.get ().c_str ());
3189
+ BundlerArgs.append (InputArgs);
3186
3190
// Since this is run in real time and not in the toolchain, output the
3187
3191
// command line if requested.
3188
3192
bool OutputOnly = C.getArgs ().hasArg (options::OPT__HASH_HASH_HASH);
@@ -3223,8 +3227,8 @@ static bool hasFPGABinary(Compilation &C, std::string Object, types::ID Type) {
3223
3227
const char *Inputs = C.getArgs ().MakeArgString (Twine (" -input=" ) + Object);
3224
3228
// Always use -type=ao for aocx/aocr bundle checking. The 'bundles' are
3225
3229
// actually archives.
3226
- SmallVector<StringRef, 6 > BundlerArgs = {" clang-offload-bundler " , " - type=ao" ,
3227
- Targets, Inputs, " -check-section" };
3230
+ SmallVector<StringRef, 6 > BundlerArgs = {" - type=ao" , Targets, Inputs ,
3231
+ " -check-section" };
3228
3232
return runBundler (BundlerArgs, C);
3229
3233
}
3230
3234
@@ -3309,8 +3313,7 @@ static bool hasSYCLDefaultSection(Compilation &C, const StringRef &File) {
3309
3313
const char *Targets =
3310
3314
C.getArgs ().MakeArgString (Twine (" -targets=sycl-" ) + TT.str ());
3311
3315
const char *Inputs = C.getArgs ().MakeArgString (Twine (" -input=" ) + File.str ());
3312
- SmallVector<StringRef, 6 > BundlerArgs = {" clang-offload-bundler" ,
3313
- IsArchive ? " -type=ao" : " -type=o" ,
3316
+ SmallVector<StringRef, 6 > BundlerArgs = {IsArchive ? " -type=ao" : " -type=o" ,
3314
3317
Targets, Inputs, " -check-section" };
3315
3318
return runBundler (BundlerArgs, C);
3316
3319
}
@@ -3332,8 +3335,7 @@ static bool hasOffloadSections(Compilation &C, const StringRef &File,
3332
3335
// of the generic host availability.
3333
3336
const char *Targets = Args.MakeArgString (Twine (" -targets=host-" ) + TT.str ());
3334
3337
const char *Inputs = Args.MakeArgString (Twine (" -input=" ) + File.str ());
3335
- SmallVector<StringRef, 6 > BundlerArgs = {" clang-offload-bundler" ,
3336
- IsArchive ? " -type=ao" : " -type=o" ,
3338
+ SmallVector<StringRef, 6 > BundlerArgs = {IsArchive ? " -type=ao" : " -type=o" ,
3337
3339
Targets, Inputs, " -check-section" };
3338
3340
return runBundler (BundlerArgs, C);
3339
3341
}
0 commit comments