microsoft / php-sdk-binary-tools

Tool kit for building PHP under Windows
BSD 2-Clause "Simplified" License
270 stars 79 forks source link

libzip-1.6.1-vs16-x64 ENABLE_LZMA #71

Closed nono303 closed 4 years ago

nono303 commented 4 years ago

Hi, Since update of libzip on may 29th (1.5.2 > 1.6.1) on https://windows.php.net/Downloads/php-sdk/deps/vs16/x64/, php compilation failed with following error:

   Creating library C:\sdk\src\php-sdk\phpmaster\vs16\x64\build\Release\php7.lib and object C:\sdk\src\php-sdk\phpmaster\vs16\x64\build\Release\php7.exp
libzip_a.lib(zip_algorithm_xz.obj) : error LNK2001: unresolved external symbol lzma_code
libzip_a.lib(zip_algorithm_xz.obj) : error LNK2001: unresolved external symbol lzma_end
libzip_a.lib(zip_algorithm_xz.obj) : error LNK2001: unresolved external symbol lzma_lzma_preset
libzip_a.lib(zip_algorithm_xz.obj) : error LNK2001: unresolved external symbol lzma_stream_encoder
libzip_a.lib(zip_algorithm_xz.obj) : error LNK2001: unresolved external symbol lzma_alone_encoder
libzip_a.lib(zip_algorithm_xz.obj) : error LNK2001: unresolved external symbol lzma_stream_decoder
libzip_a.lib(zip_algorithm_xz.obj) : error LNK2001: unresolved external symbol lzma_alone_decoder
C:\sdk\src\php-sdk\phpmaster\vs16\x64\build\Release\php7.dll : fatal error LNK1120: 7 unresolved externals
NMAKE : fatal error U1077: 'C:\sdk\softs\vs19\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\link.exe' : return code '0x460'
Stop.

According to https://github.com/nih-at/libzip/blob/rel-1-6-1/CMakeLists.txt, is 1.6.1 released version was built with ENABLE_LZMA ? I have checked and it work with previous libzip-1.5.2-vs16-x64.zip.

Thanks!

cmb69 commented 4 years ago

Did you update the dependencies (phpsdk_deps -u)?

nono303 commented 4 years ago

Did you update the dependencies (phpsdk_deps -u)?

My fault!! Not with phpsdk_deps -u ; manually using https://windows.php.net/Downloads/php-sdk/deps/series/packages-master-vs16-x64-staging.txt and i just see that liblzma-5.2.5-vs16-x64.zip was added.... As I build some of the required deps, I didn't download all of them and my own "phpsdk_deps" script didn't look for new libs ^^ Fmi. did you build libzip lzma support with this patch:

diff --git "a/lib/zip_algorithm_xz.c" "b/lib/zip_algorithm_xz.c"
index 6dd14ce7..0492fc40 100644
--- "a/lib/zip_algorithm_xz.c"
+++ "b/lib/zip_algorithm_xz.c" 
@@ -36,6 +36,8 @@

 #include <limits.h>
 #include <stdlib.h>
+// https://github.com/ShiftMediaProject/liblzma/blob/master/windows/INSTALL-MSVC.txt
+#define LZMA_API_STATIC
 #include <lzma.h>

 struct ctx {
cmb69 commented 4 years ago

Fmi. did you build libzip lzma support with this patch:

libzip-1.6.1 has been build with https://github.com/winlibs/libzip/commit/01b972146c4adb0b3c38f11a87616b673e99af9b (that macro has been defined by passing /D LZMA_API_STATIC to cl.exe).

nono303 commented 4 years ago

Thanks!