Osman Zakir via llvm-dev
2019-Nov-10 15:58 UTC
[llvm-dev] lld-link.exe Can't Recognize .obj File Type?
Hi. Just now when I tried to compile a .cpp file using the LLVM toolset in VS2019, I got two error messages from lld-link: " lld-link : error : Debug\cust_std_lib_facilities.obj: unknown file type lld-link : error : Debug\Ex10_10.obj: unknown file type " What's the reason for this, and is there a way to fix it? This is the first time I'm saying this error; I've used LLVM before and this error never came up when I know .obj files should've been used then as well. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191110/89d9f170/attachment.html>
Eli Friedman via llvm-dev
2019-Nov-11 19:35 UTC
[llvm-dev] lld-link.exe Can't Recognize .obj File Type?
lld doesn't care about the file extension; it examines the first few bytes of the file to figure out the filetype. That error message means that examination failed: the header doesn't correspond to any of the input filetypes lld-link supports. The Unix "file" utility is generally useful for figuring out what sort of file you're working with. (On Windows, you can get it through Cygwin or gnuwin32.) -Eli From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Osman Zakir via llvm-dev Sent: Sunday, November 10, 2019 7:58 AM To: llvm-dev at lists.llvm.org Subject: [EXT] [llvm-dev] lld-link.exe Can't Recognize .obj File Type? Hi. Just now when I tried to compile a .cpp file using the LLVM toolset in VS2019, I got two error messages from lld-link: " lld-link : error : Debug\cust_std_lib_facilities.obj: unknown file type lld-link : error : Debug\Ex10_10.obj: unknown file type " What's the reason for this, and is there a way to fix it? This is the first time I'm saying this error; I've used LLVM before and this error never came up when I know .obj files should've been used then as well. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191111/d4cff9aa/attachment.html>
Zachary Turner via llvm-dev
2019-Nov-12 00:54 UTC
[llvm-dev] lld-link.exe Can't Recognize .obj File Type?
I'm guessing you have enabled LTCG. In this case the file extension will be .obj, but it's actually not a COFF object file, and only Microsoft understands the format of this file. Make sure LTCG is off and that when you run dumpbin on the obj file you get some reasonable information from it. On Mon, Nov 11, 2019 at 11:36 AM Eli Friedman via llvm-dev < llvm-dev at lists.llvm.org> wrote:> lld doesn’t care about the file extension; it examines the first few bytes > of the file to figure out the filetype. That error message means that > examination failed: the header doesn’t correspond to any of the input > filetypes lld-link supports. > > > > The Unix “file” utility is generally useful for figuring out what sort of > file you’re working with. (On Windows, you can get it through Cygwin or > gnuwin32.) > > > > -Eli > > > > *From:* llvm-dev <llvm-dev-bounces at lists.llvm.org> *On Behalf Of *Osman > Zakir via llvm-dev > *Sent:* Sunday, November 10, 2019 7:58 AM > *To:* llvm-dev at lists.llvm.org > *Subject:* [EXT] [llvm-dev] lld-link.exe Can't Recognize .obj File Type? > > > > Hi. > > > > Just now when I tried to compile a .cpp file using the LLVM toolset in > VS2019, I got two error messages from lld-link: > > " > > lld-link : error : Debug\cust_std_lib_facilities.obj: unknown file type > > lld-link : error : Debug\Ex10_10.obj: unknown file type > > " > > What's the reason for this, and is there a way to fix it? This is the > first time I'm saying this error; I've used LLVM before and this error > never came up when I know .obj files should've been used then as well. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191111/2d19a40e/attachment.html>
Possibly Parallel Threads
- Building For x64 Windows using LLVM
- Recent LLVM Build Attempt -- obj.ClangAST.vcxproj Failed to Build
- Recent LLVM Build Attempt -- obj.ClangAST.vcxproj Failed to Build
- Longstanding failing tests - clang-tidy, MachO, Polly
- Have LLD and Clang in their correct locations, but still can't generate project files for LLVM