arm-trusted-firmware-mvebu: Use host flags for cryptest compilation
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 26 Dec 2022 23:28:03 +0000 (00:28 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 31 Dec 2022 18:55:42 +0000 (19:55 +0100)
Without these changes it used the system LDFLAGS for the compilation of
the cryptopp library. This does not always work when we add
"-no-warn-rwx-segments" which is done to support binutils 2.39 inside of
OpenWrt.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/boot/arm-trusted-firmware-mvebu/Makefile
package/boot/arm-trusted-firmware-mvebu/patches/002-cryptopp_ldflags.patch [new file with mode: 0644]

index 569d952cb832f4835859891b989f6dc8fce4a416..088204c78ab3eb57ddee82b9ef278e9ad525e588 100644 (file)
@@ -125,6 +125,8 @@ TFA_MAKE_FLAGS += \
                WTP=$(BUILD_DIR)/$(A3700_UTILS_NAME) \
                WTMI_IMG=$(BUILD_DIR)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE)/wtmi_app.bin \
                CRYPTOPP_PATH=$(BUILD_DIR)/$(CRYPTOPP_NAME) \
+               HOST_LDFLAGS="$(HOST_LDFLAGS)" \
+               HOST_CPPFLAGS="$(HOST_CPPFLAGS)" \
                USE_COHERENT_MEM=0 \
                FIP_ALIGN=0x100 \
                DDR_TOPOLOGY=$(DDR_TOPOLOGY) \
diff --git a/package/boot/arm-trusted-firmware-mvebu/patches/002-cryptopp_ldflags.patch b/package/boot/arm-trusted-firmware-mvebu/patches/002-cryptopp_ldflags.patch
new file mode 100644 (file)
index 0000000..c4de8fe
--- /dev/null
@@ -0,0 +1,13 @@
+Forward the host compiler flags to the compilation of the cryptopp library.
+
+--- a/plat/marvell/armada/a3k/common/a3700_common.mk
++++ b/plat/marvell/armada/a3k/common/a3700_common.mk
+@@ -149,7 +149,7 @@ $(TBB): FORCE
+       $(if $(wildcard $(CRYPTOPP_LIBDIR)/*),,$(error "Either 'CRYPTOPP_PATH' or 'CRYPTOPP_LIB' was set to '$(CRYPTOPP_LIBDIR)', but '$(CRYPTOPP_LIBDIR)' does not exist"))
+       $(if $(wildcard $(CRYPTOPP_INCDIR)/*),,$(error "Either 'CRYPTOPP_PATH' or 'CRYPTOPP_INCDIR' was set to '$(CRYPTOPP_INCDIR)', but '$(CRYPTOPP_INCDIR)' does not exist"))
+ ifdef CRYPTOPP_PATH
+-      $(Q)$(MAKE) --no-print-directory -C $(CRYPTOPP_PATH) -f GNUmakefile
++      $(Q)$(MAKE) --no-print-directory -C $(CRYPTOPP_PATH) -f GNUmakefile LDFLAGS="$(HOST_LDFLAGS)" CPPFLAGS="$(HOST_CPPFLAGS)"
+ endif
+       $(Q)$(MAKE) --no-print-directory -C $(WTP)/wtptp/src/TBB_Linux -f TBB_linux.mak LIBDIR=$(CRYPTOPP_LIBDIR) INCDIR=$(CRYPTOPP_INCDIR)