On Tue, Sep 16, 2014 at 7:47 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:> IIUC zlib availability is tested and the library used if present. Do you > mean that LLVM does not use zlib on Windows when the library is present?Sure, but if there aren't instructions for how to do it easily, then it's effectively unsupported. There isn't really a canonical way to "install" headers and libraries on Windows like you would on Linux. It probably works on MinGW, but then you're a MinGW binary in a MinGW world. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140916/78ced205/attachment.html>
Large software libraries like OpenCV (under 3rdparty directory) do include copies of zlib and friends and build it, for that reasons. The source code is just half a megabyte and I think the license is compatible. We could do the same with zlib or miniz. 2014-09-17 7:02 GMT+03:00 Reid Kleckner <rnk at google.com>:> On Tue, Sep 16, 2014 at 7:47 PM, Óscar Fuentes <ofv at wanadoo.es> wrote: > >> IIUC zlib availability is tested and the library used if present. Do you >> mean that LLVM does not use zlib on Windows when the library is present? > > > Sure, but if there aren't instructions for how to do it easily, then it's > effectively unsupported. There isn't really a canonical way to "install" > headers and libraries on Windows like you would on Linux. > > It probably works on MinGW, but then you're a MinGW binary in a MinGW > world. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140917/d169123b/attachment.html>
On Wed, Sep 17, 2014 at 12:27:42PM +0300, Yaron Keren wrote:> Large software libraries like OpenCV (under 3rdparty directory) do include > copies of zlib and friends and build it, for that reasons. The source code > is just half a megabyte and I think the license is compatible. We could do > the same with zlib or miniz.>From a packager's perspective, library bundling is one of the mostobnoxious issues around. It creates all kind of fun whenever a security issue is found or you have to fix the same portability issue in 100 different copies (*cough* gtest *cough*) Joerg
>> IIUC zlib availability is tested and the library used if present. Do you >> mean that LLVM does not use zlib on Windows when the library is present? > > > Sure, but if there aren't instructions for how to do it easily, then it's > effectively unsupported. There isn't really a canonical way to "install" > headers and libraries on Windows like you would on Linux. > > It probably works on MinGW, but then you're a MinGW binary in a MinGW world.I really don't like the idea of bundling zlib. I'm not aware of LLVM bundling any external libraries currently and I don't think now is a good time to start. Based on what has been discussed so far it sounds like it's "possible" to build zlib (or use a prebuilt binary) on windows and use it within LLVM so surely the right solution is... * Document how zlib can by LLVM on windows. * Improve our detection of zlib. I glanced at the the CMake files and we aren't using ``find_package(zlib)`` which surprises me. Packages exist in CMake to abstract away the issue of finding where header files and libraries actually live. I glanced at the implementation of FindZLIB.cmake and it looks like it has Windows support because I see ``` # Normal search. set(_ZLIB_SEARCH_NORMAL PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]" "$ENV{PROGRAMFILES}/zlib" ) ``` Thanks, Dan.
On Wed, Sep 17, 2014 at 3:52 PM, Dan Liew <dan at su-root.co.uk> wrote:>>> IIUC zlib availability is tested and the library used if present. Do you >>> mean that LLVM does not use zlib on Windows when the library is present? >> >> >> Sure, but if there aren't instructions for how to do it easily, then it's >> effectively unsupported. There isn't really a canonical way to "install" >> headers and libraries on Windows like you would on Linux. >> >> It probably works on MinGW, but then you're a MinGW binary in a MinGW world. > > I really don't like the idea of bundling zlib. I'm not aware of LLVM > bundling any external libraries currently and I don't think now is a > good time to start. Based on what has been discussed so far it sounds > like it's "possible" to build zlib (or use a prebuilt binary) on > windows and use it within LLVM so surely the right solution is... > > * Document how zlib can by LLVM on windows. > * Improve our detection of zlib. I glanced at the the CMake files and > we aren't using ``find_package(zlib)`` which surprises me. Packages > exist in CMake to abstract away the issue of finding where header > files and libraries actually live. I glanced at the implementation of > FindZLIB.cmake and it looks like it has Windows support because I see > > ``` > # Normal search. > set(_ZLIB_SEARCH_NORMAL > PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]" > "$ENV{PROGRAMFILES}/zlib" > ) > ```So installing zlib from http://gnuwin32.sourceforge.net/packages/zlib.htm should work fine.
Reid Kleckner <rnk at google.com> writes:> On Tue, Sep 16, 2014 at 7:47 PM, Óscar Fuentes <ofv at wanadoo.es> wrote: > >> IIUC zlib availability is tested and the library used if present. Do you >> mean that LLVM does not use zlib on Windows when the library is present? > > > Sure, but if there aren't instructions for how to do it easily, then it's > effectively unsupported. There isn't really a canonical way to "install" > headers and libraries on Windows like you would on Linux.That's a non-issue. Downloading, compiling and installing zlib on Windows takes about 10 minutes, for both MinGW and MSVC. There are pre-compiled packages around too. It is a good thing that LLVM works when zlib is not present, but assuming that LLVM will not support certain zlib-related features "because it is Windows" just shows how much misinformation some people have about that OS.> It probably works on MinGW, but then you're a MinGW binary in a MinGW > world.I think you are confusing MinGW with Cygwin. There is nothing special about MinGW binaries. Moreover, for C code the libraries are compatible. I've been using the same zlib binary on both MinGW(-w64) and MSVC for a decade, across multiple toolset releases. The "MinGW world" vs the "VS world" is restricted to C++, where different ABIs are used by their respective compilers. That's nothing new on Windows, which doesn't has a "platform C++ ABI" (nor Linux has, because C++ has no special role on neither OS.) C++ compilers with incompatible C++ ABIs are common on Windows. Actually, a MSVC++ version is often incompatible with other versions.
On Wed, Sep 17, 2014 at 6:30 AM, Óscar Fuentes <ofv at wanadoo.es> wrote:> Reid Kleckner <rnk at google.com> writes: > > > On Tue, Sep 16, 2014 at 7:47 PM, Óscar Fuentes <ofv at wanadoo.es> wrote: > > > >> IIUC zlib availability is tested and the library used if present. Do you > >> mean that LLVM does not use zlib on Windows when the library is present? > > > > > > Sure, but if there aren't instructions for how to do it easily, then it's > > effectively unsupported. There isn't really a canonical way to "install" > > headers and libraries on Windows like you would on Linux. > > That's a non-issue. Downloading, compiling and installing zlib on > Windows takes about 10 minutes, for both MinGW and MSVC. There are > pre-compiled packages around too. > > It is a good thing that LLVM works when zlib is not present, but > assuming that LLVM will not support certain zlib-related features > "because it is Windows" just shows how much misinformation some people > have about that OS.I haven't heard of anyone doing this successfully, and there isn't any documentation, which is just a hair shy of being unsupported. I agree, though, we can fix this. If GnuWin32 provides a usable zlib, that's great, we should document how to use it.> It probably works on MinGW, but then you're a MinGW binary in a MinGW > > world. > > I think you are confusing MinGW with Cygwin. There is nothing special > about MinGW binaries. Moreover, for C code the libraries are compatible. > I've been using the same zlib binary on both MinGW(-w64) and MSVC for a > decade, across multiple toolset releases. >I did mean MinGW, I was really just referring to the C++ ABI, alternative SDK headers, and CRT adapters.> The "MinGW world" vs the "VS world" is restricted to C++, where > different ABIs are used by their respective compilers. That's nothing > new on Windows, which doesn't has a "platform C++ ABI" (nor Linux has, > because C++ has no special role on neither OS.) C++ compilers with > incompatible C++ ABIs are common on Windows. Actually, a MSVC++ version > is often incompatible with other versions.There are proposals to define such a platform C++ ABI for Windows, N4028: https://isocpp.org/blog/2014/05/n4028 It's not clear to me that the ISO C++ standard is the right place to declare that, but it suggests that Microsoft (or at least Herb) intend to document the Visual C++ ABI. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140917/09da1671/attachment.html>