From b75e7c61ffc4adea0ec5fca63ba3feba845c8303 Mon Sep 17 00:00:00 2001 From: Jan Leyonberg Date: Mon, 17 Jun 2024 09:31:15 -0400 Subject: [flang] Add -mlink-builtin-bitcode option to fc1 (#94763) This patch enables the -mlink-builtin-bitcode flag in fc1 so that bitcode libraries can be linked in. This is needed for OpenMP offloading libraries. --- flang/lib/Frontend/CompilerInvocation.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index f64a939..f96d72f 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -347,6 +347,11 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, if (auto *a = args.getLastArg(clang::driver::options::OPT_save_temps_EQ)) opts.SaveTempsDir = a->getValue(); + // -mlink-builtin-bitcode + for (auto *a : + args.filtered(clang::driver::options::OPT_mlink_builtin_bitcode)) + opts.BuiltinBCLibs.push_back(a->getValue()); + // -mrelocation-model option. if (const llvm::opt::Arg *a = args.getLastArg(clang::driver::options::OPT_mrelocation_model)) { -- cgit v1.1