Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS16 libiconv_a.lib P1 P2 mismatch with php8 #10

Closed
fuyutsuki opened this issue Jan 3, 2021 · 10 comments
Closed

VS16 libiconv_a.lib P1 P2 mismatch with php8 #10

fuyutsuki opened this issue Jan 3, 2021 · 10 comments

Comments

@fuyutsuki
Copy link

@cmb69 I tried the v142 14.20~14.28 build tools referring to #9, but all of them output the same error below.

libiconv_a.lib(iconv1.obj) : MSIL .netmodule または /GL を伴ってコンパイルされたモジュールが見つかりました。/LTCG を使用して再開始してください。リンカーのパフォーマンスを向上させるためには、コマンドラインに /LTCG を追加してください。
fatal error C1900: 'P1' Version '20200803''P2' Version '20190715' が一致しません。
LINK : fatal error LNK1257: コードの生成に失敗しました。
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64\link.exe"' : リターン コード '0x4e9'
Stop.
@cmb69
Copy link
Contributor

cmb69 commented Jan 3, 2021

It seems you are building with unsuitable dependencies. For the v142 build toolset, you need the vs16 dependencies from https://windows.php.net/downloads/php-sdk/deps/vs16/

@fuyutsuki
Copy link
Author

Yes, I installing dependencies for vs16 using phpsdk_deps -u -t vs16 -b master -a x64 -f.

@fuyutsuki
Copy link
Author

I rebuilt libiconv and sqlite3 using VS2019(14.28), but I get the following error.

$ nmake

Microsoft(R) Program Maintenance Utility Version 14.28.29335.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Recreating build dirs
php8ts.dll.def : error LNK2001: 外部シンボル _libiconv_version は未解決です
php8ts.dll.def : error LNK2001: 外部シンボル libiconv は未解決です
php8ts.dll.def : error LNK2001: 外部シンボル libiconv_close は未解決です
php8ts.dll.def : error LNK2001: 外部シンボル libiconv_open は未解決です
php8ts.dll.def : error LNK2001: 外部シンボル libiconv_set_relocation_prefix は未解決です
C:\pocketmine-php-sdk\php-src\x64\Release_TS\php8ts.lib : fatal error LNK1120: 5 件の未解決の外部参照
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\link.exe"' : リターン コード '0x460'
Stop.

@cmb69
Copy link
Contributor

cmb69 commented Jan 5, 2021

Are you doing PGO builds?

@fuyutsuki
Copy link
Author

No, according to the logs, PGO seems to be disabled.

Enabled extensions:
----------------------------------
| Extension             | Mode   |
----------------------------------
| bcmath                | static |
| bz2                   | shared |
| calendar              | static |
| com_dotnet            | static |
| crypto                | shared |
| ctype                 | static |
| curl                  | static |
| date                  | static |
| dom                   | static |
| ds                    | shared |
| filter                | static |
| gd                    | shared |
| gmp                   | static |
| hash                  | static |
| iconv                 | static |
| igbinary              | shared |
| json                  | static |
| leveldb               | shared |
| libxml                | static |
| mbstring              | static |
| mysqli                | shared |
| mysqlnd               | static |
| openssl               | shared |
| pcre                  | static |
| pdo                   | static |
| pdo_mysql             | static |
| pdo_sqlite            | static |
| phar                  | static |
| pocketmine_chunkutils | shared |
| pthreads              | shared |
| recursionguard        | shared |
| reflection            | static |
| simplexml             | static |
| sockets               | static |
| sodium                | static |
| spl                   | static |
| sqlite3               | shared |
| standard              | static |
| tokenizer             | static |
| xml                   | static |
| xmlreader             | static |
| xmlwriter             | static |
| yaml                  | static |
| zip                   | static |
| zlib                  | static |
----------------------------------


Enabled SAPI:
-------------
| Sapi Name |
-------------
| cli       |
-------------


---------------------------------------
|                   |                 |
---------------------------------------
| Build type        | Release         |
| Thread Safety     | Yes             |
| Compiler          | Visual C++ 2019 |
| Architecture      | x64             |
| Optimization      | PGO disabled    |
| Native intrinsics | SSE2            |
| Static analyzer   | disabled        |
---------------------------------------


Type 'nmake' to build PHP

@cmb69
Copy link
Contributor

cmb69 commented Jan 5, 2021

Okay. But I still don't understand why you get

fatal error C1900: 'P1' Version '20200803' と 'P2' Version '20190715' が一致しません。

link.exe is usually not picky regarding old libs (unless PGO instrumentation is requested). Or did you attempt that with an older VS version (i.e. < 14.28)?

Did you fully clean the build (nmake clean). Maybe there is an issue with the non-bundled extension? Did you try building without those first?

@fuyutsuki
Copy link
Author

fuyutsuki commented Jan 5, 2021

link.exe is usually not picky regarding old libs (unless PGO instrumentation is requested). Or did you attempt that with an older VS version (i.e. < 14.28)?

Yes, I was trying to build 14.20~14.28, it might have been 14.25.28610 at this time.
Now I using 14.28.

Did you fully clean the build (nmake clean). Maybe there is an issue with the non-bundled extension? Did you try building without those first?

I did a nmake clean and rebuilt, but the result was the same.
By excluding the problematic --with-iconv and its dependency --with-libxml from configure, the build was successful, but jit cannot be used because of its dependency on iconv.

@cmb69
Copy link
Contributor

cmb69 commented Jan 5, 2021

Ah, yes, building with the latest libiconv and 14.27 may indeed not work. I'm facing the opposite issue: I often need to rebuilt libiconv (and a few others dependencies) to satify link.exe regarding PGO instrumentation after updating VS. However, building with the latest libiconv should work with 14.28 (at least VS 16.8.1 or later).

If you don't want to update to the latest VS, or it still doesn't work, download https://windows.php.net/downloads/php-sdk/deps/archives/vs16/x64/libiconv-1.16-2-vs16-x64.zip and unzip it to the dependencies folder (it has been build with 14.24).

@fuyutsuki
Copy link
Author

fuyutsuki commented Jan 5, 2021

I tried to build the latest version of libiconv v1.16-3 in 14.27 with php-sdk_deps, but I got the same error.

php8ts.dll.def : error LNK2001: 外部シンボル _libiconv_version は未解決です
php8ts.dll.def : error LNK2001: 外部シンボル libiconv は未解決です
php8ts.dll.def : error LNK2001: 外部シンボル libiconv_close は未解決です
php8ts.dll.def : error LNK2001: 外部シンボル libiconv_open は未解決です
php8ts.dll.def : error LNK2001: 外部シンボル libiconv_set_relocation_prefix は未解決です
C:\pocketmine-php-sdk\php-src\x64\Release_TS\php8ts.lib : fatal error LNK1120: 5 件の未解決の外部参照
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\link.exe"' : リターン コード '0x460'
Stop.

Also tried to build using the v1.16-2 that you provided in 14.24, but I got the same error with fatal error C1900.

fatal error C1900: 'P1' Version '20200803''P2' Version '20190715' が一致しません。
LINK : fatal error LNK1257: コードの生成に失敗しました。
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX64\x64\link.exe"' : リターン コード '0x4e9'
Stop.

@fuyutsuki
Copy link
Author

The issue was that I was building with VisualStudio 2019 14.28, but the arch was built with win32.
I'm sorry for my mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants