aports/testing/newlib-esp/0001-getentropy-fix-compilation.patch
Marian Buschsieweke 9d167e6050 testing/newlib-esp: new aport
https://github.com/espressif/newlib-esp32
Espressif's fork of the newlib embeddable standard C library for
development with the ESP MCUs.
2024-06-19 15:12:31 +00:00

16 lines
792 B
Diff

This fixes a compilation issue due to a missing forward declaration of
_getentropy() by just adding it directly to the source code. This patch
should be dropped once the issue is fixed upstream.
diff --color -rupN a/newlib/libc/reent/getentropyr.c b/newlib/libc/reent/getentropyr.c
--- a/newlib/libc/reent/getentropyr.c 2023-09-19 10:47:57.000000000 +0200
+++ b/newlib/libc/reent/getentropyr.c 2024-06-17 10:30:43.013582277 +0200
@@ -45,6 +45,9 @@ _getentropy_r (struct _reent *ptr,
int ret;
errno = 0;
+ /* Implemented in libgloss/libnosys/getentropy.c. Patching in forward
+ * declaration as quick compilation fix */
+ extern int _getentropy(void *buf, size_t buflen);
if ((ret = _getentropy (buf, buflen)) == -1 && errno != 0)
_REENT_ERRNO(ptr) = errno;
return ret;