Skip to content

Commit 5e36c64

Browse files
committed
[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.
1 parent ddfed81 commit 5e36c64

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

flang/lib/Frontend/FrontendActions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static void addDepdendentLibs(mlir::ModuleOp &mlirModule,
260260
auto builder = mlir::OpBuilder(mlirModule.getRegion());
261261
for (const std::string &lib : libs) {
262262
builder.create<mlir::LLVM::LinkerOptionsOp>(
263-
mlirModule.getLoc(), builder.getStrArrayAttr({"/DEFAULTLIB:", lib}));
263+
mlirModule.getLoc(), builder.getStrArrayAttr({"/DEFAULTLIB:" + lib}));
264264
}
265265
}
266266

flang/test/Driver/dependent-lib.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
! REDEFINE: %{triple} = aarch64-apple-darwin
1111
! RUN: not %{compile} | FileCheck %s --check-prefixes=CHECK-NOWIN
1212

13-
! CHECK: llvm.linker_options ["/DEFAULTLIB:", "libtest"]
13+
! CHECK: llvm.linker_options ["/DEFAULTLIB:libtest"]
1414
program test
1515
end program test
1616
! CHECK-NOWIN: --dependent-lib is only supported on Windows

0 commit comments

Comments
 (0)