Welcome to Intel® Software Network Quick Login | Join | Help |
Search in Intel® Software Network Forums
in Go

/Zl switch does not work

Last post 06-20-2008, 4:57 PM by Brandon H.. 8 replies.
Sort Posts: Previous Next
 05-22-2008, 6:42 AM 30255315  

/Zl switch does not work

I compile a project with /Zl switch added to the command line and in the resulting obj/lib files I still get strings:

-defaultlib:"uuid.lib" -defaultlib:"uuid.lib" -defaultlib:"libirc"

That's right, uuid.lib is listed twice for each object file as if once wouldn't be enough.

Why is the /Zl switch interpreted half-way only? When I say "ignore default libraries" I mean all of them!


Regards,
Igor Levicki
http://www.levicki.net/
 
 05-28-2008, 1:23 PM 30255681 in reply to 30255315  

Re: /Zl switch does not work

VC2005 cl.exe has the same behavior. You can use /nodefaultlib at link that will ignore all the default libs include uuid.lib/libirc.
JenniferL
 
 05-28-2008, 3:42 PM 30255690 in reply to 30255681  

Re: /Zl switch does not work

Jennifer, I am sorry but MSVC 2005 cl.exe doing the same is a poor excuse unless you meant to say that it is a compatibility hack.

I am still curious why does the compiler emit uuid.lib twice? Isn't once enough?

I have seen duplicate library names emitted into object files several times with ICC, sometimes just one name, sometimes all library names are repeated. Fixing it (if it is an error on compiler side) could perhaps improve compile and link speed a bit for those extra large projects with thousands of files.


Regards,
Igor Levicki
http://www.levicki.net/
 
 05-28-2008, 5:14 PM 30255699 in reply to 30255690  

Re: /Zl switch does not work

ICL has to match CL on this in order to do mix-match linking.

After talking with experts on this, the uuid.lib is not inserted by the compiler. It's likely in the VC header files twice like "#pragma comment(lib:uuid.lib)". so it's in .obj twice.  As my testcase, it has "#include <windows.h>". It brings the uuid.lib twices in the .obj file.


JenniferL
 
 05-28-2008, 8:36 PM 30255704 in reply to 30255699  

Re: /Zl switch does not work

Ok, we are getting somewhere.

Could you please ask the experts why the compiler does not coalesce multiple pragmas which reference the same library file?

I have tested it and Microsoft compiler does the same but I want to know why. Is it a bug which somehow got "copied" to Intel compiler or is it really neccessary to have duplicate references in order for the linker to work?


Regards,
Igor Levicki
http://www.levicki.net/
 
 06-12-2008, 10:17 AM 30256821 in reply to 30255704  

Re: /Zl switch does not work

Any update on this?


Regards,
Igor Levicki
http://www.levicki.net/
 
 06-20-2008, 10:00 AM 30257385 in reply to 30256821  

Re: /Zl switch does not work

Hi Igor,

It's not necessary to have the duplicates, and certainly our front end could implement a logic to coalesce these #pragma comment statements, but is there any problem with having the multiple -defaultlib references?


Brandon H.
Intel Developer Support

For product support information: http://support.intel.com/support/performancetools/sb/CS-020958.htm
 
 06-20-2008, 3:46 PM 30257400 in reply to 30257385  

Re: /Zl switch does not work

Not a real problem as such but:

  • It looks sloppy for a product labeled as "Professional"
  • It is unneccessary waste of disk space
  • Coalescing may improve build times for large projects

I would certainly like to see it fixed even though it is a minor issue.


Regards,
Igor Levicki
http://www.levicki.net/
 
 06-20-2008, 4:57 PM 30257402 in reply to 30257400  

Re: /Zl switch does not work

I would submit a Premier Support issue then, but I would not expect this to be addressed quickly.  It's hard to find a case where the disk space issue would be compelling enough to be a concern, and I would suspect that the fix itself might actually hinder build times if anything, due to the fact that the front end would now have to keep track of which #pragma comment libs were processed, and then do a compare each time it processes a new #pragma comment.  Again, though, that wouldn't be significant in most if not all cases.  I agree that it does look sloppy.
Brandon H.
Intel Developer Support

For product support information: http://support.intel.com/support/performancetools/sb/CS-020958.htm
 
View as RSS news feed in XML

Shortcuts


Tags For This Post

...

Community Tags

...