xtest: use imported OpenSSL
This commit modifies the xtest Makefiles to deal with the cases where
xtest needs to use OpenSSL:
- When the GlobalPlatform tests are enabled (CFG_GP_PACKAGE_PATH is set),
- When the MbedTLS tests are enabled (CFG_TA_MBEDTLS=y).
For the first case, it is the "make patch" target that takes care of
copying the header files under host/xtest/for_gp/include/openssl.
For the second case however, the copy does not occur and only the -I flag
is added by [1], resulting in the following error:
cc1: error: for_gp/include: No such file or directory [-Werror=missing-include-dirs]
Address this problem by using the imported copy of OpenSSL.
The CMake and Android builds are not modified.
Fixes: [1] 43d58a5fce8f ("xtest: Makefile: link against OpenSSL if MBed TLS is enabled in TA")
Fixes: https://github.com/OP-TEE/optee_test/issues/285
Reported-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> (poplar)
diff --git a/host/xtest/Makefile b/host/xtest/Makefile
index 5ee68d6..47d24c2 100644
--- a/host/xtest/Makefile
+++ b/host/xtest/Makefile
@@ -26,11 +26,11 @@
# OpenSSL is used by GP tests series 8500 and Mbed TLS test 8103
ifneq (,$(filter y,$(CFG_GP_PACKAGE_PATH) $(CFG_TA_MBEDTLS)))
-CFLAGS += -Ifor_gp/include -DOPENSSL_FOUND=1
+CFLAGS += -I../openssl/include -DOPENSSL_FOUND=1
ifeq ($(COMPILE_NS_USER),32)
-LDFLAGS += ../lib/armv7/libcrypto.a -ldl
+LDFLAGS += ../openssl/lib/arm/libcrypto.a -ldl
else
-LDFLAGS += ../lib/armv8/libcrypto.a -ldl
+LDFLAGS += ../openssl/lib/aarch64/libcrypto.a -ldl
endif
endif