Skip to contentSkip to conversation

package/optee-test: fix build with openssl >= 3.0

PATCH Applied Romain Naour 2 participants 2 messages Aug 14, 2023 – Aug 15, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/optee-test: fix build with openssl >= 3.0

Backport an upstream:
"Add -DOPENSSL_API_COMPAT=10100 to the build flags to avoid this and be flexible with regards to which version of OpenSSL build environment has to provide"

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/4839060472

---
 ...-xtest-add-DOPENSSL_API_COMPAT-10100.patch | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 package/optee-test/0001-xtest-add-DOPENSSL_API_COMPAT-10100.patch
package/optee-test/0001-xtest-add-DOPENSSL_API_COMPAT-10100.patch new file +57 -0
new file mode 100644
index 0000000000..b876c3385f
@@ -0,0 +1,57 @@
+From a0db2b60b9f5c14e9f69c0e06e1a8d35f9fb1b5a Mon Sep 17 00:00:00 2001
+From: Jerome Forissier <[email protected]>
+Date: Tue, 25 Jul 2023 14:39:25 +0200
+Subject: [PATCH] xtest: add -DOPENSSL_API_COMPAT=10100
+
+regression_1000.c uses OpenSSL functions that have been deprecated
+after version 1.1. In particular, building with version 3.0 causes the
+following error (and other similar ones not pasted here):
+
+ optee_test/host/xtest/regression_1000.c: In function 'check_signature':
+ optee_test/host/xtest/regression_1000.c:2735:9: error: 'SHA256_Init' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
+  2735 |         SHA256_Init(&ctx);
+       |         ^~~~~~~~~~~
+
+Add -DOPENSSL_API_COMPAT=10100 to the build flags to avoid this and be
+flexible with regards to which version of OpenSSL build environment has
+to provide.
+
+Signed-off-by: Jerome Forissier <[email protected]>
+Acked-by: Jens Wiklander <[email protected]>
+(cherry picked from commit cf111604c4c32a76be90f29aab25fa9b882c8715)
+Upstream: https://github.com/OP-TEE/optee_test/commit/cf111604c4c32a76be90f29aab25fa9b882c8715
+Signed-off-by: Romain Naour <[email protected]>
+---
+ host/xtest/CMakeLists.txt | 2 +-
+ host/xtest/Makefile       | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/host/xtest/CMakeLists.txt b/host/xtest/CMakeLists.txt
+index 776787b..ae0f4e0 100644
+--- a/host/xtest/CMakeLists.txt
++++ b/host/xtest/CMakeLists.txt
+@@ -12,7 +12,7 @@ endif()
+ 
+ find_package(OpenSSL)
+ if(OPENSSL_FOUND)
+-	add_compile_options(-DOPENSSL_FOUND=1)
++	add_compile_options(-DOPENSSL_FOUND=1 -DOPENSSL_API_COMPAT=10100)
+ 	set (OPENSSL_PRIVATE_LINK OpenSSL::Crypto)
+ endif()
+ 
+diff --git a/host/xtest/Makefile b/host/xtest/Makefile
+index 8505629..2497850 100644
+--- a/host/xtest/Makefile
++++ b/host/xtest/Makefile
+@@ -39,7 +39,7 @@ endef
+ # - User/group login tests 1027 and 1028
+ WITH_OPENSSL ?= y
+ ifeq ($(WITH_OPENSSL),y)
+-CFLAGS += -DOPENSSL_FOUND=1
++CFLAGS += -DOPENSSL_FOUND=1 -DOPENSSL_API_COMPAT=10100
+ ifneq ($(OPTEE_OPENSSL_EXPORT),)
+ LDFLAGS += -lcrypto
+ CFLAGS += -I$(OPTEE_OPENSSL_EXPORT)
+-- 
+2.41.0
+
Signature · 6 lines
2.41.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Romain, All,

On 2023-08-14 22:16 +0200, Romain Naour spake thusly:

Quoted 9 lines

Backport an upstream:
"Add -DOPENSSL_API_COMPAT=10100 to the build flags to avoid this and be flexible with regards to which version of OpenSSL build environment has to provide"

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/4839060472

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 75 lines
---
 ...-xtest-add-DOPENSSL_API_COMPAT-10100.patch | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 package/optee-test/0001-xtest-add-DOPENSSL_API_COMPAT-10100.patch
package/optee-test/0001-xtest-add-DOPENSSL_API_COMPAT-10100.patch new file +57 -0
new file mode 100644
index 0000000000..b876c3385f
@@ -0,0 +1,57 @@
+From a0db2b60b9f5c14e9f69c0e06e1a8d35f9fb1b5a Mon Sep 17 00:00:00 2001
+From: Jerome Forissier <[email protected]>
+Date: Tue, 25 Jul 2023 14:39:25 +0200
+Subject: [PATCH] xtest: add -DOPENSSL_API_COMPAT=10100
+
+regression_1000.c uses OpenSSL functions that have been deprecated
+after version 1.1. In particular, building with version 3.0 causes the
+following error (and other similar ones not pasted here):
+
+ optee_test/host/xtest/regression_1000.c: In function 'check_signature':
+ optee_test/host/xtest/regression_1000.c:2735:9: error: 'SHA256_Init' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
+  2735 |         SHA256_Init(&ctx);
+       |         ^~~~~~~~~~~
+
+Add -DOPENSSL_API_COMPAT=10100 to the build flags to avoid this and be
+flexible with regards to which version of OpenSSL build environment has
+to provide.
+
+Signed-off-by: Jerome Forissier <[email protected]>
+Acked-by: Jens Wiklander <[email protected]>
+(cherry picked from commit cf111604c4c32a76be90f29aab25fa9b882c8715)
+Upstream: https://github.com/OP-TEE/optee_test/commit/cf111604c4c32a76be90f29aab25fa9b882c8715
+Signed-off-by: Romain Naour <[email protected]>
+---
+ host/xtest/CMakeLists.txt | 2 +-
+ host/xtest/Makefile       | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/host/xtest/CMakeLists.txt b/host/xtest/CMakeLists.txt
+index 776787b..ae0f4e0 100644
+--- a/host/xtest/CMakeLists.txt
++++ b/host/xtest/CMakeLists.txt
+@@ -12,7 +12,7 @@ endif()
+ 
+ find_package(OpenSSL)
+ if(OPENSSL_FOUND)
+-	add_compile_options(-DOPENSSL_FOUND=1)
++	add_compile_options(-DOPENSSL_FOUND=1 -DOPENSSL_API_COMPAT=10100)
+ 	set (OPENSSL_PRIVATE_LINK OpenSSL::Crypto)
+ endif()
+ 
+diff --git a/host/xtest/Makefile b/host/xtest/Makefile
+index 8505629..2497850 100644
+--- a/host/xtest/Makefile
++++ b/host/xtest/Makefile
+@@ -39,7 +39,7 @@ endef
+ # - User/group login tests 1027 and 1028
+ WITH_OPENSSL ?= y
+ ifeq ($(WITH_OPENSSL),y)
+-CFLAGS += -DOPENSSL_FOUND=1
++CFLAGS += -DOPENSSL_FOUND=1 -DOPENSSL_API_COMPAT=10100
+ ifneq ($(OPTEE_OPENSSL_EXPORT),)
+ LDFLAGS += -lcrypto
+ CFLAGS += -I$(OPTEE_OPENSSL_EXPORT)
+-- 
+2.41.0
+
Signature · 6 lines
2.41.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot