diff --git a/lld/lib/ReaderWriter/PECOFF/WriterImportLibrary.cpp b/lld/lib/ReaderWriter/PECOFF/WriterImportLibrary.cpp index adb6e0afe75d..603f154bc992 100644 --- a/lld/lib/ReaderWriter/PECOFF/WriterImportLibrary.cpp +++ b/lld/lib/ReaderWriter/PECOFF/WriterImportLibrary.cpp @@ -80,7 +80,7 @@ void writeImportLibrary(const PECOFFLinkingContext &ctx) { std::vector args; args.push_back(programPath.c_str()); args.push_back("/nologo"); - args.push_back("/machine:x86"); + args.push_back(ctx.is64Bit() ? "/machine:x64" : "/machine:x86"); args.push_back(defArg.c_str()); args.push_back(outputArg.c_str()); args.push_back(nullptr);