[package] openssl/1.1.1d: Does not build on Linux with defaults
See original GitHub issueConan fails to build version 1.1.1d with default options locally on my PC, while it builds version 1.1.1c
successfully. I’ve included my research and a workaround at the end of this post.
Package and Environment Details (include every applicable attribute)
- Package Name/Version: openssl/1.1.1d
- Commit: bf66f3c448aa42e76c9ba5f2d4380c4ff2fd8fd5
- Operating System+version: Fedora Linux 4.13.16-100.fc25.x86_64
- Compiler+version: gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
- Python version: Python 3.5.4
- conan is installed by
pip3 install conan
in a Local Linux installation (not in a chroot, not in a pyenvironment, not in docker).
Conan profile (output of conan profile show default
or conan profile show <profile>
if custom profile is in use)
Configuration for profile default:
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=6
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
Steps to reproduce (Include if Applicable)
- Setup a 1.1.1d` version. I could not find out how to setup a version for the build, so I just added it to the conanfile.py:
--- a/recipes/openssl/ALL/conanfile.py
+++ b/recipes/openssl/ALL/conanfile.py
@@ -65,6 +65,7 @@ class OpenSSLConan(ConanFile):
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/openssl/openssl"
license = "OpenSSL"
+ version = "1.1.1d"
topics = ("conan", "openssl", "ssl", "tls", "encryption", "security")
description = "A toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols"
options = {"no_threads": [True, False],
cd recipes/openssl/ALL/
- Run
conan install .
[akamyshev@localhost ALL]$ conan install . 2>&1 | tee conan_install.log
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=6
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
conanfile.py (openssl/1.1.1d): Installing package
Requirements
zlib/1.2.11 from 'conan-center' - Cache
Packages
zlib/1.2.11:f7e573cb501ccfc49e9e4d84de886bc1ef2e6ebb - Cache
zlib/1.2.11: Already installed!
conanfile.py (openssl/1.1.1d): Generator txt created conanbuildinfo.txt
conanfile.py (openssl/1.1.1d): Generated conaninfo.txt
conanfile.py (openssl/1.1.1d): Generated graphinfo
- Run
conan create .
Logs (Include/Attach if Applicable)
Here is an extract from a log, click to expand it
Exporting package recipe
openssl/1.1.1d exports: File 'conandata.yml' found. Exporting it...
openssl/1.1.1d exports: Copied 1 '.yml' file: conandata.yml
openssl/1.1.1d: The stored package has not changed
openssl/1.1.1d: Exported revision: 178f1531d5feaf93939c5495bef279ef
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=6
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
openssl/1.1.1d: Forced build from source
openssl/1.1.1d (test package): Installing package
Requirements
openssl/1.1.1d from local cache - Cache
zlib/1.2.11 from 'conan-center' - Cache
Packages
openssl/1.1.1d:008f1a2b119556f550c1109663570e0f5040c13f - Build
zlib/1.2.11:f7e573cb501ccfc49e9e4d84de886bc1ef2e6ebb - Cache
zlib/1.2.11: Already installed!
openssl/1.1.1d: Copying sources to build folder
openssl/1.1.1d: Building your package in /mnt/store/data1/conan_data/openssl/1.1.1d/_/_/build/008f1a2b119556f550c1109663570e0f5040c13f
openssl/1.1.1d: Generator txt created conanbuildinfo.txt
openssl/1.1.1d: Calling build()
openssl/1.1.1d: using target: conan-Release-Linux-x86_64-gcc-6 -> linux-generic32
openssl/1.1.1d: my %targets = (
"conan-Release-Linux-x86_64-gcc-6" => {
inherit_from => [ "linux-generic32" ],
cflags => add("-m64 -O3 -s"),
cxxflags => add("-m64 -O3 -s"),
defines => add("NDEBUG"),
includes => add("/mnt/store/data1/conan_data/zlib/1.2.11/_/_/package/f7e573cb501ccfc49e9e4d84de886bc1ef2e6ebb/include"),
lflags => add("-m64"),
},
);
openssl/1.1.1d: ['"conan-Release-Linux-x86_64-gcc-6"', 'no-shared', '--prefix=/mnt/store/data1/conan_data/openssl/1.1.1d/_/_/package/008f1a2b119556f550c1109663570e0f5040c13f', '--openssldir=/mnt/store/data1/conan_data/openssl/1.1.1d/_/_/package/008f1a2b119556f550c1109663570e0f5040c13f/res', 'no-unit-test', 'PERL=perl', 'no-tests', '--release', '-fPIC', '--with-zlib-include="/mnt/store/data1/conan_data/zlib/1.2.11/_/_/package/f7e573cb501ccfc49e9e4d84de886bc1ef2e6ebb/include"', '--with-zlib-lib="/mnt/store/data1/conan_data/zlib/1.2.11/_/_/package/f7e573cb501ccfc49e9e4d84de886bc1ef2e6ebb/lib"']
Configuring OpenSSL version 1.1.1d (0x1010104fL) for conan-Release-Linux-x86_64-gcc-6
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile
**********************************************************************
*** ***
*** OpenSSL has been successfully configured ***
...
./libcrypto.a(e_aes.o): In function `aesni_ocb_init_key':
e_aes.c:(.text+0x3206): undefined reference to `aesni_set_encrypt_key'
e_aes.c:(.text+0x3220): undefined reference to `aesni_set_decrypt_key'
e_aes.c:(.text+0x322c): undefined reference to `aesni_ocb_decrypt'
e_aes.c:(.text+0x323a): undefined reference to `aesni_decrypt'
e_aes.c:(.text+0x3241): undefined reference to `aesni_encrypt'
e_aes.c:(.text+0x3293): undefined reference to `aesni_ocb_encrypt'
./libcrypto.a(e_aes.o): In function `aesni_ecb_cipher':
e_aes.c:(.text+0x3393): undefined reference to `aesni_ecb_encrypt'
collect2: error: ld returned 1 exit status
Makefile:6198: recipe for target 'apps/openssl' failed
make[1]: *** [apps/openssl] Error 1
make[1]: Leaving directory '/mnt/store/data1/conan_data/openssl/1.1.1d/_/_/build/008f1a2b119556f550c1109663570e0f5040c13f/sources'
Makefile:174: recipe for target 'all' failed
make: *** [all] Error 2
openssl/1.1.1d:
openssl/1.1.1d: WARN: Build folder is dirty, removing it: /mnt/store/data1/conan_data/openssl/1.1.1d/_/_/build/008f1a2b119556f550c1109663570e0f5040c13f
openssl/1.1.1d: ERROR: Package '008f1a2b119556f550c1109663570e0f5040c13f' build failed
openssl/1.1.1d: WARN: Build folder /mnt/store/data1/conan_data/openssl/1.1.1d/_/_/build/008f1a2b119556f550c1109663570e0f5040c13f
ERROR: openssl/1.1.1d: Error in build() method, line 590
self._make()
while calling '_make', line 558
self._run_make()
while calling '_run_make', line 518
self.run(" ".join(command), win_bash=self._win_bash)
ConanException: Error 2 while executing /usr/bin/make -j8
Here is the full build log: conan_create.log
Possible Source of the Issue
I’ve found the following issue on openssl issue-tracker: Broken compilation of openssl 1.1.1d.
Openssl 1.1.1d requires that during configure step, when you call Configure
script instead of a config
script, you either need to specify a specific target or set no_asm
option. See this answer in the same issue:
[…] if you use the generic target platform targets, you usually have to add no-asm, as they usually do not have assembler support. That’s the issue you had to start with. If you want assembler support, you need to make more specific with your choices (and assembler support may still be shaky, depending on your toolchain)
In my case the target specified by conan is conan-Release-Linux-x86_64-gcc-6
. Looks like openssl Configure
script does not recognize this target.
You can see the options of a Configure
script with this command perl configdata.pm -c -e
:
Command line (with current working directory = .):
perl ./Configure conan-Release-Linux-x86_64-gcc-6 no-shared --prefix=/mnt/store/data1/conan_data/openssl/1.1.1d/_/_/package/008f1a2b119556f550c1109663570e0f5040c13f --openssldir=/mnt/store/data1/conan_data/openssl/1.1.1d/_/_/package/008f1a2b119556f550c1109663570e0f5040c13f/res no-unit-test PERL=perl no-tests --release -fPIC --with-zlib-include=/mnt/store/data1/conan_data/zlib/1.2.11/_/_/package/f7e573cb501ccfc49e9e4d84de886bc1ef2e6ebb/include --with-zlib-lib=/mnt/store/data1/conan_data/zlib/1.2.11/_/_/package/f7e573cb501ccfc49e9e4d84de886bc1ef2e6ebb/lib
Perl information:
/usr/bin/perl
5.24.3 for x86_64-linux-thread-multi
Recorded environment:
AR =
BUILDFILE =
CC =
CFLAGS =
CPPFLAGS =
CROSS_COMPILE =
CXX =
CXXFLAGS =
HASHBANGPERL =
LDFLAGS =
LDLIBS =
OPENSSL_LOCAL_CONFIG_DIR =
PERL = perl
RANLIB =
RC =
RCFLAGS =
WINDRES =
__CNF_CFLAGS =
__CNF_CPPDEFINES =
__CNF_CPPFLAGS =
__CNF_CPPINCLUDES =
__CNF_CXXFLAGS =
__CNF_LDFLAGS =
__CNF_LDLIBS =
Workaround
I tried to remove the build and run:
conan install -o Pkg:no_asm=True .
conan create -o Pkg:no_asm=True .
The build has succeeded.
The build also succeeds with a previous version of openssl (1.1.1c
). The commands I run in this case are:
- remove previous build
conan install .
conan create .
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top GitHub Comments
yeah, I need to take a deeper look to understand what’s going on. e.g. in recipe we use upper Linux everywhere (e.g. in _targets). I don’t see any place where we use lower-case linux. seems like it goes somewhere from OpenSSL’s configure script, but what could it be? e.g. on Windows I already seen that target name matters - if target name starts from “VC-”, the special code takes place, same for “mingw-”. it might be the same for “linux-” prefix which had some special handling.
maybe I need another try with fedora:25 here…