diff options
author | Andre McCurdy <armccurdy@gmail.com> | 2018-08-20 17:47:28 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-21 14:49:42 +0100 |
commit | 4cdbea37470d4f4f8e8796bf2f51b2e1857ba8b7 (patch) | |
tree | 4e3bbe8efbd2efd2d3c8123a8428b237a5603483 /meta/recipes-connectivity/openssl | |
parent | 920e9a4ac40bdd1923cbb63959af15f449d5323b (diff) | |
download | poky-4cdbea37470d4f4f8e8796bf2f51b2e1857ba8b7.tar.gz |
openssl: fix hardcoded paths in native for openssl 1.1
Relying on hardcoded built-in paths causes openssl-native to not be
relocateable from sstate.
Solution for openssl 1.1, based on the existing solution from
openssl 1.0:
http://git.openembedded.org/openembedded-core/commit/?id=771d3123331fbfab1eb9ce47e3013eabcb2248f5
(From OE-Core rev: c226820183f44a2830b5172cac5888b17872c5c8)
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/openssl')
-rw-r--r-- | meta/recipes-connectivity/openssl/openssl/0001-allow-OPENSSLDIR-and-ENGINESDIR-CFLAGS-to-be-control.patch | 39 | ||||
-rw-r--r-- | meta/recipes-connectivity/openssl/openssl_1.1.0i.bb | 10 |
2 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/0001-allow-OPENSSLDIR-and-ENGINESDIR-CFLAGS-to-be-control.patch b/meta/recipes-connectivity/openssl/openssl/0001-allow-OPENSSLDIR-and-ENGINESDIR-CFLAGS-to-be-control.patch new file mode 100644 index 0000000000..67d06fc78e --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl/0001-allow-OPENSSLDIR-and-ENGINESDIR-CFLAGS-to-be-control.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 26e98beb8a987cdc69699aaffc5599926fb1b293 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andre McCurdy <armccurdy@gmail.com> | ||
3 | Date: Fri, 17 Aug 2018 20:33:44 -0700 | ||
4 | Subject: [PATCH] allow OPENSSLDIR and ENGINESDIR CFLAGS to be controlled | ||
5 | |||
6 | Upstream-Status: Inappropriate [OE Specific] | ||
7 | |||
8 | Signed-off-by: Andre McCurdy <armccurdy@gmail.com> | ||
9 | --- | ||
10 | Configurations/unix-Makefile.tmpl | 6 +++++- | ||
11 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl | ||
14 | index 034d93e..2310d12 100644 | ||
15 | --- a/Configurations/unix-Makefile.tmpl | ||
16 | +++ b/Configurations/unix-Makefile.tmpl | ||
17 | @@ -156,6 +156,10 @@ LIBDIR={- # | ||
18 | ENGINESDIR={- use File::Spec::Functions; | ||
19 | catdir($prefix,$libdir,"engines-$sover") -} | ||
20 | |||
21 | +# Intermediate variables so the values defined via CFLAGS can be controlled. | ||
22 | +OE_DOPENSSLDIR=$(OPENSSLDIR) | ||
23 | +OE_DENGINESDIR=$(ENGINESDIR) | ||
24 | + | ||
25 | # Convenience variable for those who want to set the rpath in shared | ||
26 | # libraries and applications | ||
27 | LIBRPATH=$(INSTALLTOP)/$(LIBDIR) | ||
28 | @@ -174,7 +178,7 @@ HTMLSUFFIX=html | ||
29 | |||
30 | CROSS_COMPILE= {- $config{cross_compile_prefix} -} | ||
31 | CC= $(CROSS_COMPILE){- $target{cc} -} | ||
32 | -CFLAGS={- our $cflags2 = join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $target{cflags} -} {- $config{cflags} -} | ||
33 | +CFLAGS={- our $cflags2 = join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OE_DOPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(OE_DENGINESDIR)\\\"\"") -} {- $target{cflags} -} {- $config{cflags} -} | ||
34 | CFLAGS_Q={- $cflags2 =~ s|([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -} | ||
35 | LDFLAGS= {- $target{lflags}." ".$ENV{'LDFLAGS'} -} | ||
36 | PLIB_LDFLAGS= {- $target{plib_lflags} -} | ||
37 | -- | ||
38 | 1.9.1 | ||
39 | |||
diff --git a/meta/recipes-connectivity/openssl/openssl_1.1.0i.bb b/meta/recipes-connectivity/openssl/openssl_1.1.0i.bb index 507f8f881b..d2f2624f9e 100644 --- a/meta/recipes-connectivity/openssl/openssl_1.1.0i.bb +++ b/meta/recipes-connectivity/openssl/openssl_1.1.0i.bb | |||
@@ -14,6 +14,7 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ | |||
14 | file://run-ptest \ | 14 | file://run-ptest \ |
15 | file://openssl-c_rehash.sh \ | 15 | file://openssl-c_rehash.sh \ |
16 | file://0001-Take-linking-flags-from-LDFLAGS-env-var.patch \ | 16 | file://0001-Take-linking-flags-from-LDFLAGS-env-var.patch \ |
17 | file://0001-allow-OPENSSLDIR-and-ENGINESDIR-CFLAGS-to-be-control.patch \ | ||
17 | " | 18 | " |
18 | 19 | ||
19 | SRC_URI_append_class-nativesdk = " \ | 20 | SRC_URI_append_class-nativesdk = " \ |
@@ -30,6 +31,9 @@ inherit lib_package multilib_header ptest relative_symlinks | |||
30 | #| ./libcrypto.so: undefined reference to `makecontext' | 31 | #| ./libcrypto.so: undefined reference to `makecontext' |
31 | EXTRA_OECONF_append_libc-musl = " -DOPENSSL_NO_ASYNC" | 32 | EXTRA_OECONF_append_libc-musl = " -DOPENSSL_NO_ASYNC" |
32 | 33 | ||
34 | EXTRA_OEMAKE_append_class-native = " OE_DOPENSSLDIR='/not/builtin' OE_DENGINESDIR='/not/builtin'" | ||
35 | EXTRA_OEMAKE_append_class-nativesdk = " OE_DOPENSSLDIR='/not/builtin' OE_DENGINESDIR='/not/builtin'" | ||
36 | |||
33 | do_configure () { | 37 | do_configure () { |
34 | os=${HOST_OS} | 38 | os=${HOST_OS} |
35 | case $os in | 39 | case $os in |
@@ -116,6 +120,12 @@ do_install () { | |||
116 | } | 120 | } |
117 | 121 | ||
118 | do_install_append_class-native () { | 122 | do_install_append_class-native () { |
123 | create_wrapper ${D}${bindir}/openssl \ | ||
124 | OPENSSL_CONF=${libdir}/ssl-1.1/openssl.cnf \ | ||
125 | SSL_CERT_DIR=${libdir}/ssl-1.1/certs \ | ||
126 | SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \ | ||
127 | OPENSSL_ENGINES=${libdir}/ssl-1.1/engines | ||
128 | |||
119 | # Install a custom version of c_rehash that can handle sysroots properly. | 129 | # Install a custom version of c_rehash that can handle sysroots properly. |
120 | # This version is used for example when installing ca-certificates during | 130 | # This version is used for example when installing ca-certificates during |
121 | # image creation. | 131 | # image creation. |