summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-12-17 08:55:53 (GMT)
committerPeter Korsgaard <peter@korsgaard.com>2017-12-18 22:09:39 (GMT)
commita957d9a90ade4194dffe3eb2fc0136bc5d077c28 (patch)
tree8eb5af08cdba26fd79c548447a9e0d82f297a369
parent380c3d5e4067fcd0d551890083dc83edd6b8a055 (diff)
downloadbuildroot-a957d9a90ade4194dffe3eb2fc0136bc5d077c28.tar.gz
buildroot-a957d9a90ade4194dffe3eb2fc0136bc5d077c28.tar.bz2
boot/arm-trusted-firmware: build fiptool separately with dependency on host-openssl
ATF >= 1.3 builds a host program called fiptool which uses OpenSSL, so we need to build host-openssl. We could have made it an optional dependency like U-Boot does, but since most ATF versions are going to be >= 1.3 in the near future, we simply make host-openssl a mandatory dependency. However, the ATF build system is not very good, and you can't easily pass flags that will affect the build of host programs. Therefore, we take the approach of building fiptool separately before triggering the real build process. It would obviously be better to fix ATF itself, but as usual with those bootloader packages, we fetch different versions depending on the platform/configuration, making it difficult to use patches. Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/44868961 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--boot/arm-trusted-firmware/arm-trusted-firmware.mk14
1 files changed, 14 insertions, 0 deletions
diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index e8d1c62..4bac916 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -55,6 +55,19 @@ ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP),y)
ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += fip
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-openssl
+# fiptool only exists in newer (>= 1.3) versions of ATF, so we build
+# it conditionally. We need to explicitly build it as it requires
+# OpenSSL, and therefore needs to be passed proper variables to find
+# the host OpenSSL.
+define ARM_TRUSTED_FIRMWARE_BUILD_FIPTOOL
+ if test -d $(@D)/tools/fiptool; then \
+ $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/tools/fiptool \
+ $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
+ CPPFLAGS="$(HOST_CPPFLAGS)" \
+ LDLIBS="$(HOST_LDFLAGS) -lcrypto" ; \
+ fi
+endef
endif
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31),y)
@@ -62,6 +75,7 @@ ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += bl31
endif
define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
+ $(ARM_TRUSTED_FIRMWARE_BUILD_FIPTOOL)
$(TARGET_CONFIGURE_OPTS) \
$(MAKE) -C $(@D) $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
$(ARM_TRUSTED_FIRMWARE_MAKE_TARGETS)