Creating a general build #1480
Replies: 3 comments
-
@MutexMakhano Unless you enable the "Native" configure parameter, it will compile a library that is backwards compatible with respect to older CPUs (lets ignore the libc backwards compatibility issue, as that is separate and you probably have that under control already). So, what configure and CMake (please consider using CMake instead) do is detect your arch and what your compiler can do, then it compiles the library to support all the zlib-ng features that is possible for your arch+compiler combination. Zlib-ng will then do runtime checking of the cpu upon use, and only run the best optimized functions given your cpus' instruction sets. Manually specifying -msse2 or similar will mess with the compilation, as Configure/CMake already compile separate files with the specific instruction sets that they require. So, I believe your problem is already solved, and perhaps we failed to communicate properly that we already do run-time selection of instruction sets to use. |
Beta Was this translation helpful? Give feedback.
-
Hi, I can see how to do the build with HAVE_XSAVE_INTRINSICS, if I set that presumably it will still test it is available before using it at runtime? I agree I do not need the compiler flags, as I realized after posting. I will have another go at getting it to work. |
Beta Was this translation helpful? Give feedback.
-
You do not need to specify anything extra. Runtime checks are used to select what instruction sets can be used. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I build my software with zlib embedded inside it, for builds to Linux and Windows. This is pretty much the only way to use the latest zlib version on some Linux distributions, and the only way to get Windows users to be able to run it as a zlib dll won't be installed and there are security issues loading a zlib.dll from the current directory.
The trouble with configure is that it spits out a build for the machine it's running on, not a general build that will use the machine's capability that it actually is running on.
How do I do this?
I tried to do ./configure --zlib-compat and build the application with all the #defines and gcc flags like -msse2, but I just got illegal instruction when it ran and it didn't even get to initialize zlib.
Blake 3 does this for example. There's just one build which probes the machine at run time.
Beta Was this translation helpful? Give feedback.
All reactions