* [Buildroot] [PATCH 1/1] package/optee-client: fix uclibc build
@ 2023-02-22 22:17 Fabrice Fontaine
2023-02-22 23:01 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2023-02-22 22:17 UTC (permalink / raw)
To: buildroot; +Cc: Etienne Carriere, Fabrice Fontaine
Fix the following uclibc build failure raised since bump to version
3.19.0 in commit 917a961d9c77d5f1aaa47206add9b9ff80e74a82:
/tmp/instance-5/output-1/build/optee-client-3.19.0/libteeacl/src/group.c: In function 'teeacl_user_is_member_of':
/tmp/instance-5/output-1/build/optee-client-3.19.0/libteeacl/src/group.c:75:12: error: implicit declaration of function 'reallocarray' [-Werror=implicit-function-declaration]
75 | groups = reallocarray(groups, grouplistsize, sizeof(gid_t));
| ^~~~~~~~~~~~
Fixes:
- http://autobuild.buildroot.org/results/03eba71ab9b87676f2606ecf2a9b5a151fc396bb
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
...-use-realloc-instead-of-reallocarray.patch | 34 +++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 package/optee-client/0002-libteeacl-use-realloc-instead-of-reallocarray.patch
diff --git a/package/optee-client/0002-libteeacl-use-realloc-instead-of-reallocarray.patch b/package/optee-client/0002-libteeacl-use-realloc-instead-of-reallocarray.patch
new file mode 100644
index 0000000000..88f5a4f87e
--- /dev/null
+++ b/package/optee-client/0002-libteeacl-use-realloc-instead-of-reallocarray.patch
@@ -0,0 +1,34 @@
+From dde6306458331371be5df15e3ca953697d2463ef Mon Sep 17 00:00:00 2001
+From: Eero Aaltonen <eero.aaltonen@vaisala.com>
+Date: Thu, 2 Feb 2023 17:22:29 +0200
+Subject: [PATCH] libteeacl: use realloc() instead of reallocarray()
+
+Use realloc() instead of reallocarray(), since uClibc apparently does
+not implement reallocarray().
+
+Fixes: https://github.com/OP-TEE/optee_client/issues/339
+
+Signed-off-by: Eero Aaltonen <eero.aaltonen@vaisala.com>
+Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
+
+[Retrieved from:
+https://github.com/OP-TEE/optee_client/commit/dde6306458331371be5df15e3ca953697d2463ef]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ libteeacl/src/group.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libteeacl/src/group.c b/libteeacl/src/group.c
+index 10965dd0..bd165a11 100644
+--- a/libteeacl/src/group.c
++++ b/libteeacl/src/group.c
+@@ -72,7 +72,8 @@ enum rv_groupmember teeacl_user_is_member_of(const char *user, gid_t group)
+ if (ret == -1) {
+ p_groups = groups;
+
+- groups = reallocarray(groups, grouplistsize, sizeof(gid_t));
++ /* we use realloc, since uClibc does not implement reallocarray */
++ groups = realloc(groups, grouplistsize * sizeof(gid_t));
+ if (!groups) {
+ free(p_groups);
+ return E_MEMORY;
--
2.39.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/optee-client: fix uclibc build
2023-02-22 22:17 [Buildroot] [PATCH 1/1] package/optee-client: fix uclibc build Fabrice Fontaine
@ 2023-02-22 23:01 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-02-22 23:01 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: Etienne Carriere, buildroot
On Wed, 22 Feb 2023 23:17:50 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> Fix the following uclibc build failure raised since bump to version
> 3.19.0 in commit 917a961d9c77d5f1aaa47206add9b9ff80e74a82:
>
> /tmp/instance-5/output-1/build/optee-client-3.19.0/libteeacl/src/group.c: In function 'teeacl_user_is_member_of':
> /tmp/instance-5/output-1/build/optee-client-3.19.0/libteeacl/src/group.c:75:12: error: implicit declaration of function 'reallocarray' [-Werror=implicit-function-declaration]
> 75 | groups = reallocarray(groups, grouplistsize, sizeof(gid_t));
> | ^~~~~~~~~~~~
>
> Fixes:
> - http://autobuild.buildroot.org/results/03eba71ab9b87676f2606ecf2a9b5a151fc396bb
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> ...-use-realloc-instead-of-reallocarray.patch | 34 +++++++++++++++++++
> 1 file changed, 34 insertions(+)
> create mode 100644 package/optee-client/0002-libteeacl-use-realloc-instead-of-reallocarray.patch
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-22 23:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-22 22:17 [Buildroot] [PATCH 1/1] package/optee-client: fix uclibc build Fabrice Fontaine
2023-02-22 23:01 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox