Hello, everyone,
Found, that ICC handles PDB files in somewhat different way than MSVC do, which could lead to errors during build. E.g. for OpenSSL builds using ICC on Windows got:
1. improper PDB files naming:
[run 'Compiler 17.0 Update 2 for Intel 64 Visual Studio 2015 environment' command && change into OpenSSL sources directory] c:\libOPENSSL-1.1.1-dev\build>set CC=icl c:\libOPENSSL-1.1.1-dev\build>perl Configure threads no-deprecated shared no-asm VC-WIN64A && nmake [snip]"C:\ProgramData\Perl64\bin\perl.exe""-I." -Mconfigdata "util\dofile.pl""-omakefile""crypto\include\internal\bn_conf.h.in"> crypto\include\internal\bn_conf.h"C:\ProgramData\Perl64\bin\perl.exe""-I." -Mconfigdata "util\dofile.pl""-omakefile""crypto\include\internal\dso_conf.h.in"> crypto\include\internal\dso_conf.h"C:\ProgramData\Perl64\bin\perl.exe""-I." -Mconfigdata "util\dofile.pl""-omakefile""include\openssl\opensslconf.h.in"> include\openssl\opensslconf.h icl /I "." /I "crypto\include" /I "include" -DOPENSSL_USE_APPLINK -DDSO_WIN32 -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_API_COMPAT=0x10100000L "-DENGINESDIR=\"C:\\Program Files\\OpenSSL\\lib\\engines-1_1\"""-DOPENSSLDIR=\"C:\\Program Files\\Common Files\\SSL\"" -W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -DUNICODE -D_UNICODE /MD /O2 /Zi /Fdossl_static -c /Focrypto\aes\aes_cbc.obj "crypto\aes\aes_cbc.c" aes_cbc.c error #31000: corrupt PDB file ossl_static\vc140.pdb; delete and rebuild; if problem persists, delete and try /Z7 instead error code 3 ( can't write file, out of disk, etc.) opening pdb ossl_static\vc140.pdb compilation aborted for crypto\aes\aes_cbc.c (code 1) NMAKE : fatal error U1077: '"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin\intel64\icl.EXE"' : return code '0x1' Stop.
which relate to compiler keys
'/Fdossl_static', '/Fddso' and '/Fdapp'
in file 'Configurations/10-main.conf' from OpenSSL sources folder.
And if they are changed to
'/Fdossl_static.pdb', '/Fddso.pdb' and '/Fdapp.pdb'
before build, PDB files are created with proper names
'ossl_static.pdb', 'dso.pdb' and 'app.pdb',
and all 'nmake' tasks finishes successfully.
Error not reproduces for builds using MSVC. E.g. ICC, unlike MSVC, require explicitly specify '.pdb' extension of PDB files in '/Fd' keys. Otherwise ICC set PDB file names to '...\vc140.pdb'.
2. improper PDB files handling for parallel builds:
[extract 'jom' and 'nasm' executables to OpenSSL directory && run 'Compiler 17.0 Update 2 for Intel 64 Visual Studio 2015 environment' command && change into OpenSSL sources directory] c:\libOPENSSL-1.1.1-dev\build>set CC=icl c:\libOPENSSL-1.1.1-dev\build>perl Configure -QxAVX -fp:strict -Qprec -Zc:wchar_t -nologo -Qstd=c11 -O3 -MD threads no-deprecated shared VC-WIN64A && jom /J4 [snip] icl /I "include" -DOPENSSL_USE_APPLINK -DDSO_WIN32 -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_API_COMPAT=0x10100000L "-DENGINESDIR=\"C:\\Program Files\\OpenSSL\\lib\\engines-1_1\"""-DOPENSSLDIR=\"C:\\Program Files\\Common Files\\SSL\"" -W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -DUNICODE -D_UNICODE /MD /O2 -QxAVX -fp:strict -Qprec -Zc:wchar_t -nologo -Qstd=c11 -O3 -MD /Zi /Fdapp.pdb -c /Fotest\buildtest_x509v3.obj "test\buildtest_x509v3.c" icl: command line warning #10120: overriding '/O2' with '/O3' buildtest_x509v3.c IF EXIST test\shlibloadtest.exe.manifest DEL /F /Q test\shlibloadtest.exe.manifest error #31000: corrupt PDB file app.pdb; delete and rebuild; if problem persists, delete and try /Z7 instead error code 3 ( can't write file, out of disk, etc.) opening pdb app.pdb compilation aborted for test\buildtest_x509.c (code 1) jom: C:\libOPENSSL-1.1.1-dev\build\Makefile [test\buildtest_x509.obj] Error 1 link /nologo /debug /subsystem:console /opt:ref /out:test\shlibloadtest.exe @C:\Users\test\AppData\Local\Temp\shlibloadtest.exe.5752.221687.jom IF EXIST test\shlibloadtest.exe.manifest mt -nologo -manifest test\shlibloadtest.exe.manifest -outputresource:test\shlibloadtest.exe jom: C:\libOPENSSL-1.1.1-dev\build\Makefile [all] Error 2
Error reproduced for Release+Shared configuration if jobs number > 3 (other configurations require more; need be verified). Running 'nmake' or 'jom /J1' command from that point continue build and successfully finishes all tasks.
ICC has no appropriate compiler key for PDB files handling during parallel builds (similar to '/FS' for MSVC). Then assumed, that ICC dealing with this "things" by itself. In such case it turns out, that ICC has limitation on parallel jobs number for single PDB file processing, which MSVC hasn't.
Since ICC on Windows imitates MSVC, is it possible to make its behavior regarding PDB files identical to MSVC for both cases above?
Environment:
- Windows 10 x64,
- IPSXE 2017 Update 2,
- VS 2015 Update 3,
- Windows SDK 10.0.14393.33,
- Active Perl 5.24.1,
- nasm 2.13rc20,
- jom 1.1.2,
- OpenSSL 1.1.1-dev (f919c12f5c8b92f0318c650573e774fe6522c27c).
Alexander