From 85ae35fdb7e541afdaa73b1e8878e7d37a393b58 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 13 Apr 2016 15:50:25 -0500 Subject: [PATCH] libc/sys/rtems/crt0.c: Add symbols required to link autoconf probes The dummy crt0.c provided by the RTEMS target provides stubs of symbols which would normally be provided by RTEMS. This patch adds stubs for posix_memalign() as well as the synchronization methods prototyped in . --- newlib/libc/sys/rtems/crt0.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/newlib/libc/sys/rtems/crt0.c b/newlib/libc/sys/rtems/crt0.c index a6f48f295..8d87fd4cf 100644 --- a/newlib/libc/sys/rtems/crt0.c +++ b/newlib/libc/sys/rtems/crt0.c @@ -15,6 +15,7 @@ #include /* sigset_t */ #include /* struct timespec */ #include /* isatty */ +#include /* _Mutex_recursive_Control */ void rtems_provides_crt0( void ) {} /* dummy symbol so file always has one */ @@ -27,7 +28,37 @@ RTEMS_STUB(void *,malloc(size_t s), { return 0; }) RTEMS_STUB(void *,realloc(void* p, size_t s), { return 0; }) RTEMS_STUB(void, free(void* ptr), { }) RTEMS_STUB(_PTR, calloc(size_t s1, size_t s2), { return 0; }) - +RTEMS_STUB(int, posix_memalign(void **p, size_t si, size_t s2), { return -1; }) + +/* Stubs for routines from RTEMS */ +RTEMS_STUB(void, _Mutex_Acquire(struct _Mutex_Control *p), { }) +RTEMS_STUB(int, _Mutex_Acquire_timed(struct _Mutex_Control *p1, const struct timespec *p2), { return -1; }) +RTEMS_STUB(int, _Mutex_Try_Acquire(struct _Mutex_Control *p), { return -1; }) +RTEMS_STUB(void, _Mutex_Release(struct _Mutex_Control *p), { }) + +RTEMS_STUB(void, _Mutex_recursive_Acquire(struct _Mutex_recursive_Control *p), { }) +RTEMS_STUB(int, _Mutex_recursive_Acquire_timed(struct _Mutex_recursive_Control *p1, const struct timespec *p2), { return -1; }) +RTEMS_STUB(int, _Mutex_recursive_Try_acquire(struct _Mutex_recursive_Control *p), { return -1; }) +RTEMS_STUB(void, _Mutex_recursive_Release(struct _Mutex_recursive_Control *p), { }) + +RTEMS_STUB(void, _Condition_Wait(struct _Condition_Control *p1, struct _Mutex_Control *p2), { }) +RTEMS_STUB(int, _Condition_Wait_timed(struct _Condition_Control *p1, struct _Mutex_Control *p2, const struct timespec *p3), { return -1; }) +RTEMS_STUB(void, _Condition_Wait_recursive(struct _Condition_Control *p1, struct _Mutex_recursive_Control *p2), { }) +RTEMS_STUB(int, _Condition_Wait_recursive_timed(struct _Condition_Control *p1, struct _Mutex_recursive_Control *p2, const struct timespec *p3), { return -1; }) +RTEMS_STUB(void, _Condition_Signal(struct _Condition_Control *p), { }) +RTEMS_STUB(void, _Condition_Broadcast(struct _Condition_Control *p), { }) + +RTEMS_STUB(void, _Semaphore_Wait(struct _Semaphore_Control *p), { }) +RTEMS_STUB(void, _Semaphore_Post(struct _Semaphore_Control *p), { }) + +RTEMS_STUB(int, _Futex_Wait(struct _Futex_Control *p1, int *p2, int i), { return -1; }) +RTEMS_STUB(int, _Futex_Wake(struct _Futex_Control *p, int i), { return -1; }) + +RTEMS_STUB(int, _Sched_Count(void), { return -1; }) +RTEMS_STUB(int, _Sched_Index(void), { return -1; }) +RTEMS_STUB(int, _Sched_Name_to_index(const char *p, size_t s), { return -1; }) +RTEMS_STUB(int, _Sched_Processor_count(int i), { return 1; }) + #if defined(__GNUC__) /* * stubs for libstdc++ rtems-threads support functions from gcc/gthr-rtems.h -- 2.43.5