This is the mail archive of the
newlib-cvs@sourceware.org
mailing list for the newlib project.
[newlib-cygwin] libc/sys/rtems/crt0.c: Add <sys/lock.h> symbols required to link autoconf probes
- From: Joel Sherrill <joel at sourceware dot org>
- To: newlib-cvs at sourceware dot org
- Date: 15 Apr 2016 14:39:09 -0000
- Subject: [newlib-cygwin] libc/sys/rtems/crt0.c: Add <sys/lock.h> symbols required to link autoconf probes
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=85ae35fdb7e541afdaa73b1e8878e7d37a393b58
commit 85ae35fdb7e541afdaa73b1e8878e7d37a393b58
Author: Joel Sherrill <joel@rtems.org>
Date: Wed Apr 13 15:50:25 2016 -0500
libc/sys/rtems/crt0.c: Add <sys/lock.h> 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 <sys/lock.h>.
Diff:
---
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 a6f48f2..8d87fd4 100644
--- a/newlib/libc/sys/rtems/crt0.c
+++ b/newlib/libc/sys/rtems/crt0.c
@@ -15,6 +15,7 @@
#include <signal.h> /* sigset_t */
#include <time.h> /* struct timespec */
#include <unistd.h> /* isatty */
+#include <sys/lock.h> /* _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 <sys/lock.h> */
+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