I don't know what is causing this, but when I try to build sysutils/u-boot-rpi4, I get errors about EVP_PKEY_id and EVP_PKEY_size being undefined. Assuming it matters, I am using OpenSSL 3.2 from ports when compiling. Specifically the messages are: [00:00:28] ld: error: undefined symbol: EVP_PKEY_id [00:00:28] >>> referenced by ecdsa-libcrypto.c [00:00:28] >>> tools/generated/lib/ecdsa/ecdsa-libcrypto.o:(prepare_ctx) [00:00:28] ld: error: undefined symbol: EVP_PKEY_size [00:00:28] >>> referenced by rsa-sign.c [00:00:28] >>> tools/generated/lib/rsa/rsa-sign.o:(rsa_sign) A full build log can be found here: https://poudriere.cyberbotx.com:8768/data/13amd64-default/2024-06-03_12h27m51s/logs/errors/u-boot-rpi4-2024.04.log
Works fine here so the problem is likely that you use openssl from ports.
I don't think that one port can specify using ssl from base so adjust your make.conf so DEFAULT_VERSIONS=ssl=base is set for u-boot-*
Created attachment 251332 [details] u-boot.diff to fix building against ports OpenSSL I am going to re-open this, as I found the cause and the fix. Firstly: u-boot-tools APPEARED to not be affected by this problem, but in reality, it only was making it. It never uses the SSL choice by the user and always uses base OpenSSL. The cause: u-boot-tools and all the u-boot firmware ports that rely on u-boot-master never have the -I or -L flags needed for OpenSSL passed into the u-boot build system. Something in u-boot-master made it use -L/usr/local/lib anyways and that was causing my build failure. The build system also does not respect externally set CFLAGS and LDFLAGS. The fix: In order to get u-boot's build system to respect the user's wish as to what OpenSSL to use (as well as any other CFLAGS or LDFLAGS the user sets), add HOSTCFLAGS and HOSTLDFLAGS to the MAKE_ENV. Additionally: u-boot-master did not put compiler:c11 or ssl into USES like u-boot-tools did, so I added those. Also, I moved V=1 from MAKE_ENV to MAKE_ARGS as u-boot's build system ignore it when set in the former, and CC=clang was being completely ignored so I removed that.
See the above diff for why I'm reopening this.
(In reply to Naram Qashat from comment #3) Note that u-boot-tools installs host commands: /usr/local/bin/dumpimage /usr/local/bin/fit_info /usr/local/bin/mkenvimage /usr/local/bin/mkimage As I understand, that is why its build involves HOSTCFLAGS and HOSTLDFLAGS . The likes of sysutils/u-boot-rpi4 do not install any host command or libraries or such. As I understand, that is why they do not involve HOSTCFLAGS and do not involve HOSTLDFLAGS. So, I expect at least part of your changes to be inappropriate.
(In reply to Mark Millard from comment #5) Never mind: There is a bunch of HOSTCC in the sysutils/u-boot-rpi4 build: it does make host software that is used but not installed. Sorry for the noise.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=df65ca710c5f3a2ab709549607ea169015fc9bb4 commit df65ca710c5f3a2ab709549607ea169015fc9bb4 Author: Naram Qashat <cyberbotx@cyberbotx.com> AuthorDate: 2024-06-13 08:44:10 +0000 Commit: Emmanuel Vadot <manu@FreeBSD.org> CommitDate: 2024-06-13 09:42:08 +0000 sysutils/u-boot: Allow building with different openssl Add ssl to USES and export the needed variables so u-boot can be built with openssl from ports. PR: 279531 sysutils/u-boot-master/Makefile | 8 +++++--- sysutils/u-boot-tools/Makefile | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-)
Thanks, commited.