[flang] Remove extra space added with --dependent-lib option

This patch fixes a bug with the --dependent-lib option where an
extra space is added to the directive causing linking to fail.
This commit is contained in:
David Truby
2023-11-20 16:50:03 +00:00
parent ddfed815c9
commit 5e36c64cb6
2 changed files with 2 additions and 2 deletions

View File

@@ -260,7 +260,7 @@ static void addDepdendentLibs(mlir::ModuleOp &mlirModule,
auto builder = mlir::OpBuilder(mlirModule.getRegion());
for (const std::string &lib : libs) {
builder.create<mlir::LLVM::LinkerOptionsOp>(
mlirModule.getLoc(), builder.getStrArrayAttr({"/DEFAULTLIB:", lib}));
mlirModule.getLoc(), builder.getStrArrayAttr({"/DEFAULTLIB:" + lib}));
}
}

View File

@@ -10,7 +10,7 @@
! REDEFINE: %{triple} = aarch64-apple-darwin
! RUN: not %{compile} | FileCheck %s --check-prefixes=CHECK-NOWIN
! CHECK: llvm.linker_options ["/DEFAULTLIB:", "libtest"]
! CHECK: llvm.linker_options ["/DEFAULTLIB:libtest"]
program test
end program test
! CHECK-NOWIN: --dependent-lib is only supported on Windows