This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] rtems crt0: Add stubs for arc4random.
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- Cc: newlib at sourceware dot org, Christian Mauderer <christian dot mauderer at embedded-brains dot de>
- Date: Mon, 9 May 2016 12:38:31 -0400 (EDT)
- Subject: Re: [PATCH] rtems crt0: Add stubs for arc4random.
- Authentication-results: sourceware.org; auth=none
- References: <1462355117-13192-1-git-send-email-christian dot mauderer at embedded-brains dot de> <57302B58 dot 4040000 at embedded-brains dot de>
Patch applied.
-- Jeff J.
----- Original Message -----
> Ping. This patch is necessary so that Autoconf link-time tests can
> detect the arc4random() function on RTEMS.
>
> On 04/05/16 11:45, Christian Mauderer wrote:
> > From: Christian Mauderer <Christian.Mauderer@embedded-brains.de>
> >
> > ---
> > newlib/libc/sys/rtems/crt0.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/newlib/libc/sys/rtems/crt0.c b/newlib/libc/sys/rtems/crt0.c
> > index 3bf7083..1a0a055 100644
> > --- a/newlib/libc/sys/rtems/crt0.c
> > +++ b/newlib/libc/sys/rtems/crt0.c
> > @@ -16,6 +16,7 @@
> > #include <time.h> /* struct timespec */
> > #include <unistd.h> /* isatty */
> > #include <sys/lock.h> /* _Mutex_recursive_Control */
> > +#include <machine/_arc4random.h>
> > #include <machine/_libatomic.h>
> >
> > void rtems_provides_crt0( void ) {} /* dummy symbol so file always has
> > one */
> > @@ -66,6 +67,10 @@ RTEMS_STUB(void, _Libatomic_Protect_end(void *ptr,
> > __uint32_t isr_level), { });
> > RTEMS_STUB(void, _Libatomic_Lock_n(void *ptr, __size_t n), { });
> > RTEMS_STUB(void, _Libatomic_Unlock_n(void *ptr, __size_t n), { });
> >
> > +/* Stubs for routines for arc4random (from <unistd.h> and
> > <machine/_arc4random.h> */
> > +RTEMS_STUB(int, getentropy(void *ptr, __size_t n), { });
> > +RTEMS_STUB(void, _arc4random_getentropy_fail(void), { });
> > +
> > #if defined(__GNUC__)
> > /*
> > * stubs for libstdc++ rtems-threads support functions from
> > gcc/gthr-rtems.h
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail : sebastian.huber@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschÃftliche Mitteilung im Sinne des EHUG.
>
>