php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81337 "fatal error C1900: Il mismatch between 'P1' version '202110113' and 'P2 versio
Submitted: 2021-08-06 11:27 UTC Modified: 2021-08-06 15:23 UTC
From: mike_itguy at yahoo dot co dot uk Assigned: cmb (profile)
Status: Not a bug Package: Compile Failure
PHP Version: 8.0.9 OS: Win10-pro_20H2
Private report: No CVE-ID: None
 [2021-08-06 11:27 UTC] mike_itguy at yahoo dot co dot uk
Description:
------------
I try to build the ibm_db2 pecl extension v2.1.3 with PHP 8.0.9 on Windows10-x64 with Visual-Studio-2019 Community Edition.

But the build of php itself fails before reaching the ibm_db2.c compilation.

I follow the steps at this page:
https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

I show the steps I took, in separate section below.

nmake fails with a linker error:

"fatal error C1900: Il mismatch between 'P1' version '202110113' and 'P2 version '20190715'


The nmake log file has this at the end:

    rc /nologo /fo D:\php-sdk\phpdev\vs16\x64\phpdev\vs16\x64\phpdev\vs16\x64\php-src-php-8.0.9\x64\Release_TS\php8ts.dll.res /d FILE_DESCRIPTION="\"PHP Script Interpreter\""  /d FILE_NAME="\"php8ts.dll\"" /d PRODUCT_NAME="\"PHP Script Interpreter\""  /ID:\php-sdk\phpdev\vs16\x64\phpdev\vs16\x64\phpdev\vs16\x64\php-src-php-8.0.9\x64\Release_TS /d MC_INCLUDE="\"D:\php-sdk\phpdev\vs16\x64\phpdev\vs16\x64\phpdev\vs16\x64\php-src-php-8.0.9\x64\Release_TS\wsyslog.rc\""  win32\build\template.rc
libiconv_a.lib(iconv1.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
fatal error C1900: Il mismatch between 'P1' version '20210113' and 'P2' version '20190715'
LINK : fatal error LNK1257: code generation failed
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\link.exe"' : return code '0x4e9' 
Stop.



Test script:
---------------
d:
mkdir d:\tmp


rd /s /q d:\php-sdk
git clone https://github.com/Microsoft/php-sdk-binary-tools.git d:\php-sdk
cd /d d:\php-sdk
git checkout php-sdk-2.2.0
phpsdk-vs16-x64.bat    
phpsdk_buildtree phpdev  
unzip -q %userprofile%\downloads\php-src-php-8.0.9.zip
mkdir pecl
copy %userprofile%\downloads\pecl-database-ibm_db2-RELEASE_2_1_3.tar.gz .\pecl
cd pecl
gzip -d *
tar -xf *.tar
edit the config.w32 to replace db2cli.lib by db2cli64.lib for clidriver
edit the ibm_db2.c to replace " ulong " by " unsigned long " on 3 lines (bugfix)
cd ..\php-src-php-8.0.9
phpsdk_deps -u

--verify %LIB% includes e:\db2\lib
--verify %INCLUDE% includes e:db2\include
--verify PATH includes e:\db2\bin

buildconf
configure --help | find /i "ibm" 
configure --enable-cli --with-ibm_db2=shared,e:\db2 1>\tmp\configure.log 2>&1

 nmake 1>\tmp\nmake1.log 2>&1


Expected result:
----------------
Was expecting a successful build for v8.0.9 (the build of 7.4.22 on a different hostname was successful).

Actual result:
--------------
libiconv_a.lib(iconv1.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
fatal error C1900: Il mismatch between 'P1' version '20210113' and 'P2' version '20190715'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-06 11:32 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-08-06 11:32 UTC] cmb@php.net
What's the exact version of your VS 2019 (should be something like
16.10.3)?
 [2021-08-06 11:43 UTC] mike_itguy at Yahoo dot co dot uk
Visual Studio 2019 community edition, version 16.7.2
in the phpsdk starter script the msvc version reported ist 14.27.29111
 [2021-08-06 11:55 UTC] cmb@php.net
> Visual Studio 2019 community edition, version 16.7.2

You need to update to latest (16.10.4), or rebuild some dependecy
libraries.  I suggest you do the former.  If there are C1047 errors
during build, you can work around by

    set LDFLAGS=/d2:-AllowCompatibleILVersions

and running buildconf etc. again.

Also note that replacing `ulong` with `unsigned long` is not wrong,
but the improved solution of the PR[1] is preferable.

[1] <https://github.com/php/pecl-database-ibm_db2/pull/13>
 [2021-08-06 11:58 UTC] mike_itguy at yahoo dot co dot uk
thank you. I will update the VisualStudio2019 to 16.10.4 current and retry.
 [2021-08-06 13:50 UTC] mike_itguy at yahoo dot com
Updated the VS2019 to 16.10.4, and started the build from scratch.
I did not change the LDFLAGS.
This time the build completed without errors.
Many thanks.
 [2021-08-06 15:23 UTC] cmb@php.net
-Status: Feedback +Status: Not a bug
 [2021-08-06 15:23 UTC] cmb@php.net
Great!  I just added a respective note to the Wiki page.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 15:01:29 2024 UTC