Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7835 Discussions

Interprocedural Optimization errors

keith_correa
Beginner
631 Views

Hi!

I'm using the Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2022.1.0 Build 20220316 to compile a C++ application with multiple source files on Windows.

Using ICX.exe from the command line, one of the compiler options that I'm issuing is /Qipo. The source compiles fine and .obj files are created.

I then try to link using XILINK [XILINK: executing 'link' Microsoft (R) Incremental Linker Version 14.29.30145.0] from the command line and I issue the /Qipo option here too. I get errors for all .obj files stating this:

      ipo: warning #11003: no IR in object file XXXXXX.obj; was the source file compiled with -Qipo

      followed by:

      ipo: warning #11010: file format not recognized for XXXXXX.obj

      followed by:

      XXXXXX.obj : fatal error LNK1107: invalid or corrupt file: cannot read at 0x3F58

If I remove the /Qipo option from the XILINK command, I just get this error:

      XXXXXX.obj : fatal error LNK1107: invalid or corrupt file: cannot read at 0x3F58

If I compile without the  /Qipo option, the size of the .obj files reduce and also linking without the  /Qipo option goes through perfectly.

What could be causing this behavior?

0 Kudos
6 Replies
keith_correa
Beginner
592 Views

Is this happening because the Microsoft Linker is being invoked by XILINK and a different linker needs to be invoked instead?

0 Kudos
PriyanshuK_Intel
Moderator
588 Views

Hi,

Thank you for posting on intel Communities.


Could you please provide us with Sample reproducer and steps to reproduce the issue, so that we can investigate more on your issue from our end?


Thanks & Regards

Priyanshu.


0 Kudos
keith_correa
Beginner
573 Views

From the Intel OneAPI Command Prompt for Intel 64 for Visual Studio, compile any application with more than 1 C++ source files from the command line using ICX and in the ICX command specify the  /Qipo switch.

From the Intel OneAPI Command Prompt for Intel 64 for Visual Studio, link the object file using XILINK from the command line and in the XILINK command specify the  /Qipo switch.

Does it link for you?

0 Kudos
keith_correa
Beginner
563 Views

OK, I think I now know something that I didn't know before:

If the compilation and linking is done in the same command via ICX, then the Clang linker is invoked and the linking goes through fine.

If the linking is done via XILINK, then it invokes the Microsoft linker unless you explicitly tell XILINK to use the Clang linker via the -qlink-name switch. If you do this, the linking goes through fine.

0 Kudos
keith_correa
Beginner
528 Views

Based on what I found mentioned in the post above, my problem is resolved. Please close this. Thanks!

0 Kudos
PriyanshuK_Intel
Moderator
507 Views

Hi,

 

Glad to know that your issue is resolved.

As the issue is resolved we are closing this thread.

If you need any additional information, please post a new question.

 

Thanks,

Priyanshu.

 

0 Kudos
Reply