Building OpenSSL on Win32, with zlib - windows

I'm trying to build Open SSL on Windows using VS 2013, with ZLIB support.
I follow the instructions this way:
perl Configure VC-WIN32 --prefix="D:\work_local\openssl\openssl-1.0.1h\redist" no-asm zlib no-shared
ms\do_ms
nmake -f ms\ntdll.mak
Now I get linker error, saying zlib1.lib is not found.
What is surprising, is that it didn't complain about not finding zlib.h.
So how do I pass ZLIB include and LIB path while building OpenSSL on Windows?

You need to add --with-zlib-include=[path to zlib headers] --with-zlib-lib=[path to zlib static library]

Related

Is no-asm option while building openssl discouraged?

I am looking at some old code in the product i am working on and it seems they have used no-asm option while compiling openssl. I read that with assembly routines openssl can perform faster. Then why using assembly subroutines while compiling openssl is discouraged. Is it related to FIPS guidelines?

XML::LibXML - problem installing the module on a fresh macOS BigSur

I've been successfully using XML::LibXML module for a while on macOS.
Now I am trying to install it on a new machine with macOS BigSur:
perl Makefile.PL
make
make test
make install
However, in "make test" I get multiple errors of the kind:
t/00-report-prereqs.t .............................. ok
t/01basic.t ........................................
Can't load '/Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/arch/auto/XML/LibXML/LibXML.bundle'
for module XML::LibXML: dlopen(/Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/arch/auto/XML/LibXML/LibXML.bundle, 0x0002):
symbol '_xmlFree' not found, expected in flat namespace by
'/Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/arch/auto/XML/LibXML/LibXML.bundle'
at /System/Library/Perl/5.28/darwin-thread-multi-2level/DynaLoader.pm line 197.
at /Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/lib/XML/LibXML.pm line 156.
BEGIN failed--compilation aborted
at /Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/lib/XML/LibXML.pm line 156.
Compilation failed in require at t/01basic.t line 6.
And the module cannot be installed.
Any hints what I am missing and how to fix?
Thanks,
Irina
Have you read the README for the module? It includes the following:
DEPENDENCIES
============
Prior to installation you MUST have installed the libxml2 library. You can get the
latest libxml2 version from
http://xmlsoft.org/
Without libxml2 installed this module will neither build nor run.
Also XML::LibXML requires the following packages:
o XML::SAX - base class for SAX parsers
o XML::NamespaceSupport - namespace support for SAX parsers
These packages are required. If one is missing some tests will fail.
Again, libxml2 is required to make XML::LibXML work. The library is not just required
to build XML::LibXML, it has to be accessible during run-time as well. Because of
this you need to make sure libxml2 is installed properly. To test this, run the
xmllint program on your system. xmllint is shipped with libxml2 and therefore should
be available. For building the module you will also need the header file for libxml2,
which in binary (.rpm,.deb) etc. distributions usually dwell in a package named
libxml2-devel or similar.
So you need to have libxml2 (and its development header files) installed on your system.
Looks like it's an issue with Apple's dynamic linker as described here:
https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/381.
I installed the suggested ExtUtils-MakeMaker-7.58 module and this solved the initial issue.
However, now there is a new error on make:
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- LibXML.bs blib/arch/auto/XML/LibXML/LibXML.bs 644
cc -c -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -g -pipe -fno-strict-aliasing -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -Wno-error=implicit-function-declaration -Os -DVERSION="2.0206" -DXS_VERSION="2.0206" "-I/System/Library/Perl/5.28/darwin-thread-multi-2level/CORE" -DHAVE_UTF8 Av_CharPtrPtr.c
Av_CharPtrPtr.c:6:10: fatal error: 'EXTERN.h' file not found
#include "EXTERN.h"
Any clue?

How to compile OpenSSL libraries for specific deployment macOS version?

I am compiling OpenSSL libraries on macOS 10.15, but my application deployment target (which uses these OpenSSL libraries) is 10.12.
So, when I link these libraries with my application I get multiple errors like this:
ld: warning: object file (.../libcrypto.a) was built for newer OXS version (10.15) than being linked (10.12)
The question is:
how to compile OpenSSL to be linked with specific deployment target (in my case it is 10.12)?
When compiling OpenSSL I am trying to configure it like this:
$ ./configure darwin64-x86_64-cc --prefix=/Users/username/openssl --openssldir=/Users/username/openssl/ssl -mmacosx-version-min=10.12
but this does not help.
Ok, I did not execute the command:
$ make distclean
at the end of my previous compilation.
So, it should look like this:
$ ./configure darwin64-x86_64-cc --prefix=/Users/username/openssl --openssldir=/Users/username/openssl/ssl -mmacosx-version-min=10.12
$ make depend
$ make install
$ make distclean
Then all temporary files will be deleted and next compilations with modified sittings will work.

How to fix "builddir not recognized as an internal or external command." error when building libiconv?

I'm trying to compile libiconv under Windows 7 using mingw. I've been following this tutorial: https://blog.inventic.eu/2010/11/how-to-compile-open-source-libraries-under-windows-using-mingw/
However when I try to make, it throws an error.
Here's a sreenshot:
https://imgur.com/a/LVsGgRC
Some packages have build instructions for Windows included in the package.
In particular, GNU libiconv has a file README.windows or INSTALL.windows.
MSYS is not a supported environment for building GNU libiconv.

Compile SQLCipher on Mac OS 10.8 (64 bit)

When I compile SQLCIPHER on MacOS 64bit
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2" LDFLAGS="/Users/administrator/Documents/openssl/lib/libcrypto.a"
I get 32bit lib libsqlite3.a
But I need a 64bit libsqlite3.a
How I can do this?
The new version of SQLCIPHER does not require OpenSSL anymore.
You first need to configure the build, these are the suggested settings for CommonCrypto rather than SSL as a crypto provider.
./configure --enable-load-extension --enable-tempstore=yes \
--with-crypto-lib=commoncrypto \
CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3" \ LDFLAGS="/System/Library/Frameworks/Security.framework/Versions/Current/Security"
Then you need to make it:
make
You will get a 64 bit statically linked SQLLite library.
Have you verified you are linking against a 64-bit version of libcrypto.a since it appears you are building OpenSSL yourself? You will want to run ./Configure darwin64-x86_64-cc if you are building OpenSSL from source for x86_64. The version of OpenSSL found on the system should contain both i386 and x86_64 versions of the architecture, so you shouldn't need to rebuild OpenSSL. Could you run file .libs/sqlite and show the output following a compilation?

Resources