New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 740158 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 7
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 649672



Sign in to add a comment

Fix dev-embedded/u-boot-tools for OpenSSL 1.1

Project Member Reported by djkurtz@chromium.org, Jul 7 2017

Issue description

dev-embedded/u-boot-tools-2016.03 fails to build with dev-libs/openssl-1.1.0f.

If installed from a pre-built binary package on a system with openssl-1.1 libraries, "mkimage" fails to run with error:

mkimage: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory

This manifests itself when trying to build chromeos-kernel-3_18 on an arm system, as mkimage is used by cros-kernel2.eclass to process device trees.

Build time failure is:

In file included from tools/lib/rsa/rsa-sign.c:1:
./tools/../lib/rsa/rsa-sign.c:213:2: warning: implicit declaration of function 'EVP_MD_CTX_cleanup' is invalid in C99 [-Wimplicit-function-declaration]
        EVP_MD_CTX_cleanup(context);
        ^
./tools/../lib/rsa/rsa-sign.c:279:21: error: incomplete definition of type 'struct rsa_st'
        if (BN_num_bits(key->e) > 64)
                        ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
In file included from tools/lib/rsa/rsa-sign.c:1:
./tools/../lib/rsa/rsa-sign.c:282:22: error: incomplete definition of type 'struct rsa_st'
        *e = BN_get_word(key->e);
                         ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
In file included from tools/lib/rsa/rsa-sign.c:1:
./tools/../lib/rsa/rsa-sign.c:284:21: error: incomplete definition of type 'struct rsa_st'
        if (BN_num_bits(key->e) < 33) {
                        ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
In file included from tools/lib/rsa/rsa-sign.c:1:
./tools/../lib/rsa/rsa-sign.c:289:20: error: incomplete definition of type 'struct rsa_st'
        bn_te = BN_dup(key->e);
                       ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
In file included from tools/lib/rsa/rsa-sign.c:1:
./tools/../lib/rsa/rsa-sign.c:340:21: error: incomplete definition of type 'struct rsa_st'
        if (!BN_copy(n, key->n) || !BN_set_word(big1, 1L) ||
                        ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
1 warning and 5 errors generated.
make[1]: *** [scripts/Makefile.host:111: tools/lib/rsa/rsa-sign.o] Error 1
 
A fix exists upstream:
[0] http://git.denx.de/?p=u-boot.git;a=commit;h=c3b4328166b03d6749b86eb0fbb21a10e4395cfd

However, this is not yet in the latest release (2017.05), nor in upstream gentoo ebuild [1].

[1] https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-embedded/u-boot-tools/u-boot-tools-2017.05.ebuild
Project Member

Comment 3 by bugdroid1@chromium.org, Jul 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/portage-stable/+/bafbaba312733ef9af74ca748e2e08bc92c89a6d

commit bafbaba312733ef9af74ca748e2e08bc92c89a6d
Author: Daniel Kurtz <djkurtz@chromium.org>
Date: Mon Jul 17 03:41:00 2017

dev-embedded/u-boot-tools: Update to latest from gentoo

Upstream u-boot-tools will add support for OpenSSL 1.1 in its next
release (2017.07).  For now, cherry-pick the required patches onto the
lastest upstream release (2017.05) from gentoo, with the following small
changes:

 * EAPI=5
 * KEYWORDS="*"
 * inherit base
 * Add PATCHES=()

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>

BUG= chromium:740158 
TEST=w/ openssl-1.0.2k: sudo emerge u-boot-tools
TEST=w/ openssl-1.1.0f: sudo emerge u-boot-tools
  => Builds ok in both cases.

Change-Id: If842f60182e475c2ef46be9ee6974a76a907b383
Reviewed-on: https://chromium-review.googlesource.com/563759
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[add] https://crrev.com/bafbaba312733ef9af74ca748e2e08bc92c89a6d/dev-embedded/u-boot-tools/files/u-boot-tools-2017.05-rsa-Fix-build-with-OpenSSL-1.1.x.patch
[modify] https://crrev.com/bafbaba312733ef9af74ca748e2e08bc92c89a6d/dev-embedded/u-boot-tools/Manifest
[rename] https://crrev.com/bafbaba312733ef9af74ca748e2e08bc92c89a6d/dev-embedded/u-boot-tools/u-boot-tools-2017.05.ebuild
[add] https://crrev.com/bafbaba312733ef9af74ca748e2e08bc92c89a6d/dev-embedded/u-boot-tools/files/u-boot-tools-2017.05-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch

Is this fixed?
Status: Fixed (was: Started)
Sure looks like it.  In any case this is stale as is the entire OpenSSL 1.1 effort, so marking Fixed.

The latest 2 upstream ebuilds at [0] are 2017.09 & 2018.05, both of which also have the fix, so we are safe to uprev as well.

[0] https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-embedded/u-boot-tools

Sign in to add a comment